Skip to main content

Go net/http REST

The Go reference stack produces two container images from a single multi-stage Dockerfile using a SERVICE build argument.

Images​

ImageDefault PortBase Image
stemix-go-net-http-rest-web3300gcr.io/distroless/static-debian12:nonroot
stemix-go-net-http-rest-bff8300gcr.io/distroless/static-debian12:nonroot

Build​

# Both images
make -C stacks/go/net-http/rest build-containers

# Individual
make -C stacks/go/net-http/rest build-container-web
make -C stacks/go/net-http/rest build-container-bff

Environment Variables​

VariableDefaultDescription
OUR_IDP_WEB_HOST0.0.0.0Web server bind address
OUR_IDP_API_HOST0.0.0.0BFF server bind address
OUR_IDP_PORT3300Web server port
OUR_IDP_API_PORT8300BFF server port

Security​

  • Runtime image uses distroless with nonroot user (UID 65534).
  • No shell, package manager, or writable filesystem in the final image.
  • Statically linked Go binary with CGO disabled.

Dockerfile​

Located at stacks/go/net-http/rest/Dockerfile. Uses golang:1.25-alpine builder stage and gcr.io/distroless/static-debian12:nonroot runtime.