Skip to content

Instantly share code, notes, and snippets.

@scotticles
Last active December 2, 2020 16:01
Show Gist options
  • Save scotticles/7c80189951c4d5eaeb34096bcb207b04 to your computer and use it in GitHub Desktop.
Save scotticles/7c80189951c4d5eaeb34096bcb207b04 to your computer and use it in GitHub Desktop.
My Podman Notes

Podman Notes

I really like how podman is non-root capable and so this project I am working on I decided to ditch docker for it and run it as a user. I am using it on Ubuntu.

Just to make a note here, I am not using a registry, I had one on my raspberryPi but could not get the certificates to work correctly, after following like 3 different how to's I didn't want to invest anymore time. I could use dockerhub but I need this to be private, and they recently added limits. SO This a way to save and load in a image.

for the most part the dockerfile is exactly the same. So carry on with that.

Deploying

podman save --compress -o myimage.tar imagename
scp myimage.tar [email protected]:.

On the server
podman load -i myimage.tar

Everythign else is similiar with podman run, if you mount a volume this is where it gets weird IF you are running as a user and not root.

running non-privileged and with a volume

use this as a resource

The user in my container is 1000:1000 UID AND GUID, you have to use this command to set the permissions within the userspace of podman.

podman unshare chown 1000:1000 -R file/path/of/mount/*
Then on your podman run -v /home/scott/mypodmanfiles/conf:/conf:z   <-- add that :z

This took me some time to figure out, do I like it no, but I can run this container as non-root now. Very cool.

Found another resource that covers a lot:

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