File tree Expand file tree Collapse file tree 3 files changed +41
-8
lines changed
coder-labs/templates/docker-build Expand file tree Collapse file tree 3 files changed +41
-8
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,19 @@ This template builds a custom Docker image from the included Dockerfile, allowin
22
22
23
23
### Infrastructure
24
24
25
- The VM you run Coder on must have a running Docker socket and the ` coder ` user must be added to the Docker group:
26
-
25
+ #### Running Coder inside Docker
26
+ If you installed Coder as a container within Docker, you will have to do the following things:
27
+ - Make the the Docker socket available to the container
28
+ - ** (recommended) Mount ` /var/run/docker.sock ` via ` --mount ` /` volume ` **
29
+ - _ (advanced) Restrict the Docker socket via https://github.com/Tecnativa/docker-socket-proxy _
30
+ - Set ` --group-add ` /` group_add ` to the GID of the Docker group on the ** host** machine
31
+ - You can get the GID by running ` getent group docker ` on the ** host** machine
32
+
33
+ If you are using ` docker-compose ` , here is an example on how to do those things (don't forget to edit ` group_add ` !):
34
+ https://github.com/coder/coder/blob/0bfe0d63aec83ae438bdcb77e306effd100dba3d/docker-compose.yaml#L16-L23
35
+
36
+ #### Running Coder outside of Docker
37
+ 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:
27
38
``` sh
28
39
# Add coder user to Docker group
29
40
sudo adduser coder docker
Original file line number Diff line number Diff line change @@ -14,11 +14,22 @@ Provision Devcontainers as [Coder workspaces](https://coder.com/docs/workspaces)
14
14
15
15
### Infrastructure
16
16
17
- Coder must have access to a running Docker socket, and the ` coder ` user must be a member of the ` docker ` group:
18
-
19
- ``` shell
17
+ #### Running Coder inside Docker
18
+ If you installed Coder as a container within Docker, you will have to do the following things:
19
+ - Make the the Docker socket available to the container
20
+ - ** (recommended) Mount ` /var/run/docker.sock ` via ` --mount ` /` volume ` **
21
+ - _ (advanced) Restrict the Docker socket via https://github.com/Tecnativa/docker-socket-proxy _
22
+ - Set ` --group-add ` /` group_add ` to the GID of the Docker group on the ** host** machine
23
+ - You can get the GID by running ` getent group docker ` on the ** host** machine
24
+
25
+ If you are using ` docker-compose ` , here is an example on how to do those things (don't forget to edit ` group_add ` !):
26
+ https://github.com/coder/coder/blob/0bfe0d63aec83ae438bdcb77e306effd100dba3d/docker-compose.yaml#L16-L23
27
+
28
+ #### Running Coder outside of Docker
29
+ 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:
30
+ ``` sh
20
31
# Add coder user to Docker group
21
- sudo usermod -aG docker coder
32
+ sudo adduser coder docker
22
33
23
34
# Restart Coder server
24
35
sudo systemctl restart coder
Original file line number Diff line number Diff line change @@ -16,8 +16,19 @@ Provision Docker containers as [Coder workspaces](https://coder.com/docs/workspa
16
16
17
17
### Infrastructure
18
18
19
- The VM you run Coder on must have a running Docker socket and the ` coder ` user must be added to the Docker group:
20
-
19
+ #### Running Coder inside Docker
20
+ If you installed Coder as a container within Docker, you will have to do the following things:
21
+ - Make the the Docker socket available to the container
22
+ - ** (recommended) Mount ` /var/run/docker.sock ` via ` --mount ` /` volume ` **
23
+ - _ (advanced) Restrict the Docker socket via https://github.com/Tecnativa/docker-socket-proxy _
24
+ - Set ` --group-add ` /` group_add ` to the GID of the Docker group on the ** host** machine
25
+ - You can get the GID by running ` getent group docker ` on the ** host** machine
26
+
27
+ If you are using ` docker-compose ` , here is an example on how to do those things (don't forget to edit ` group_add ` !):
28
+ https://github.com/coder/coder/blob/0bfe0d63aec83ae438bdcb77e306effd100dba3d/docker-compose.yaml#L16-L23
29
+
30
+ #### Running Coder outside of Docker
31
+ 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:
21
32
``` sh
22
33
# Add coder user to Docker group
23
34
sudo adduser coder docker
You can’t perform that action at this time.
0 commit comments