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
# Remote Development on Docker Containers (Build from Dockerfile)
10
10
11
+
> [!NOTE]
12
+
> This template is designed to be a starting point for testing purposes.
13
+
> In a production environment, you would want to move away from storing the Dockerfile in-template and move towards using a centralized image registry.
14
+
11
15
Build and provision Docker containers from a Dockerfile as [Coder workspaces](https://coder.com/docs/workspaces) with this example template.
12
16
13
17
This template builds a custom Docker image from the included Dockerfile, allowing you to customize the development environment by modifying the Dockerfile rather than using a pre-built image.
@@ -18,7 +22,22 @@ This template builds a custom Docker image from the included Dockerfile, allowin
18
22
19
23
### Infrastructure
20
24
21
-
The VM you run Coder on must have a running Docker socket and the `coder` user must be added to the Docker group:
25
+
#### Running Coder inside Docker
26
+
27
+
If you installed Coder as a container within Docker, you will have to do the following things:
28
+
29
+
- Make the the Docker socket available to the container
30
+
-**(recommended) Mount `/var/run/docker.sock` via `--mount`/`volume`**
31
+
-_(advanced) Restrict the Docker socket via https://github.com/Tecnativa/docker-socket-proxy_
32
+
- Set `--group-add`/`group_add` to the GID of the Docker group on the **host** machine
33
+
- You can get the GID by running `getent group docker` on the **host** machine
34
+
35
+
If you are using `docker-compose`, here is an example on how to do those things (don't forget to edit `group_add`!):
If you installed Coder as a system package, the VM you run Coder on must have a running Docker socket and the `coder` user must be added to the Docker group:
If you installed Coder as a system package, the VM you run Coder on must have a running Docker socket and the `coder` user must be added to the Docker group:
If you installed Coder as a system package, the VM you run Coder on must have a running Docker socket and the `coder` user must be added to the Docker group:
0 commit comments