podman-desktop/website/docs/migrating-from-docker/emulating-docker-cli-with-podman.md
2023-05-03 13:57:27 +00:00

1.4 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.
podman desktop
podman
containers
migrating-from-docker

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

Procedure

  1. Create a /usr/local/bin/docker script:

    #!/usr/bin/sh
    [ -e /etc/containers/nodocker ] || \
    echo "Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg." >&2
    exec podman "$@"
    
  2. (Optional) Create an empty /etc/containers/nodocker file to avoid the Emulate Docker CLI using podman. message when running the script.

    # touch /etc/containers/nodocker
    
  3. Make the script executable:

    # chmod +x /usr/local/bin/docker
    

Verification

  • Use the docker script to run commands. Example:

    $ docker run -it docker.io/hello-world