Using podman with the Docker extension for Visual Studio Code
The Docker extension for Visual Studio Code is one of those tools you should have in your tool belt when working with containers and Visual Studio Code.
During the last month I’ve been working full-time with Fedora Linux and as usual after the OS installation finished I started to load the disk with lots of tools that I use on a daily basis. At some point I needed to containerize an app I was working on, then it came to my attention that I needed Docker. After digging a little bit here and there I found that Fedora already has a pretty good tool for managing containers; that’s how I started to learn about Podman.
Podman is deamonless container engine which is OCI compliant; that means, you get the same set of commands you’re familiar to use in Docker plus no service/deamon is running on the background, so managing your containers with this tool feels just like Docker but has less overhead. Using Podman has also other benefits, just follow the link to learn more if you’re interested.
The missing part of the puzzle
So, great! I don’t need to install Docker however, the Docker extension for Visual Studio Code expects Docker to be installed on your OS. Fortunately enough we can trick the extension to use Podman instead of Docker. All you have to do is first, enable and activate the podman.socket
systemctl --user enable --now podman.socket
second, add the following configuration in the extension settings:
The number 1000 corresponds to your
uid (user id) which can be obtained executing
id -u from the terminal.