Our great sponsors
-
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.
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.
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
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
Related posts
- Understanding Buildpacks in Cloud Native Buildpacks
- The transitory nature of MLOps: Advocating for DevOps/MLOps coalescence
- Exploring 5 Docker Alternatives: Containerization Choices for 2024
- The Road To Kubernetes: How Older Technologies Add Up
- Several container breakouts due to internally leaked fds