Docker Registry
Set up a Docker Registry image repository
Last updated
Set up a Docker Registry image repository
Last updated
© DuploCloud, Inc. All rights reserved. DuploCloud trademarks used herein are registered trademarks of DuploCloud and affiliates
Create a docker image repository in GCP's Artifact Registry service and push an image to it.
Install and configure the gcloud
CLI.
Run gcloud info
and confirm it shows your email address and GCP project.
These steps are written as an example for the qa-gcp3
project using the us-east1
location.
Navigate Google Cloud Console and create a repository with the following inputs:
Type: Docker
Mode: Standard
Location: Unless you know you need multiple regions, use the same region as your Duplo portal.
Encryption: Google-managed encryption key
Immutable tags: Enabled (this isn't required, but it's a common good practice)
Cleanup policies: Dry run
Copy the repo path from the Google UI. This will be used to tag the image later. The path will look similar to this: us-east1-docker.pkg.dev/qa-gcp3/testrepo
.
Now you can tag and push any image you build. On some platforms (like Apple M1 laptops), you may need to specify a build architecture.
Authenticate Docker with GCP:
gcloud auth configure-docker us-east1-docker.pkg.dev
Build an image:
docker build --platform linux/amd64 . -t testimage:amd64
Add a tag to the image that includes the repo path from above:
docker tag testimage:amd64 us-east1-docker.pkg.dev/qa-gcp3/testrepo/testimage:amd64
(Alternatively, you can add this tag with -t
flags in the build step.)
Push the image:
docker push us-east1-docker.pkg.dev/qa-gcp3/testrepo/testimage:amd64
The image tag displays in the GCP UI:
Enter the image tag in the Docker Image field of any DuploCloud Service running in the same GCP account. Use the full path and tag (the arguments to the push
command) as shown below.