Moving from Docker to Podman for local development

published on | edited on

Previously, I wrote a short article of how I work without docker-compose. It is somewhat crucial software for my workload, but at the same time, I realized that I could achieve the basic functionality with little less code in my environment.

The old article only used PostgreSQL container in the system, and therefore, it was boring. Now, I have been using more and more Jupyter notebooks, I wanted to share this snippet with you all. This code does bare minimum of docker-compose or podman-compose, but it is fairly simple to run and work with.


Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "debian/testing64" :private_network, ip: ""

  config.vm.provider :libvirt do |guest|
    guest.memory = 2048

  config.vm.provision :shell, inline: <<-SHELL
    apt-get update
    apt-get install -y podman zstd

    podman network create potato_network

  config.vm.provision :podman do |container| "postgres", image: "", args: %w[
      --env POSTGRES_USER=potato
      --env POSTGRES_PASSWORD=potato
      --env POSTGRES_DB=potato_development
      --network potato_network
    ].join(" ") "jupyter", image: "", args: %w[
      --volume "/vagrant:/home/jovyan/work"
      --publish 10000:8888
      --network potato_network
    ].join(" ")

I would like to add a warning in here because this script will not run second time you provision. Mainly, that is because of network adapter creation with Podman. You can write additional if statement with podman network exist, but I found it just running vagrant provision --with-provider podman is a lot easier to work with for my workload.

I also have a private IP address for this virtual machine that is managed with libvirt on Debian host.