Skip to content

Commit

Permalink
Modified the docker file to build properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Phillips committed Apr 17, 2020
1 parent 24d057c commit f874f44
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
FROM golang:alpine

# Set necessary environmet variables needed for our image
ENV GO111MODULE=on \
ENV GO111MODULE=auto \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64

WORKDIR /app

COPY go.mod .
COPY go.sum .

RUN go mod download

# Copy the code into the container
COPY . .

# Build the application
RUN go build -o main .

# Move to /dist directory as the place for resulting binary folder
WORKDIR /dist

# Copy binary from build to main folder
RUN cp /build/main .
RUN go build

# Command to run when starting the container
CMD ["/dist/main"]
ENTRYPOINT ["/app/main"]

0 comments on commit f874f44

Please sign in to comment.