github.com/sudo-bmitch/version-bump@v0.0.0-20240503123857-70b0e3f646dd/Dockerfile (about)

     1  ARG REGISTRY=docker.io
     2  ARG ALPINE_VER=3.19.1@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
     3  ARG GO_VER=1.22.2-alpine@sha256:cdc86d9f363e8786845bea2040312b4efa321b828acdeb26f393faa864d887b0
     4  
     5  FROM ${REGISTRY}/library/golang:${GO_VER} as build
     6  RUN apk add --no-cache \
     7        ca-certificates \
     8        make
     9  RUN adduser -D appuser
    10  WORKDIR /src
    11  COPY . /src/
    12  RUN make bin/version-bump
    13  USER appuser
    14  CMD [ "bin/version-bump" ]
    15  
    16  FROM scratch as artifact
    17  COPY --from=build /src/bin/version-bump /version-bump
    18  
    19  FROM ${REGISTRY}/library/alpine:${ALPINE_VER} as release-alpine
    20  COPY --from=build /etc/passwd /etc/group /etc/
    21  COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
    22  COPY --from=build --chown=appuser /home/appuser /home/appuser
    23  COPY --from=build /src/bin/version-bump /usr/local/bin/version-bump
    24  USER appuser
    25  CMD [ "version-bump", "--help" ]
    26  LABEL maintainer="" \
    27        org.opencontainers.image.authors="https://github.com/sudo-bmitch" \
    28        org.opencontainers.image.url="https://github.com/sudo-bmitch/version-bump" \
    29        org.opencontainers.image.documentation="https://github.com/sudo-bmitch/version-bump" \
    30        org.opencontainers.image.source="https://github.com/sudo-bmitch/version-bump" \
    31        org.opencontainers.image.version="latest" \
    32        org.opencontainers.image.vendor="" \
    33        org.opencontainers.image.licenses="Apache 2.0" \
    34        org.opencontainers.image.title="version-bump" \
    35        org.opencontainers.image.description=""
    36  
    37  FROM scratch as release-scratch
    38  COPY --from=build /etc/passwd /etc/group /etc/
    39  COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
    40  COPY --from=build --chown=appuser /home/appuser /home/appuser
    41  COPY --from=build /src/bin/version-bump /version-bump
    42  USER appuser
    43  ENTRYPOINT [ "/version-bump" ]
    44  CMD [ "--help" ]
    45  LABEL maintainer="" \
    46        org.opencontainers.image.authors="https://github.com/sudo-bmitch" \
    47        org.opencontainers.image.url="https://github.com/sudo-bmitch/version-bump" \
    48        org.opencontainers.image.documentation="https://github.com/sudo-bmitch/version-bump" \
    49        org.opencontainers.image.source="https://github.com/sudo-bmitch/version-bump" \
    50        org.opencontainers.image.version="latest" \
    51        org.opencontainers.image.vendor="" \
    52        org.opencontainers.image.licenses="Apache 2.0" \
    53        org.opencontainers.image.title="version-bump" \
    54        org.opencontainers.image.description=""