Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add labels to the resulting image containing the build properties. #98

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
*.cache-to=type=gha,mode=max,scope=${{ matrix.image.name }}
push: ${{ github.event_name == 'push' && vars.PUSH_TO_REGISTRY == 'true' && github.ref_type == 'tag' }}
- name: Point IOC Dockerfile to image that was just built
run: sed -i "s/v.*-dev/$TAG/" Dockerfile
run: sed -i -E "s/v[0-9]+\.[0-9]+\.[0-9]+-dev/$TAG/" Dockerfile
gustavosr8 marked this conversation as resolved.
Show resolved Hide resolved
- name: Configure builder using docker driver
uses: docker/setup-buildx-action@v3
id: dockerbuilder
Expand Down
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ FROM ghcr.io/cnpem/lnls-debian-epics-7:v0.12.0-dev AS build-image

FROM debian:${DEBIAN_VERSION}-slim AS base

ARG DEBIAN_VERSION

ARG RUNDIR
ARG ENTRYPOINT=/usr/local/bin/lnls-run
ARG RUNTIME_PACKAGES
ARG RUNTIME_TAR_PACKAGES
ARG RUNTIME_PIP_PACKAGES

LABEL br.lnls.epics-in-docker.version="v0.12.0-dev"
LABEL br.lnls.epics-in-docker.debian.version=${DEBIAN_VERSION}

COPY --from=build-image /etc/apt/apt.conf.d/90-disable-sandbox.conf /etc/apt/apt.conf.d/90-disable-sandbox.conf

RUN apt update -y && \
Expand Down Expand Up @@ -44,8 +49,9 @@ ENTRYPOINT ["./entrypoint"]

FROM base AS no-build

COPY --from=build-image /opt /opt
LABEL br.lnls.epics-in-docker.target="no-build"
gustavosr8 marked this conversation as resolved.
Show resolved Hide resolved

COPY --from=build-image /opt /opt

FROM build-image AS build-stage

Expand Down Expand Up @@ -78,8 +84,9 @@ RUN make distclean && make -j ${JOBS} && make $([ "$SKIP_TESTS" != 1 ] && echo r

FROM base AS dynamic-link

COPY --from=dynamic-build /opt /opt
LABEL br.lnls.epics-in-docker.target="dynamic-link"

COPY --from=dynamic-build /opt /opt

FROM build-stage AS static-build

Expand All @@ -96,4 +103,6 @@ FROM base AS static-link

ARG REPONAME

LABEL br.lnls.epics-in-docker.target="static-link"

COPY --from=static-build /opt/${REPONAME} /opt/${REPONAME}
Loading