Skip to content

Commit

Permalink
feat: add VERSION to ci-base-image (#1735)
Browse files Browse the repository at this point in the history
# 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>
  • Loading branch information
mattheworris authored Oct 25, 2023
1 parent 7f66d6a commit 8c78af3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/merge-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}}
3 changes: 3 additions & 0 deletions tools/ci/docker/ci-base-image.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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

0 comments on commit 8c78af3

Please sign in to comment.