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
2222
2323### Infrastructure
2424
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:
2738``` sh
2839# Add coder user to Docker group
2940sudo 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)
1414
1515### Infrastructure
1616
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
2031# Add coder user to Docker group
21- sudo usermod -aG docker coder
32+ sudo adduser coder docker
2233
2334# Restart Coder server
2435sudo 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
1616
1717### Infrastructure
1818
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:
2132``` sh
2233# Add coder user to Docker group
2334sudo adduser coder docker
You can’t perform that action at this time.
0 commit comments