------------------------------------------------------------------------------- podman-compose (equivelent to older command "docker-compose") "podman-compose" is used run one or more containers, which is defined by a "docker-compose.yml" file in the currect directory. docker-compose file format https://docs.docker.com/compose/compose-file/compose-file-v3 Beginner's Guide to Using Podman Compose https://linuxhandbook.com/podman-compose/ The file defines a LOT of information, such as What volumes, secrets, networks; are to be attached And if it should restart on failure. You can also specify how to build the image to use image from a specific "Dockerfile", or directory with a "Dockerfile". Or even from a Dockerfile in-line in the compose file. Many examples are provided on DockerHub for each provided image. But a more comprehensive example with commented optiosn ais given below. ------------------------------------------------------------------------------- Example Commands... Create podman image from "Dockerfile"... In this case a modified "php:7.4-apache" image from Dockerhub podman build -t php7.4-apache ./ See the created images, podman images podman image ls Start container from "docker-compose.yml" file... sudo systemctl start podman-compose.service equivelent to... podman-compose up -d If a UserNS is also needed, a environment variable must be set... PODMAN_USERNS=$(grep -Po 'userns_mode: "\K[^"]+' docker-compose.yml) \ podman-compose up -d Stop container... sudo systemctl stop podman-compose.service Or manually... podman-compose down -v See the container process... podman-compose ps Note that the running container is named (see output of previous command)... {dir}_{service}_1 Check systemd status... sudo systemctl status -l podman-compose.service Check logs (all of them)... sudo journalctl -u podman-compose.service Check a specific container logs... podman logs {container} You launch a shell into that container to examine it... podman exec -u 0 -it {container} /bin/bash ------------------------------------------------------------------------------- Start/Stop specific container services... start just one specific container podman-compose up -d mysql Work on a specific service of this compose file podman-compose start mysql podman-compose stop mysql podman-compose restart mysql ------------------------------------------------------------------------------- Images podman-compose build # build the images podman-compose pull # pull/build the images needed ------------------------------------------------------------------------------- Example "docker-compose.yml" files For networking.... =======8<--------CUT HERE---------- web: ... # for a system process - expose all ports as needed network_mode: 'host' # to expose only specific ports to the system network_mode: 'slirp4netns:port_handler=slirp4netns' ports: - '8080:8080' =======8<--------CUT HERE---------- =======8<--------CUT HERE---------- --- # # Configuartion to Start 2 containers: a web srevice, and redis service # Most of these options are probably NOT needed for your containers # version: '3.1' services: web: image: 'localhost/php7.4-apache' # local image (to be built) #build: . # Dockerfile to build image (optional) #container_name: web # running container name (optional) restart: 'always' environment: TZ: 'Australia/Brisbane' volumes: - "./html:/var/www/html:z" # web-data - "fullchain.pem:/etc/ssl/certs/ssl-cert-snakeoil.pem" # certs - "privkey.pem:/etc/ssl/private/ssl-cert-snakeoil.key" ports: - 80:80 - 443:443 # These are for secure interfacing (services, passwords, etc) depends-on: - redis # redis server must be started before this networks: - net_redis # private network connection to redis secrets: - sso_auth_data # secret information to enable SSO single signon # deploy: # This is only used for swarm container deployments. # mode: replicated # replicas: 3 # # placement: # limit what servers it runs on # # constraints: [ node.role == manager ] redis: image: remote.registery./library/redis restart: 'always' networks: - net_redis # Create a private network between containers networks: # network allowing communications to redis net_redis: driver: overlay # Special 'secret' volumes, # data stored in podman (write-only) using podman secret ... # only readable within the container in a special location secrets: sso_auth_data: external: true ... =======8<--------CUT HERE---------- -------------------------------------------------------------------------------