mirror of
https://github.com/podman-desktop/podman-desktop
synced 2026-04-21 17:47:22 +00:00
Also, fix Testcontainers' website. Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
2 KiB
2 KiB
| sidebar_position | title | description | keywords | tags | ||||
|---|---|---|---|---|---|---|---|---|
| 4 | Emulating Docker CLI with Podman | Emulation Docker CLI with Podman can make it easier to migrate from Docker to Podman, as it allows you to continue using familiar Docker commands while taking advantage of the benefits of Podman. |
|
|
Emulating Docker CLI with Podman
Consider emulating Docker CLI with Podman to migrate transparently to Podman.
- Continue using familiar Docker commands.
- Take advantage of the benefits of Podman on macOS.
- Your tools, such as Maven or Testcontainers, communicate with Podman without reconfiguration.
Prerequisites
- Podman
Linux / macOS
Procedure
-
Create a
/usr/local/bin/dockerscript:#!/bin/sh [ -e /etc/containers/nodocker ] || \ echo "Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg." >&2 exec podman "$@" -
(Optional) Create an empty
/etc/containers/nodockerfile to avoid theEmulate Docker CLI using podman.message when running the script.# touch /etc/containers/nodocker -
Make the script executable:
# chmod +x /usr/local/bin/docker
Verification
-
Use the
dockerscript to run commands. Example:$ docker run -it docker.io/hello-world
Windows
Procedure
-
Create a
C:\Program Files\docker\bin\docker.batscript:@echo off echo Emulate Docker CLI using podman. <- remove this line to avoid the `Emulate Docker CLI using podman.` message when running the script. podman %* -
Add C:\Program Files\docker\bin to the SYSTEM/USER environment variable PATH
-
Close all cmd and powershell instances.
Verification
-
Use the
dockerscript to run commands. Example:$ docker run -it docker.io/hello-world