Skip to content

Commit

Permalink
修改docker打包代码
Browse files Browse the repository at this point in the history
  • Loading branch information
shiguanghuxian committed Dec 26, 2018
1 parent 3dfb7f5 commit 448d6e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ default:
@echo 'Usage of make: [ build | linux_build | windows_build | build_web | clean ]'

build:
@go build -ldflags "-X main.VERSION=1.0.0 -X main.GIT_HASH=`git rev-parse HEAD` -s" -o ./bin/etcd-manage ./
@go build -o ./bin/etcd-manage ./

linux_build:
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.VERSION=1.0.0 -X main.GIT_HASH=`git rev-parse HEAD` -s" -o ./bin/etcd-manage ./
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/etcd-manage ./

windows_build:
@CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-X main.VERSION=1.0.0 -X main.GIT_HASH=`git rev-parse HEAD` -s" -o ./bin/etcd-manage.exe ./
@CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ./bin/etcd-manage.exe ./

docker_build: linux_build


docker build -t shiguanghuxian/etcd-manage .

run: build
@./bin/etcd-manage
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ services:
- 2380:2380
- 4001:4001
etcd-manage:
build: .
# build: .
image: "shiguanghuxian/etcd-manage"
volumes:
- ./bin/config/cfg.toml:/app/config/cfg.toml
ports:
Expand Down

0 comments on commit 448d6e7

Please sign in to comment.