Deploying Go in Containers
Contents
Example
To deploy a Go application in a container, try the following Dockerfile:
FROM golang:latest WORKDIR /app COPY src/* ./ RUN go mod download RUN go build -o /app/my-bin EXPOSE 8080 RUN adduser -H -D -u 1001 me USER me:me CMD [ "/app/my-bin" ]