Docker Registry
Create a docker image repository in GCP's Artifact Registry service and push an image to it.
These steps are written as an example for the qa-gcp3
project using the us-east1
location.
Prerequisites
Install and configure the
gcloud
CLI.Run
gcloud info
and confirm it shows your email address and GCP project.
Create the Repository
Navigate to Repositories in the Artifact Registry service in the GCP UI and create a repository:
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 its page in the UI. You'll need this to tag the image you build later. The path will look similar to this:
Build and Push an Image
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 should now show up in the GCP UI:
Use the Image in DuploCloud
Reference the image tag you just pushed 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), like this:
Last updated