Skip to content

Instantly share code, notes, and snippets.

@ereshzealous
Last active February 13, 2020 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ereshzealous/0245426152193a0de6e373b892dfb89d to your computer and use it in GitHub Desktop.
Save ereshzealous/0245426152193a0de6e373b892dfb89d to your computer and use it in GitHub Desktop.
# Start from the latest golang base image
FROM golang:alpine
RUN GOCACHE=OFF
RUN go env -w GOPRIVATE=github.com/ereshzealous
# Set the Current Working Directory inside the container
WORKDIR /app
# Copy everything from the current directory to the Working Directory inside the container
COPY . .
RUN apk add git
RUN git config --global url."https://golang:<access-token>@github.com".insteadOf "https://github.com"
# Build the Go app
RUN go build -o main .
# Expose port 8080 to the outside world
EXPOSE 8080
#ENTRYPOINT ["/app"]
# Command to run the executable
CMD ["./main"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment