Google Artifact Registry

Originally, the Docker image hosting was done on DockerHub, which offers hosting of ONE private Docker image. Our project requires at least two, so we had to find other solutions.

Google Cloud Platform

And it is in our research that we discovered Google Cloud Platform, also called “GCP”.
This set of cloud tools signed by Google offers a Docker container hosting service called Google Artifact Registry, and offers a trial offer including $300 for 90 days.
Considering the cheapness of this solution (price here: https://cloud.google.com/artifact-registry/pricing) and the credit offered to us, we decided to take advantage of this offer, in order to upgrade our Docker image hosting.

Collaboration

The other advantage of this platform is that you can designate people to manage the registry in addition to the person who has the subscription.
This allows greater autonomy of the team members, and allows the use of other services (VMWare, Cloud Build) by other people on the same subscription.

Configuration

Obviously, a change of platform also means a change of configuration! Here are the things that have changed:

name: Docker Image CI

on:
  push:
    branches: [ main ]

jobs:
  build:
    runs-on: sdn-api
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - name: Docker login
      env:
        DOCKER_USER: ${{secrets.DOCKER_USER}}
        DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
      run: |
                docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
      working-directory: /home/user/SDN-Cloudstack/SDN-Cloudstack
    - name: Build the Docker image
      run: docker image build . --file Dockerfile --tag europe-west1-docker.pkg.dev/sdn-cloudstack/alestrio/sdn-cloudstack:latest
      working-directory: /home/user/SDN-Cloudstack/SDN-Cloudstack
    - name: Docker push
      run: docker image push europe-west1-docker.pkg.dev/sdn-cloudstack/alestrio/sdn-cloudstack:latest
      working-directory: /home/user/SDN-Cloudstack/SDN-Cloudstack
  • Finally, change the docker-compose.yaml :
api_r1:
    restart: always
    image: europe-west1-docker.pkg.dev/sdn-cloudstack/alestrio/sdn-cloudstack:latest