Skip to content

Source: examples/safe/compose/hello-compose/backend/Containerfile#

FROM docker.io/library/golang:1.22 AS build


WORKDIR /compose/hello-container
COPY main.go main.go
RUN CGO_ENABLED=0 go build -o backend main.go

FROM scratch
COPY --from=build /compose/hello-container/backend /usr/local/bin/backend
CMD ["/usr/local/bin/backend"]