Skip to main content

Using the DOCKER_HOST environment variable

Consider using the DOCKER_HOST environment variable to migrate transparently from Docker to Podman Desktop on all platforms.

  • Continue using familiar Docker commands.
  • Take advantage of the benefits of Podman.
  • Your tools, such as Gradle or Testcontainers, communicate with Podman without reconfiguration.

Prerequisites

  • Podman

Procedure

  1. Identify the location of your Podman socket

    $ podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}'
  2. Set the DOCKER_HOST environment variable to your Podman socket location. Be sure to add the unix:// scheme to the path retrieved previously:

    $ export DOCKER_HOST=unix://<your_podman_socket_location>

Verification

  • Your tools using the DOCKER_HOST environment variable, such as Gradle or Testcontainers, communicate with Podman without reconfiguration.