Skip to content

Commit

Permalink
Update Dockerfile and add build-docker.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
xwjdsh committed Apr 20, 2018
1 parent 2ab1cdf commit c736d6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM golang:1.9 as builder
ARG VERSION
WORKDIR /go/src/github.com/go-ignite/ignite
COPY . .
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o ignite .
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=${VERSION}" -o ignite .


FROM alpine
Expand All @@ -22,4 +23,4 @@ COPY --from=builder /go/src/github.com/go-ignite/ignite/conf ./conf
RUN mv ./conf/config-temp.toml ./conf/config.toml

EXPOSE 5000
CMD ["/bin/sh", "-c", "./ignite"]
ENTRYPOINT ["./ignite"]
2 changes: 2 additions & 0 deletions build-dokcer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /bin/bash
docker build --build-arg VERSION=`git describe` -t goignite/ignite .

0 comments on commit c736d6b

Please sign in to comment.