podman-desktop/website/docs/migrating-from-docker/using-the-docker_host-environment-variable.md
fox 428efc972e
docs: Correct windows instructions for migrating from docker (#4157)
* Update using-the-docker_host-environment-variable.md

Signed-off-by: fox <12120644+foxydevloper@users.noreply.github.com>

* Update using-the-docker_host-environment-variable.md

Signed-off-by: fox <12120644+foxydevloper@users.noreply.github.com>

* format and fix build

Signed-off-by: foxydevloper <12120644+foxydevloper@users.noreply.github.com>

* change socket to pipe

Signed-off-by: foxydevloper <12120644+foxydevloper@users.noreply.github.com>

---------

Signed-off-by: fox <12120644+foxydevloper@users.noreply.github.com>
Signed-off-by: foxydevloper <12120644+foxydevloper@users.noreply.github.com>
2023-10-02 09:32:38 -04:00

2.6 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 pipe
$ podman machine inspect --format '{{.ConnectionInfo.PodmanPipe.Path}}'
  1. Set the DOCKER_HOST environment variable to your Podman pipe location. You'll need to replace back slashes with forward slashes and add the npipe:// scheme to the path retrieved previously:
$ export DOCKER_HOST=npipe://<your_podman_pipe_location>

Note that setting the DOCKER_HOST environment variable isn't neccesary on windows since Podman also listens to the default docker_engine pipe.

  1. Identify the location of your Podman socket
$ podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}'
  1. 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>
  1. Identify the location of your Podman socket
$ podman info --format '{{.Host.RemoteSocket.Path}}'
  1. 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.