From 18905ec85b31bb51e72f98ff1cf134775059295d Mon Sep 17 00:00:00 2001 From: Harry Pidcock Date: Mon, 9 Oct 2023 10:38:03 +1000 Subject: [PATCH 1/3] Add ghcr.io as a repository to push to. --- images.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/images.yaml b/images.yaml index 22103e1..5903356 100644 --- a/images.yaml +++ b/images.yaml @@ -6,6 +6,7 @@ images: registry_paths: - docker.io/jujusolutions/charm-base - public.ecr.aws/juju/charm-base + - ghcr.io/juju/charm-base tags: - ubuntu-22.04 - latest @@ -27,6 +28,7 @@ images: registry_paths: - docker.io/jujusolutions/charm-base - public.ecr.aws/juju/charm-base + - ghcr.io/juju/charm-base tags: - ubuntu-20.04 platforms: @@ -47,6 +49,7 @@ images: registry_paths: - docker.io/jujusolutions/charm-base - public.ecr.aws/juju/charm-base + - ghcr.io/juju/charm-base tags: - ubuntu-18.04 platforms: From cbceb4034cc72134eed6d95ec5fc77c58e22144e Mon Sep 17 00:00:00 2001 From: Harry Pidcock Date: Mon, 9 Oct 2023 10:38:23 +1000 Subject: [PATCH 2/3] Add juju user and group with uid/gid from juju/juju project. --- Dockerfile-ubuntu | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile-ubuntu b/Dockerfile-ubuntu index 59406e4..b643b2c 100644 --- a/Dockerfile-ubuntu +++ b/Dockerfile-ubuntu @@ -4,9 +4,13 @@ ARG BASE_IMAGE FROM $BASE_IMAGE -RUN apt-get update +# Add the juju user for rootless agents. +# 170 uid/gid is sourced from juju/juju +RUN groupadd --gid 170 juju +RUN useradd --uid 170 --gid 170 --no-create-home --shell /usr/bin/bash juju -RUN apt-get install -y --no-install-recommends \ +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ python3-yaml \ python3-pip \ python3-distutils \ From 99a2264199bbb99ccefccacb06d55dc15a4c5adc Mon Sep 17 00:00:00 2001 From: Harry Pidcock Date: Mon, 9 Oct 2023 10:40:39 +1000 Subject: [PATCH 3/3] Login to ghcr.io --- .github/workflows/release.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fddfec2..0648a7c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -104,18 +104,25 @@ jobs: EOF - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to ECR Public - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: public.ecr.aws username: ${{ secrets.RELEASE_ECR_ACCESS_KEY_ID }} password: ${{ secrets.RELEASE_ECR_SECRET_ACCESS_KEY }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push images if: ${{ success() && github.ref == 'refs/heads/master' }} run: |