Skip to content

Commit

Permalink
Update Dockerfiles for Go module-based builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
novabyte committed Sep 12, 2019
1 parent 18ae14f commit fe4f8f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
8 changes: 4 additions & 4 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ ENV CGO_ENABLED 1

RUN apk --no-cache add ca-certificates gcc musl-dev git && \
git config --global advice.detachedHead false && \
git clone --quiet --no-checkout https://github.com/heroiclabs/nakama /go/src/github.com/heroiclabs/nakama
git clone --quiet --no-checkout https://github.com/heroiclabs/nakama /go/build/nakama

WORKDIR /go/src/github.com/heroiclabs/nakama
WORKDIR /go/build/nakama
RUN git checkout --quiet "$commit" && \
go build -o /go/build/nakama -gcflags "-trimpath $PWD" -asmflags "-trimpath $PWD" -ldflags "-s -w -X main.version=$version -X main.commitID=$commit"
go build -o /go/build-out/nakama -trimpath -mod=vendor -gcflags "-trimpath $PWD" -asmflags "-trimpath $PWD" -ldflags "-s -w -X main.version=$version -X main.commitID=$commit"

FROM alpine:3.10

Expand All @@ -46,7 +46,7 @@ RUN mkdir -p /nakama/data/modules && \
apk --no-cache add ca-certificates curl iproute2 unzip rsync git tini

WORKDIR /nakama/
COPY --from=builder "/go/build/nakama" /nakama/
COPY --from=builder "/go/build-out/nakama" /nakama/
EXPOSE 7349 7350 7351

ENTRYPOINT ["/sbin/tini", "--", "/nakama/nakama"]
Expand Down
9 changes: 1 addition & 8 deletions build/pluginbuilder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ ENV GOOS linux
ENV GOARCH amd64
ENV CGO_ENABLED 1

RUN apk --no-cache add ca-certificates gcc musl-dev git && \
git config --global advice.detachedHead false && \
git clone --quiet --no-checkout https://github.com/heroiclabs/nakama.git /go/src/github.com/heroiclabs/nakama

WORKDIR /go/src/github.com/heroiclabs/nakama
RUN git checkout --quiet "$commit"

WORKDIR /go/src/tempbuild/
RUN apk --no-cache add ca-certificates gcc musl-dev git

ENTRYPOINT ["go"]

0 comments on commit fe4f8f0

Please sign in to comment.