Building Production Grade Container Images

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • image-spec

    OCI Image Format

  • The Open Container Initiative has label suggestions which are commonly known and accepted. OCI Annotations. The older deprecated version of the spec has better explanations in my opinion and since many labels were basically just renamed its can be useful too check out label-schema.org documentation as well.

  • Dockerfile

  • FROM golang as builder WORKDIR /src/echo-server COPY . . ARG VET_FLAGS="" RUN go vet "$VET_FLAGS" ARG TEST_FLAGS="" RUN go test "$TEST_FLAGS" ARG LD_FLAGS='-linkmode external -w -extldflags "-static"' ARG BUILD_FLAGS="" RUN go build -ldflags "$LD_FLAGS" -o echo-server "$BUILD_FLAGS" # --- FROM alpine as runner RUN apk add --update curl && rm -rf /var/cache/apk/* HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ CMD curl -f localhost || exit 1 RUN adduser \ --disabled-password \ --gecos "" \ --home /run \ --no-create-home \ "docker" CMD ["/run/echo-server"] ARG version="0.1.0" ARG env="dev" ARG branch="main" ARG commit_hash="unknown" ARG created="unknown" LABEL org.opencontainers.image.created=${created} \ org.opencontainers.image.url="https://github.com/my-repo" \ org.opencontainers.image.source="https://github.com/my-repo/Dockerfile" \ org.opencontainers.image.version="${version}-${env}" \ org.opencontainers.image.revision=${commit_hash} \ org.opencontainers.image.vendor="rainbowstack" \ org.opencontainers.image.title="echo-server" \ org.opencontainers.image.description="go echo server" \ org.opencontainers.image.documentation="https://github.com/my-repo/README.md" \ org.opencontainers.image.authors="nico braun" \ org.opencontainers.image.licenses="(BSD-1-Clause)" \ org.opencontainers.image.ref.name=${branch} \ dev.rainbowstack.environment="${env}" COPY --from=builder /src/echo-server /run/ USER docker

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • README.md

  • FROM golang as builder WORKDIR /src/echo-server COPY . . ARG VET_FLAGS="" RUN go vet "$VET_FLAGS" ARG TEST_FLAGS="" RUN go test "$TEST_FLAGS" ARG LD_FLAGS='-linkmode external -w -extldflags "-static"' ARG BUILD_FLAGS="" RUN go build -ldflags "$LD_FLAGS" -o echo-server "$BUILD_FLAGS" # --- FROM alpine as runner RUN apk add --update curl && rm -rf /var/cache/apk/* HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ CMD curl -f localhost || exit 1 RUN adduser \ --disabled-password \ --gecos "" \ --home /run \ --no-create-home \ "docker" CMD ["/run/echo-server"] ARG version="0.1.0" ARG env="dev" ARG branch="main" ARG commit_hash="unknown" ARG created="unknown" LABEL org.opencontainers.image.created=${created} \ org.opencontainers.image.url="https://github.com/my-repo" \ org.opencontainers.image.source="https://github.com/my-repo/Dockerfile" \ org.opencontainers.image.version="${version}-${env}" \ org.opencontainers.image.revision=${commit_hash} \ org.opencontainers.image.vendor="rainbowstack" \ org.opencontainers.image.title="echo-server" \ org.opencontainers.image.description="go echo server" \ org.opencontainers.image.documentation="https://github.com/my-repo/README.md" \ org.opencontainers.image.authors="nico braun" \ org.opencontainers.image.licenses="(BSD-1-Clause)" \ org.opencontainers.image.ref.name=${branch} \ dev.rainbowstack.environment="${env}" COPY --from=builder /src/echo-server /run/ USER docker

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts