Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: simplify docker installation docs#12187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
matifali merged 5 commits intomainfrommatifali/docker-install-docs
Feb 16, 2024
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 39 additions & 44 deletionsdocs/install/docker.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,11 @@ Docker is required. See the
> Note that the below steps are only supported on a Linux distribution. If on
> macOS, please [run Coder via the standalone binary](./index.md#manual).

## Run Coder with the built-in database (quick)
<div class="tabs">

## docker run

**Built-in database (quick)**

For proof-of-concept deployments, you can run a complete Coder instance with the
following command.
Expand All@@ -25,78 +29,69 @@ docker run --rm -it \
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).

<div class="tabs">

## docker run
**External database**

For production deployments, we recommend using an external PostgreSQL database
(version 13 or higher). Set `ACCESS_URL` to the external URL that users and
workspaces will use to connect to Coder.
(version 13 or higher). Set `CODER_ACCESS_URL` to the external URL that users
andworkspaces will use to connect to Coder.

```shell
export DOCKER_GROUP=$(getent group docker | cut -d: -f3)
docker run --rm -it \
-e CODER_ACCESS_URL="https://coder.example.com" \
-e CODER_PG_CONNECTION_URL="postgresql://username:password@database/coder" \
-v /var/run/docker.sock:/var/run/docker.sock \
--group-add $DOCKER_GROUP \
ghcr.io/coder/coder:latest
```

Coder configuration is defined via environment variables. Learn more about
Coder's [configuration options](../admin/configure.md).

## docker compose

Coder's publishes a
[docker-compose example](https://github.com/coder/coder/blob/main/docker-compose.yaml)
which includes an PostgreSQL container and volume.

1. Install [Docker Compose](https://docs.docker.com/compose/install/)

2. Clone the `coder` repository:

```shell
git clone https://github.com/coder/coder.git
```

3. Start Coder with `docker compose up`:
1. Make sure you have [Docker Compose](https://docs.docker.com/compose/install/)
installed.

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.
2. Download the
[`docker-compose.yaml`](https://github.com/coder/coder/blob/main/docker-compose.yaml)
file.

For proof-of-concept deployments, you can use
[Coder's tunnel](../admin/configure.md#tunnel):
3. Update `group_add:` in `docker-compose.yaml` with the `gid` of `docker`
group. You can get the `docker` group `gid` by running the below command:

```shell
cd coder

docker compose up
getent group docker | cut -d: -f3
```

For production deployments, we recommend setting an
[access URL](../admin/configure.md#access-url):
4. Start Coder with `docker compose up`

```shell
cd coder
5. Visit the web ui via the configured url.

CODER_ACCESS_URL=https://coder.example.com docker compose up
```

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
6. Follow the on-screen instructions log in and create your first template and
workspace

</div>

Coder configuration is defined via environment variables. Learn more about
Coder's [configuration options](../admin/configure.md).

> **Note:** 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).
> >
> > For production deployments, we recommend setting an
> > [access URL](../admin/configure.md#access-url)

> **Note:** 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.

## Troubleshooting

### Docker-based workspace is stuck in "Connecting..."
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp