Skip to content

Commit f268fd7

Browse files
committed
docs: split docker instructions to linux and macos
1 parent 9cfdbec commit f268fd7

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

docs/install/docker.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Docker is required. See the [official installation documentation](https://docs.d
99
For proof-of-concept deployments, you can run a complete Coder instance with
1010
the following command:
1111

12+
**Linux:**
13+
1214
```sh
1315
export CODER_DATA=$HOME/.config/coderv2-docker
1416
export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
@@ -20,6 +22,17 @@ docker run --rm -it \
2022
ghcr.io/coder/coder:latest
2123
```
2224

25+
**macOS:**
26+
27+
```sh
28+
export CODER_DATA=$HOME/.config/coderv2-docker
29+
mkdir -p $CODER_DATA
30+
docker run --rm -it \
31+
-v $CODER_DATA:/home/coder/.config \
32+
-v /var/run/docker.sock:/var/run/docker.sock \
33+
ghcr.io/coder/coder:latest
34+
```
35+
2336
**<sup>Note:</sup>** <sup>Coder runs as a non-root user, we use `--group-add` to
2437
ensure Coder has permissions to manage Docker via `docker.sock`. If the host
2538
systems `/var/run/docker.sock` is not group writeable or does not belong to the
@@ -34,6 +47,20 @@ For production deployments, we recommend using an external PostgreSQL database
3447
(version 13 or higher). Set `ACCESS_URL` to the external URL that users and
3548
workspaces will use to connect to Coder.
3649

50+
**Linux:**
51+
52+
```sh
53+
export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
54+
docker run --rm -it \
55+
-e CODER_ACCESS_URL="https://coder.example.com" \
56+
-e CODER_PG_CONNECTION_URL="postgresql://username:password@database/coder" \
57+
-v /var/run/docker.sock:/var/run/docker.sock \
58+
--group-add $DOCKER_GROUP \
59+
ghcr.io/coder/coder:latest
60+
```
61+
62+
**macOS:**
63+
3764
```sh
3865
docker run --rm -it \
3966
-e CODER_ACCESS_URL="https://coder.example.com" \

docs/quickstart/docker.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,28 @@ Coder with Docker has the following advantages:
1515

1616
1. Run Coder with Docker.
1717

18-
```shell
18+
**Linux:**
19+
20+
```sh
1921
export CODER_DATA=$HOME/.config/coderv2-docker
2022
export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
2123
mkdir -p $CODER_DATA
2224
docker run --rm -it \
23-
-v $CODER_DATA:/home/coder/.config \
24-
-v /var/run/docker.sock:/var/run/docker.sock \
25-
--group-add $DOCKER_GROUP \
26-
ghcr.io/coder/coder:latest
25+
-v $CODER_DATA:/home/coder/.config \
26+
-v /var/run/docker.sock:/var/run/docker.sock \
27+
--group-add $DOCKER_GROUP \
28+
ghcr.io/coder/coder:latest
29+
```
30+
31+
**macOS:**
32+
33+
```sh
34+
export CODER_DATA=$HOME/.config/coderv2-docker
35+
mkdir -p $CODER_DATA
36+
docker run --rm -it \
37+
-v $CODER_DATA:/home/coder/.config \
38+
-v /var/run/docker.sock:/var/run/docker.sock \
39+
ghcr.io/coder/coder:latest
2740
```
2841

2942
> This will use Coder's tunnel and built-in database. See our [Docker documentation](../install/docker.md) for other configuration options such as running on localhost, using docker-compose, and external PostgreSQL.

0 commit comments

Comments
 (0)