Skip to content

Instantly share code, notes, and snippets.

@franTarkenton
Last active February 5, 2024 20:24
Show Gist options
  • Save franTarkenton/bc7598ffc610d1863e315fd9b0ebc1e9 to your computer and use it in GitHub Desktop.
Save franTarkenton/bc7598ffc610d1863e315fd9b0ebc1e9 to your computer and use it in GitHub Desktop.

Docker / Podman - Table of Contents

Drawing

Configure required env vars

Working with Containers

list containers

podman container ls

kill container

podman container kill <container id>

Build / Run / Inspect Docker Image

  • Building the image with a tag bcdc:smk

podman image build -t bcdc:smk .

  • Run the image and log into it, (not all images come with /bin/bash, example with alpine you have to add the line:

RUN apk add bash

  • run the image and log into it for trouble shooting...
podman run -it -p 8080:8080 bcdc:smk /bin/bash
podman run -it -p 8080:8080 bcdc:smk sh
  • override the entrypoint
podman run -it --entrypoint /bin/sh bcdc:smk
  • pull / run image from docker hub
podman pull docker.io/guylafleur/gdal-util
podman run -it gdal-util /bin/bash
  • mount a local volume

mounts the directory: /home/lafleur/greatest_plays/stats to the directory in the container: /data

podman run --env-file=.env -v /home/lafleur/greatest_plays/stats:/data  -p 8080:8080 listener:listener`
  • cleanup all images

podman rmi -a -f

  • systematically clean everything

podman system prune -a

  • list running containers

podman ps -a

  • stop a container

podman stop <image id>

  • delete a specific container

podman rm <image id>

Common Errors

network error: temporary error (try again later)

#0 5.351 WARNING: updating and opening https://dl-cdn.alpinelinux.org/alpine/v3.19/main: temporary error (try again later)

updating the docker dns settings solved this for me

updated the dns setting for my docker install

edit the file: /etc/docker/daemon.json with,

{
  "dns": ["8.8.8.8"]
}

View / List docker images

Trouble shooting links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment