Skip to content

Commit

Permalink
Bump version to 0.5.0
Browse files Browse the repository at this point in the history
Fix build process to work with Dockerhub
  • Loading branch information
codesuki committed Jul 17, 2018
1 parent 53f1e63 commit 4110389
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
23 changes: 13 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM alpine

WORKDIR /root

RUN apk update && apk add ca-certificates openssl && update-ca-certificates

# download release of ecs-gen
ENV ECS_GEN_RELEASE 0.3.2
RUN wget https://github.com/codesuki/ecs-gen/releases/download/$ECS_GEN_RELEASE/ecs-gen-linux-amd64.zip && unzip ecs-gen-linux-amd64.zip && cp ecs-gen-linux-amd64 /usr/local/bin/ecs-gen

FROM golang:1.7.3-alpine AS builder
RUN apk update && apk add --no-cache git make
WORKDIR /go/src/github.com/codesuki/ecs-gen
COPY glide.lock glide.yaml Makefile /go/src/github.com/codesuki/ecs-gen/
# to statically link
ENV CGO_ENABLED 0
RUN go get -u github.com/Masterminds/glide && make deps
COPY . .
RUN make build

FROM alpine:3.8
RUN apk update && apk add --no-cache ca-certificates openssl && update-ca-certificates
COPY --from=builder /go/src/github.com/codesuki/ecs-gen/build/ecs-gen-linux-amd64 /usr/bin/ecs-gen
CMD ["ecs-gen"]
9 changes: 0 additions & 9 deletions Dockerfile.build

This file was deleted.

10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ WORKDIR = /go/src/github.com/codesuki/ecs-gen

LDFLAGS = -X main.version=$(VERSION)

.PHONY: docker build clean deps
.PHONY: docker build clean deps zip

docker:
docker build -t ecs-gen-builder:latest -f Dockerfile.build .
docker run --rm -v $(CURDIR):$(WORKDIR) ecs-gen-builder
docker build -t ecs-gen:latest -f Dockerfile .
docker build --target builder -t ecs-gen:latest .
docker run -v $(CURDIR)/build:/mnt/build --rm ecs-gen:latest cp -R $(WORKDIR)/build/ /mnt/
docker build -t ecs-gen:latest .
docker run --rm ecs-gen:latest ecs-gen --version

build: deps
for GOOS in darwin linux; do \
for GOARCH in 386 amd64; do \
GOOS=$$GOOS GOARCH=$$GOARCH go build -ldflags "$(LDFLAGS)" -v -o build/$(NAME)-$$GOOS-$$GOARCH ; \
GOOS=$$GOOS GOARCH=$$GOARCH go build -ldflags "$(LDFLAGS)" -o build/$(NAME)-$$GOOS-$$GOARCH ; \
done \
done

Expand Down

0 comments on commit 4110389

Please sign in to comment.