I'm not really sure where the right place to ask is, but I figure this is a good place for docker related questions.
I have recently installed Bazzite as my daily driver, previously I was on Nobara. The main difference here is that Bazzite is immutable, so you can't (or shouldn't) install stuff in the normal way as it may get overwritten by updates.
I have a bunch of docker compose YAML files. I want to run these locally. But I also don't want to tweak anything in the files to get them running because they should be able to be copied to a prod environment as is or the local test environment isn't a good test. Prod would be either my Linux Mint server or an Ubuntu Server one.
Bazzite has a ujust script available for installing docker, but this doesn't include docker compose, and I'm not sure how to add that in.
Searching online shows everyone saying just use podman, it comes pre-installed and is a drop in replacement. The problem is that it doesn't work.
Maybe that's my question, why isn't my compose.yaml working with podman?
For example, the container gives me a bunch of messages about missing environment variables, but they are set in the compose.yaml.
I also get a bunch of permissions errors. E.g. here is the mariadb trying to access a directory and then trying to change the ownership:
[db] | find: ‘/var/lib/mysql/’: Permission denied
[db] | chown: changing ownership of '/var/lib/mysql/': Permission denied
Volumes are all bind mounts. After the container created the local directories, I set all the permissions to 777 as a test and took the containers down then up and it still complains about permissions.
I feel like there is something specific to podman or Bazzite I'm not understanding. Any help?
I'm also happy to take suggestions on other ways to use docker compose in Bazzite.
Thanks in advance!
Edit: I have solved this by adding a Z flag to my bind mounts (./localdir:/containerdir:Z) as per this answer.
when I moved my docker setup to a fedora coreos podman setup, the volume mounts required an additional option for a label to play nice with selinux. 'z' if the mount is shared between multiple containers and 'Z' if its just for one container.
the podman docs definitely go into more details.
ive also seen people talk on the discord about scripts that can take your yaml files and write container files to be used with podman-systemd that seemed pretty nice. i think there is also a podman-compose option out there, but I'm not super familiar with that.
Oh shit I think that's it! I've added that Z flag to each bind mount declaration in compose.yaml, and it seems to be running properly now. Thanks!
Any idea what the implications are of this transferring to an ubuntu based distro?
im not sure about ubuntu based distros. without selinux, you may not need the extra option on the volume mount.
Ok thanks, I'll have to be extra careful deploying any changes.