From 8c78af3f7f992b7024f1ae51a4a475a3437eb0ec Mon Sep 17 00:00:00 2001 From: Matthew Orris <1466844+mattheworris@users.noreply.github.com> Date: Wed, 25 Oct 2023 04:14:38 +0100 Subject: [PATCH] feat: add VERSION to ci-base-image (#1735) # Goal The goal of this PR is to add a version to the `ci-base-image` container when it is published to DockerHub. `IMAGE_VERSION` is added to the publishing jobs and stored as a `LABEL` in the container itself. `IMAGE_VERSION` will be baselined as `1.0.0` `docker inspect` can be used to check the version of a container and should be in-sync with the tag version. A follow on PR will be used to update the github workflows to use the version number. # Discussion The current workflows pull using the defaults, which is the `latest` tag. Adding a version will allows us better traceability and better maintenance moving forward. --------- Co-authored-by: Matthew Orris <--help> --- .github/workflows/merge-pr.yml | 3 +++ tools/ci/docker/ci-base-image.dockerfile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/merge-pr.yml b/.github/workflows/merge-pr.yml index b93a2306d2..c8c4076348 100644 --- a/.github/workflows/merge-pr.yml +++ b/.github/workflows/merge-pr.yml @@ -81,6 +81,7 @@ jobs: name: Publish CI Base Image env: IMAGE_NAME: ci-base-image + IMAGE_VERSION: 1.0.0 BRANCH_NAME: main runs-on: ubuntu-20.04 steps: @@ -113,3 +114,5 @@ jobs: tags: | ${{steps.repo_slug.outputs.result}}/${{env.IMAGE_NAME}}:${{env.BRANCH_NAME}} ${{steps.repo_slug.outputs.result}}/${{env.IMAGE_NAME}}:latest + ${{steps.repo_slug.outputs.result}}/${{env.IMAGE_NAME}}:${{env.IMAGE_VERSION}}} + build-args: IMAGE_VERSION=${{env.IMAGE_VERSION}} diff --git a/tools/ci/docker/ci-base-image.dockerfile b/tools/ci/docker/ci-base-image.dockerfile index e7d1aecc85..9abe32bb47 100644 --- a/tools/ci/docker/ci-base-image.dockerfile +++ b/tools/ci/docker/ci-base-image.dockerfile @@ -3,6 +3,8 @@ FROM --platform=linux/amd64 ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive LABEL maintainer="Frequency" LABEL description="Frequency CI base image" +ARG IMAGE_VERSION +LABEL version="{IMAGE_VERSION}" WORKDIR /ci RUN apt-get update && \ @@ -17,5 +19,6 @@ ENV RUSTUP_HOME="/root/.cargo" ENV CARGO_HOME="/root/.cargo" RUN rustup toolchain install nightly-2023-07-13 RUN rustup target add x86_64-unknown-linux-gnu --toolchain nightly-2023-07-13 +RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2023-07-13 RUN git config --system --add safe.directory /__w/frequency/frequency