You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Added documentation for DOCKER_HOST requirement when using Docker SDKs
with Docker Desktop for Linux.
## Changes
- Added "Using Docker SDKs with Docker Desktop" section to Linux install
docs explaining why SDKs need DOCKER_HOST set and providing
configuration commands
- Added FAQ entry "How do I use Docker SDKs with Docker Desktop for
Linux?" with troubleshooting steps
- Added note in SDK reference docs alerting Docker Desktop for Linux
users to set DOCKER_HOST before using SDKs
Fixes#23308
---
🤖 Generated with [cagent](https://github.com/docker/cagent)
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: aevesdocker <allie.sadler@docker.com>
Copy file name to clipboardExpand all lines: content/manuals/desktop/setup/install/linux/_index.md
+30-28Lines changed: 30 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,18 @@
1
1
---
2
-
description: Install Docker on Linux with ease using our step-by-step installation
2
+
description:
3
+
Install Docker on Linux with ease using our step-by-step installation
3
4
guide covering system requirements, supported platforms, and where to go next.
4
-
keywords: linux, docker linux install, docker linux, linux docker installation, docker
5
+
keywords:
6
+
linux, docker linux install, docker linux, linux docker installation, docker
5
7
for linux, docker desktop for linux, installing docker on linux, docker download
6
8
linux, how to install docker on linux, linux vs docker engine, switch docker contexts
7
9
title: Install Docker Desktop on Linux
8
10
linkTitle: Linux
9
11
weight: 60
10
12
aliases:
11
-
- /desktop/linux/install/
12
-
- /desktop/install/linux-install/
13
-
- /desktop/install/linux/
13
+
- /desktop/linux/install/
14
+
- /desktop/install/linux-install/
15
+
- /desktop/install/linux/
14
16
---
15
17
16
18
> **Docker Desktop terms**
@@ -23,9 +25,9 @@ This page contains information about general system requirements, supported plat
23
25
24
26
> [!IMPORTANT]
25
27
>
26
-
>Docker Desktop on Linux runs a Virtual Machine (VM) which creates and uses a custom docker context, `desktop-linux`, on startup.
28
+
>Docker Desktop on Linux runs a Virtual Machine (VM) which creates and uses a custom docker context, `desktop-linux`, on startup.
27
29
>
28
-
>This means images and containers deployed on the Linux Docker Engine (before installation) are not available in Docker Desktop for Linux.
30
+
>This means images and containers deployed on the Linux Docker Engine (before installation) are not available in Docker Desktop for Linux.
29
31
>
30
32
> {{< accordion title=" Docker Desktop vs Docker Engine: What's the difference?" >}}
31
33
@@ -35,7 +37,7 @@ This page contains information about general system requirements, supported plat
35
37
36
38
Docker Desktop for Linux provides a user-friendly graphical interface that simplifies the management of containers and services. It includes Docker Engine as this is the core technology that powers Docker containers. Docker Desktop for Linux also comes with additional features like Docker Scout and Docker Extensions.
37
39
38
-
####Installing Docker Desktop and Docker Engine
40
+
### Installing Docker Desktop and Docker Engine
39
41
40
42
Docker Desktop for Linux and Docker Engine can be installed side-by-side on the
41
43
same machine. Docker Desktop for Linux stores containers and images in an isolated
@@ -88,7 +90,7 @@ machine. The current context is indicated with an asterisk (`*`).
88
90
$ docker context ls
89
91
NAME DESCRIPTION DOCKER ENDPOINT ...
90
92
default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock ...
Sign out and sign back in so that your group membership is re-evaluated.
203
203
204
-
## Where to go next
204
+
## Using Docker SDKs with Docker Desktop
205
205
206
-
- Install Docker Desktop for Linux for your specific Linux distribution:
207
-
-[Install on Ubuntu](ubuntu.md)
208
-
-[Install on Debian](debian.md)
209
-
-[Install on Red Hat Enterprise Linux (RHEL)](rhel.md)
210
-
-[Install on Fedora](fedora.md)
211
-
-[Install on Arch](archlinux.md)
206
+
Docker Desktop for Linux uses a per-user socket instead of the system-wide `/var/run/docker.sock`. Docker SDKs and tools that connect directly to the Docker daemon need the `DOCKER_HOST` environment variable set to connect to Docker Desktop. For configuration details, see [How do I use Docker SDKs with Docker Desktop for Linux?](/manuals/desktop/troubleshoot-and-support/faqs/linuxfaqs.md#how-do-i-use-docker-sdks-with-docker-desktop-for-linux).
212
207
208
+
## Where to go next
213
209
210
+
- Install Docker Desktop for Linux for your specific Linux distribution:
211
+
-[Install on Ubuntu](ubuntu.md)
212
+
-[Install on Debian](debian.md)
213
+
-[Install on Red Hat Enterprise Linux (RHEL)](rhel.md)
Copy file name to clipboardExpand all lines: content/manuals/desktop/troubleshoot-and-support/faqs/linuxfaqs.md
+42-14Lines changed: 42 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@ title: FAQs for Docker Desktop for Linux
5
5
linkTitle: Linux
6
6
tags: [FAQ]
7
7
aliases:
8
-
- /desktop/linux/space/
9
-
- /desktop/faqs/linuxfaqs/
8
+
- /desktop/linux/space/
9
+
- /desktop/faqs/linuxfaqs/
10
10
weight: 40
11
11
---
12
12
@@ -16,32 +16,32 @@ Docker Desktop for Linux runs a Virtual Machine (VM) for the following reasons:
16
16
17
17
1. To ensure that Docker Desktop provides a consistent experience across platforms.
18
18
19
-
During research, the most frequently cited reason for users wanting Docker Desktop for Linux was to ensure a consistent Docker Desktop
20
-
experience with feature parity across all major operating systems. Utilizing
21
-
a VM ensures that the Docker Desktop experience for Linux users will closely
22
-
match that of Windows and macOS.
19
+
During research, the most frequently cited reason for users wanting Docker Desktop for Linux was to ensure a consistent Docker Desktop
20
+
experience with feature parity across all major operating systems. Utilizing
21
+
a VM ensures that the Docker Desktop experience for Linux users will closely
22
+
match that of Windows and macOS.
23
23
24
24
2. To make use of new kernel features.
25
25
26
-
Sometimes we want to make use of new operating system features. Because we control the kernel and the OS inside the VM, we can roll these out to all users immediately, even to users who are intentionally sticking on an LTS version of their machine OS.
26
+
Because Docker controls the kernel and the OS inside the VM, Docker can roll these out to all users immediately, even to users who are intentionally sticking on an LTS version of their machine OS.
27
27
28
28
3. To enhance security.
29
29
30
-
Container image vulnerabilities pose a security risk for the host environment. There is a large number of unofficial images that are not guaranteed to be verified for known vulnerabilities. Malicious users can push images to public registries and use different methods to trick users into pulling and running them. The VM approach mitigates this threat as any malware that gains root privileges is restricted to the VM environment without access to the host.
30
+
Container image vulnerabilities pose a security risk for the host environment. There is a large number of unofficial images that are not guaranteed to be verified for known vulnerabilities. Malicious users can push images to public registries and use different methods to trick users into pulling and running them. The VM approach mitigates this threat as any malware that gains root privileges is restricted to the VM environment without access to the host.
31
31
32
-
Why not run rootless Docker? Although this has the benefit of superficially limiting access to the root user so everything looks safer in "top", it allows unprivileged users to gain `CAP_SYS_ADMIN` in their own user namespace and access kernel APIs which are not expecting to be used by unprivileged users, resulting in [vulnerabilities](https://www.openwall.com/lists/oss-security/2022/01/18/7).
32
+
Why not run rootless Docker? Although this has the benefit of superficially limiting access to the root user so everything looks safer in "top", it allows unprivileged users to gain `CAP_SYS_ADMIN` in their own user namespace and access kernel APIs which are not expecting to be used by unprivileged users, resulting in [vulnerabilities](https://www.openwall.com/lists/oss-security/2022/01/18/7).
33
33
34
34
4. To provide the benefits of feature parity and enhanced security, with minimal impact on performance.
35
35
36
-
The VM utilized by Docker Desktop for Linux uses [`VirtioFS`](https://virtio-fs.gitlab.io), a shared file system that allows virtual machines to access a directory tree located on the host. Our internal benchmarking shows that with the right resource allocation to the VM, near native file system performance can be achieved with VirtioFS.
36
+
The VM utilized by Docker Desktop for Linux uses [`VirtioFS`](https://virtio-fs.gitlab.io), a shared file system that allows virtual machines to access a directory tree located on the host. Docker's internal benchmarking shows that with the right resource allocation to the VM, near native file system performance can be achieved with VirtioFS.
37
37
38
-
As such, we have adjusted the default memory available to the VM in Docker Desktop for Linux. You can tweak this setting to your specific needs by using the **Memory** slider within the **Settings** > **Resources** tab of Docker Desktop.
38
+
As such, the default memory available to the VM in Docker Desktop for Linux is adjusted. You can tweak this setting to your specific needs by using the **Memory** slider within the **Settings** > **Resources** tab of Docker Desktop.
39
39
40
40
### How do I enable file sharing?
41
41
42
42
Docker Desktop for Linux uses [VirtioFS](https://virtio-fs.gitlab.io/) as the
43
43
default (and currently only) mechanism to enable file sharing between the host
44
-
and Docker Desktop VM.
44
+
and Docker Desktop VM.
45
45
46
46
{{< accordion title="Additional information for Docker Desktop version 4.34 and earlier" >}}
47
47
@@ -59,7 +59,7 @@ mappings for IDs greater than 0 in the containers.
| 0 (root) | ID of the user running Docker Desktop (e.g. 1000) |
62
+
| 0 (root) | ID of the user running Docker Desktop (e.g. 1000) |
63
63
| 1 | 0 + beginning of ID range specified in `/etc/subuid`/`/etc/subgid` (e.g. 100000) |
64
64
| 2 | 1 + beginning of ID range specified in `/etc/subuid`/`/etc/subgid` (e.g. 100001) |
65
65
| 3 | 2 + beginning of ID range specified in `/etc/subuid`/`/etc/subgid` (e.g. 100002) |
@@ -95,6 +95,34 @@ ACL (see `setfacl(1)`) for folders shared with the Docker Desktop VM.
95
95
96
96
{{< /accordion >}}
97
97
98
+
### How do I use Docker SDKs with Docker Desktop for Linux?
99
+
100
+
Docker Desktop for Linux uses a per-user socket located at `~/.docker/desktop/docker.sock` instead of the system-wide `/var/run/docker.sock`. The Docker CLI handles this automatically through the `desktop-linux` context, but Docker SDKs and other tools that connect directly to the Docker daemon also need the `DOCKER_HOST` environment variable set.
101
+
102
+
Without setting `DOCKER_HOST`, SDKs attempt to connect to `/var/run/docker.sock` and fail with an error like:
103
+
104
+
```text
105
+
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
106
+
```
107
+
108
+
To fix this, set the `DOCKER_HOST` environment variable before running your SDK-based application:
### Where does Docker Desktop store Linux containers?
99
127
100
128
Docker Desktop stores Linux containers and images in a single, large "disk image" file in the Linux filesystem. This is different from Docker on Linux, which usually stores containers and images in the `/var/lib/docker` directory on the host's filesystem.
@@ -117,7 +145,7 @@ If the disk image file is too large, you can:
117
145
118
146
To move the disk image file to a different location:
119
147
120
-
1. Select **Settings** then **Advanced** from the **Resources** tab.
148
+
1. Select **Settings** then **Advanced** from the **Resources** tab.
121
149
122
150
2. In the **Disk image location** section, select **Browse** and choose a new location for the disk image.
Copy file name to clipboardExpand all lines: content/reference/api/engine/sdk/_index.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,17 @@ For more information, see [Go client reference](https://pkg.go.dev/github.com/mo
44
44
45
45
For more information, see [Docker Engine Python SDK reference](https://docker-py.readthedocs.io/).
46
46
47
+
> [!NOTE]
48
+
> Docker Desktop for Linux users
49
+
>
50
+
> Docker Desktop for Linux uses a per-user socket instead of the system-wide `/var/run/docker.sock`. To use Docker SDKs with Docker Desktop for Linux, set the `DOCKER_HOST` environment variable:
> For more details, see [the Linux FAQs](/manuals/desktop/troubleshoot-and-support/faqs/linuxfaqs.md#how-do-i-use-docker-sdks-with-docker-desktop-for-linux).
0 commit comments