Skip to content

Docker & Podman: Access & secrets

Docker & Podman commands for access & secrets (tags: #access #secrets #ssh).

Index
3 items

Docker2

Docker: Open a shell inside a container

Safe

Interactive shell in a running container. Use bash if the image has it.

docker exec -it <container> sh
What each part does
  1. docker execrun a command in a running container
  2. -itinteractive + allocate a terminal
  3. <container>container name or ID
  4. shthe shell to start; use bash if the image has it

Also known as: docker exec · shell into container

Docker: Log in to a registry without leaking the password

Safe

Pipe the token in so it never shows up in shell history or ps.

echo "$REGISTRY_TOKEN" | docker login <registry> -u <username> --password-stdin
What each part does
  1. echo "$REGISTRY_TOKEN"print the token from an env var (not typed on the command line)
  2. |pipe it into the next command's stdin
  3. docker login <registry>authenticate to the registry
  4. -u <username>the user name
  5. --password-stdinread the password from stdin, so it stays out of shell history and ps

Also known as: docker login · unauthorized: authentication required

Podman1

Podman: Log in to a registry

Safe

Store registry credentials for pulls and pushes (auth.json).

podman login <registry> -u <username>
What each part does
  1. podman login <registry>authenticate to a registry, e.g. quay.io
  2. -u <username>the user name; prompts for the password (or use --password-stdin)

Also known as: podman login · unauthorized

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…