docs: Update Docker docs and docker-compose, mention group-add (#4237)

This commit is contained in:
Mathias Fredriksson
2022-09-28 16:33:36 +03:00
committed by GitHub
parent 59cc4a2586
commit 31aaa1ed59
2 changed files with 15 additions and 2 deletions
+9 -2
View File
@@ -11,14 +11,21 @@ the following command:
```sh
export CODER_DATA=$HOME/.config/coderv2-docker
export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
mkdir -p $CODER_DATA
docker run --rm -it \
-e CODER_TUNNEL=true \
-v $CODER_DATA:/home/coder/.config \
-v /var/run/docker.sock:/var/run/docker.sock \
--group-add $DOCKER_GROUP \
ghcr.io/coder/coder:latest
```
**<sup>Note:</sup>** <sup>Coder runs as a non-root user, we use `--group-add` to
ensure Coder has permissions to manage Docker via `docker.sock`. If the host
systems `/var/run/docker.sock` is not group writeable or does not belong to the
`docker` group, the above may not work as-is.</sup>
Coder configuration is defined via environment variables.
Learn more about Coder's [configuration options](../admin/configure.md).
@@ -55,7 +62,7 @@ an PostgreSQL container and volume.
3. Start Coder with `docker-compose up`:
In order to use cloud-based templates (e.g. Kubernetes, AWS), you must have an external URL that users and workspaces will use to connect to Coder.
For proof-of-concept deployments, you can use [Coder's tunnel](../admin/configure.md#tunnel):
```sh
@@ -74,7 +81,7 @@ an PostgreSQL container and volume.
> Without `CODER_ACCESS_URL` or `CODER_TUNNEL` set, Coder will bind to `localhost:7080`. This will only work for Docker-based templates.
4. Visit the web ui via the configured url. You can add `/login` to the base url to create the first user via the ui.
4. Visit the web ui via the configured url. You can add `/login` to the base url to create the first user via the ui.
5. Follow the on-screen instructions log in and create your first template and workspace