DEV Community

abbazs
abbazs

Posted on • Edited on

9 1 1

How to use PODMAN in place of docker in windows?

First enable windows subsystem for linux (WSL)

  1. Enable Windows Subsystem for Linux
    • dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  2. Enable Virtual Machine
    • dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  3. Install podman desktop from podman.io
  4. Install visual studio code (vscode) from https://code.visualstudio.com/
  5. Add extension dev containers to vscode Dev Containers - Visual Studio Marketplace
  6. Update the vscode extension dev containers settings to point to podman instead of docker

    1. Press F1
    2. Enter Dev Containers: Settings in the prompt
    3. And set the value of dev.containers.dockerPath to podman

    docker path

  7. Close vscode and open it again

  8. To verify if all the settings are done correctly:

    1. Open a powershell terminal and execute podman pull python:3.11.4
    2. Execute podman run -it python:3.11.4 python
    3. Do not close the terminal and let it run

Connect to the running container from vscode

  1. Open vscode and look for the >< in the bottom left hand side corner and click on it

    vscode remote

  2. It shall open a dialog on the top of the window and select Attach to Running Container…

    prompt to connect

  3. Wait for vscode to show the running containers

    running containers

  4. Select the container required and you are all set to work inside the container.

  5. vscode will open a new window and connect to the container selected.

  6. Once the new vscode window opened select a folder inside the continaer

    Image description

  7. You are now connected to the container from vscode!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (2)

Collapse
 
specimen4701 profile image
Paula Pereyra • Edited

Thank you very much, very well explained, it helped me today 08/25/2024. I write the date because it was very difficult for me to find a tutorial that would work for the new versions of podman (version 5.2.2)
In my case it did work because the folder I wanted to access did contain code.

Collapse
 
soerennielsen profile image
soerennielsen

Any idea how to get it to work with Visual Studio? The one that is not code ;)
Building in VS fails to add the container to the podman local images.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay