Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add further details about podman #29651

Merged
merged 1 commit into from
Dec 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 14 additions & 22 deletions docs/src/main/asciidoc/podman.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,8 @@ This action only needs to be done once.
=== Linux

The Podman package is available in several Linux distributions.
Podman can be used the same way as Docker with the `podman-docker` package.
To install it for your OS, please refer to the https://podman.io/getting-started/installation[Podman installation guide].
Below is the short installation instruction for popular Linux distributions:

==== Fedora

[source,bash]
----
sudo dnf install podman podman-docker docker-compose
----

==== Ubuntu (21.04 and later)

[source,bash]
----
sudo apt install podman podman-docker docker-compose
----
Podman can in most cases be used as an drop-in-replacement for Docker, either with the `podman-docker` package, or using an alias (`alias docker=podman`).
To install it for your Linux OS, please refer to the https://podman.io/getting-started/installation#installing-on-linux[Podman installation guide].

=== Setting DOCKER_HOST on Linux

Expand All @@ -96,17 +81,24 @@ On Linux, the REST API Unix socket is, by default, restricted to only allow the
This prevents someone from using a container to achieve a privilege escalation on the system.
While these restrictions can be softened to allow a special group instead of just root, the recommended approach is to use rootless Podman on Linux.
To use rootless Podman, you need to set a `DOCKER_HOST` environment variable to point to the user-specific socket.
In both cases, you need to start the REST API by enabling the Podman socket service through systemd.

[source]
NOTE: In both cases, you need to start the REST API by enabling the Podman socket service through systemd, or at least by making sure Podman is running as a service.

[source,bash]
----
# Enable the podman socket with Docker REST API (only needs to be done once)
# Example 1: Enable the podman socket with Docker REST API with systemd (only needs to be done once)
systemctl --user enable podman.socket --now
----

[source,bash]
----
# Example 2: Enable the podman socket with Docker REST API on a system where systemd is not running (WSL etc)
podman system service --time=0
----

Then, you can obtain the path of the socket with the following command:

[source]
[source,bash]
----
$ podman info | grep -A2 'remoteSocket'

Expand All @@ -117,7 +109,7 @@ remoteSocket:

Setting the `DOCKER_HOST` environment variable must be done every time or added to the profile:

[source]
[source,bash]
----
export DOCKER_HOST=unix:///path/to/podman.sock <1>
----
Expand Down