I am moving all of my tooling over from Docker to podman and buildah. One thing I want to reproduce it the mariadb setup I used.
First, check the networks status:
sudo - podman network ls NAME VERSION PLUGINS podman 0.4.0 bridge,portmap,firewall |
Now create the network and check it:
/etc/cni/net.d/maria-bridge.conflist [root@ayoungP40 ~]# podman network ls NAME VERSION PLUGINS podman 0.4.0 bridge,portmap,firewall maria-bridge 0.4.0 bridge,portmap,firewall |
Deploy the Database:
$ export MYSQL_ROOT_PASSWORD=my-secret-pw $ PODID= $( podman run --network=maria-bridge --name some-mariadb -e MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD -d mariadb:latest ) |
Find out the IP address of the container we just created:
POD_IP=$( podman inspect $PODID | jq -r '.[] | .NetworkSettings | .IPAddress' ) |
Connect to it from the client. Note that I was not able to pass the IP address through as a variable. More on that in a bit.
podman run -it --network maria-bridge -e MYSQL_ROOT_PASSWORD="my-secret-pw" --rm mariadb sh -c 'exec mysql -h10.89.0.4 -P3306 -uroot -p"$MYSQL_ROOT_PASSWORD"' Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 8 Server version: 10.4.10-MariaDB-1:10.4.10+maria~bionic mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.001 sec) |