Deploying Go in Containers


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" ]


CategoryRicottone

Go/DeployingInContainers (last edited 2023-04-03 02:52:33 by DominicRicottone)