podman-desktop/website/docs/migrating-from-docker/using-the-docker_host-environment-variable.md
2023-05-03 10:28:43 +00:00

1.9 KiB

sidebar_position title description keywords tags
2 Using the `DOCKER_HOST` environment variable Using the `DOCKER_HOST` environment variable can make it easier to migrate from Docker to Podman Desktop, as it allows you to continue using familiar Docker commands while taking advantage of the benefits of Podman.
podman desktop
podman
containers
docker_host
environment
variable
migrating-from-docker

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

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}}'
    
    $ podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}'
    
    $ podman info --format '{{.Host.RemoteSocket.Path}}'
    
  2. Set the DOCKER_HOST environment variable to your Podman socket location:

    $ export DOCKER_HOST=<your_podman_socket_location>
    

Verification

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