Skip to content

Commit

Permalink
feat(podman): Authenticate to artifact registry (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
userbradley authored Oct 14, 2024
1 parent 43ac09b commit f615d2d
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 1 deletion.
114 changes: 114 additions & 0 deletions docs/kb/podman/authenticate-podman-to-google-artifact-registry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: Authenticate Podman to Google Artifact Registry
---

## What

Podman, like docker, stores it's Images in remote registers. One of the _many many_ options to chose from is [Google Artifact Registry](https://cloud.google.com/artifact-registry/docs)

## How

=== "Set your own"

To get all the possible regions, use the `gcloud artifacts locations list` command

```shell
export region=<>
gcloud auth configure-docker $region-docker.pkg.dev
```

=== "europe-west2"

```shell
gcloud auth configure-docker europe-west2-docker.pkg.dev
```

Then copy the file to your Podman config file

!!! warning "This will overwrite changes"
The below command will overwrite the changes to your `~/.config/containers/config.json`

```shell
cp ~/.docker/config.json ~/.config/containers/config.json
```

## Example file to copy and paste from

!!! note "This may or may not work"
The below is not tested, but it _should work_

If you need an example file of all regions etc., the below is an example

```json
{
"credHelpers": {
"gcr.io": "gcloud",
"us.gcr.io": "gcloud",
"eu.gcr.io": "gcloud",
"asia.gcr.io": "gcloud",
"staging-k8s.gcr.io": "gcloud",
"marketplace.gcr.io": "gcloud",
"asia-docker.pkg.dev": "gcloud",
"asia-east1-docker.pkg.dev": "gcloud",
"asia-east2-docker.pkg.dev": "gcloud",
"asia-northeast1-docker.pkg.dev": "gcloud",
"asia-northeast2-docker.pkg.dev": "gcloud",
"asia-northeast3-docker.pkg.dev": "gcloud",
"asia-south1-docker.pkg.dev": "gcloud",
"asia-south2-docker.pkg.dev": "gcloud",
"asia-southeast1-docker.pkg.dev": "gcloud",
"asia-southeast2-docker.pkg.dev": "gcloud",
"australia-southeast1-docker.pkg.dev": "gcloud",
"australia-southeast2-docker.pkg.dev": "gcloud",
"europe-docker.pkg.dev": "gcloud",
"europe-central2-docker.pkg.dev": "gcloud",
"europe-north1-docker.pkg.dev": "gcloud",
"europe-southwest1-docker.pkg.dev": "gcloud",
"europe-west1-docker.pkg.dev": "gcloud",
"europe-west10-docker.pkg.dev": "gcloud",
"europe-west12-docker.pkg.dev": "gcloud",
"europe-west2-docker.pkg.dev": "gcloud",
"europe-west3-docker.pkg.dev": "gcloud",
"europe-west4-docker.pkg.dev": "gcloud",
"europe-west6-docker.pkg.dev": "gcloud",
"europe-west8-docker.pkg.dev": "gcloud",
"europe-west9-docker.pkg.dev": "gcloud",
"me-central1-docker.pkg.dev": "gcloud",
"me-central2-docker.pkg.dev": "gcloud",
"me-west1-docker.pkg.dev": "gcloud",
"northamerica-northeast1-docker.pkg.dev": "gcloud",
"northamerica-northeast2-docker.pkg.dev": "gcloud",
"southamerica-east1-docker.pkg.dev": "gcloud",
"southamerica-west1-docker.pkg.dev": "gcloud",
"us-docker.pkg.dev": "gcloud",
"us-central1-docker.pkg.dev": "gcloud",
"us-east1-docker.pkg.dev": "gcloud",
"us-east4-docker.pkg.dev": "gcloud",
"us-east5-docker.pkg.dev": "gcloud",
"us-south1-docker.pkg.dev": "gcloud",
"us-west1-docker.pkg.dev": "gcloud",
"us-west2-docker.pkg.dev": "gcloud",
"us-west3-docker.pkg.dev": "gcloud",
"us-west4-docker.pkg.dev": "gcloud"
}
}
```

### How this file is generated

Regions can be listed using `gcloud artifacts locations list`

File format is

```json
{
"credHelpers": {
"region-name-docker.pkg.dev.": "gcloud"
}
}
```

## Further reading

* [Authenticate to google artifact registry](../../cloud/gcp/authenticate-to-google-artifact-registry.md)
* [Get secret from docker-credential-gcloud cli](../../cloud/gcp/get-secret-from-docker-credential-gcloud-cli.md)
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ nav:
- Set grocy to use pritunl Zero usernames: kb/grocy/set-grocy-to-use-pritunl-username.md
- Juniper:
- Juniper Router Selection: kb/juniper/juniper-router-selection.md
- Junos useful commands: kb/kuniper/junos-useful-commands.md
- Junos useful commands: kb/juniper/junos-useful-commands.md
- Linux Command line:
- Always restart service after failure systemd: kb/linux-cli/always-restart-service-after-failure-systemd.md
- Backup SQlite Database: kb/linux-cli/backup-sqlite-db.md
Expand Down Expand Up @@ -269,6 +269,7 @@ nav:
- Podman:
- kb/podman/index.md
- Authenticate Podman to GitHub Container Registry: kb/podman/authenticate-podman-to-ghcr.md
- Authenticate Podman to Google Artifact Registry: kb/podman/authenticate-podman-to-google-artifact-registry.md
- Configure podman to use Remote Google Container Registry: kb/podman/podmain-google-artifact-registry-mirror.md
- docker-credential-desktop executable file not found in path: kb/podman/docker-credential-desktop-not-installed.md
- Podman mount directories on Mac: kb/podman/podman-mount-directories-mac.md
Expand Down

0 comments on commit f615d2d

Please sign in to comment.