Adding the –name mysql – it wasn’t enough to get the PHPIpam apache container to find the mysql container. They’re in the same pod, but something’s not quite right. So I decided to see if I could modify the config.php by mounting the container and modifying that.
# podman mount beautiful_gauss /var/lib/containers/storage/overlay/5a33decc2cfad7e9bda5f9048d94a814267d954e97d5dd7befb057a84367f27a/merged
While this allowed me to see the config files and open them in vi (not included in the container) I could not modify the contents. I think the key is passing “phpIPAM5” (or whatever the pod is called) into the MYSQL_ENV_MYSQL_HOST environment variable. So let’s try that. First, I had to stop phpIPAM5. I’ve been using
# podman pod rm phpIPAM4 -f
The force allows it to remove the pods. So I’m going to go back to just phpIPAM for the pod name without any number suffixes. I continue to note that, for some reason, Podman tends to cause huge spikes in CPU usage when doing stuff around pods, particularly creation and destruction. Once the pod’s running, I don’t see any huge CPU issues. But starting and stopping definitely takes a lot longer than Docker containers do.
# podman pod create --name phpIPAM -p 8081:80 # podman run -dt --pod phpIPAM -e MYSQL_ENV_MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_ENV_MYSQL_HOST=phpIPAM pierrecdn/phpipam # podman run -dt --pod phpIPAM -e MYSQL_ROOT_PASSWORD=my-secret-pw -v /root/phpipam-podman:/var/lib/mysql -d mysql:5.6
Unfortunately, that seems to lead to a pod that won’t answer on 8081. Going back to my previous pod wouldn’t load either. But the WEIRD thing is that even though I had SELinux turned off, I kept getting logs like this:
SELinux is preventing mysqld from unlink access on the file phpIPAM5.lower-test.
And that’s incredibly weird. Also, for some reason the user of my phpipam-podman folder had become systemd-coredump instead of root. ALSO VERY WEIRD. In dmesg I see something that may explain the problem….
overlayfs: lowerdir is in-use as upperdir/workdir of another mount, accessing files from both mounts will result in undefined behavior.
So maybe I need to set things up to use a different directory. So I set up another directory.
# mkdir phpipam-podman6
And let’s try again! So…new directory AND environment variable. MAYBE we’ll get something that works…
# podman pod create --name phpIPAM6 -p 8081:80 # podman run -dt --pod phpIPAM6 -e MYSQL_ENV_MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_ENV_MYSQL_HOST=phpIPAM6 pierrecdn/phpipam # podman run -dt --pod phpIPAM6 -e MYSQL_ROOT_PASSWORD=my-secret-pw -v /root/phpipam-podman6:/var/lib/mysql -d mysql:5.6
Nope. I think this is more frustrating for the fact that it worked once, even if the lack of environment variables kept the install from working than if it had never worked at all. Ugh. I give up. Maybe podman is not the Docker replacement it’s supposed to be?