RubyMine 2023.1 Help

Podman

Podman is a daemonless container manager that can run containers as root or in rootless mode. Podman commands are fully compatible with Docker, so you can replace one with the other: alias docker=podman.

The core Podman runtime environment can only run on Linux operating systems. However, you can use a remote client for other operating systems to manage containers on the machine running Podman. This topic describes how RubyMine can act as a remote client for Podman.

Enable the Docker plugin

This functionality relies on the Docker plugin, which is bundled and enabled in RubyMine by default. If the relevant features aren't available, make sure that you didn't disable the plugin.

  1. Press Control+Alt+S to open the IDE settings and select Plugins.

  2. Open the Installed tab, find the Docker plugin, and select the checkbox next to the plugin name.

You can create a listening service for Podman API calls. Because the Podman API is identical to the Docker Engine API, you can connect RubyMine to the Podman service via TCP like you would connect to a Docker Engine API:

  1. Press Control+Alt+S to open the IDE settings and select Build, Execution, Deployment | Docker.

  2. Click The Add button to add a Docker configuration.

  3. Select TCP socket and specify the Podman API service URL in Engine API URL.

For more information, see Docker connection settings.

Tutorial: Run Podman in a virtual machine

If you are using Windows or macOS, you will need a separate Linux machine to run Podman. One of the easier ways to achieve this is to run a Vagrant box with a Linux virtual machine. This tutorial describes how to run Podman on a Vagrant box with Linux, start the Podman API service on it with proper forwarding, and connect to the API from RubyMine.

Here is what you will need:

Create and run a Vagrant box with Podman

  1. Create a Vagrantfile with the following code:

    Vagrant.configure("2") do |config| config.vm.box = "fedora/32-cloud-base" config.vm.provider "virtualbox" do |vb| vb.memory = "1024" end config.vm.provision "shell", inline: "yum install -y podman" config.vm.network "forwarded_port", guest: 2979, host: 12979, auto_correct: true end

    This Vagrantfile provisions a virtual machine with Fedora and runs it in VirtualBox (Vagrant will download the Fedora box if it is not available). It also installs Podman on the machine and forwards host port 12979 to guest port 2979 on the box. We will use port 12979 to connect to the Podman API from RubyMine on the host machine.

  2. Run the Vagrant box from the directory where you created the Vagrantfile:

    vagrant up

Start the Podman API service

  1. After the Vagrant box with Fedora starts up, SSH into it:

    vagrant ssh
  2. Run the following command inside the virtual machine:

    podman system service --time=0 tcp:0.0.0.0:2979

    This command will create a listening service that will answer Podman API calls on port number 2979 inside the Vagrant box. This is where port number 12979 is forwarded from the host machine. The session will not expire unless you terminate it manually. If you want to open the service for a limited period of time, change the value of --time to specify the timeout in seconds.

Connect to Podman from RubyMine

  1. Press Control+Alt+S to open the IDE settings and select Build, Execution, Deployment | Docker.

  2. Click The Add button to add a Docker configuration.

  3. Select TCP socket and specify the Podman API service URL in Engine API URL: tcp://localhost:12979.

    Docker connection for Podman API service

    If everything is correct, you should see Connection successful at the bottom of the page.

  4. Double-click the configured Podman connection in the Services tool window (View | Tool Windows | Services or Alt+8).

RubyMine will make calls to this URL as if to the Docker Engine API, Vagrant will forward them to port 2979 inside the virtual machine with Podman, and the Podman API service will answer these calls.

Last modified: 12 April 2023