Skip to content

Commit

Permalink
Update Docker documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGustafsson committed Jan 3, 2025
1 parent 39c5e98 commit 7f38c20
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
38 changes: 27 additions & 11 deletions docs/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
# Docker
# Running Cupdate in Docker

Cupdate is made to run in Docker by mounting the Docker socket. Cupdate will
poll the socket for changes, reacting on changes made to containers.

To get started, run the following command to run Cupdate and expose its UI and
API on port 8080.

```shell
docker run --detach --volume /var/run/docker.sock:/var/run/docker.sock ghcr.io/alexgustafsson/cupdate:latest
docker run --interactive --tty --rm \
--volume "/var/run/docker.sock:/var/run/docker.sock:ro" \
--mount type=tmpfs,destination=/tmp \
--env CUPDATE_DOCKER_HOST=unix:///var/run/docker.sock \
--publish 8080:8080 \
ghcr.io/alexgustafsson/cupdate
```

See also the Docker compose example in [compose.yaml](compose.yaml).
To more easily configure Cupdate to your liking and persisting the configuration
it is recommended to use Docker Compose. To run Cupdate with Docker Compose, run
the following command.

```shell
docker compose up -f ./compose.yaml
docker compose -f ./docs/docker/compose.yaml up
```

The Compose file is configured using best practices, but can be adapted to suite
your needs.

## Config

For Docker, Cupdate requires the Docker host to be specified. For now, Cupdate
only supports using the Docker socket immediately. It should be configured using
the `CUPDATE_DOCKER_HOST` environment variable, setting it to
`unix:///var/run/docker.sock`, for example.
When running Cupdate using Docker, the Docker host needs to be specified. For
now, Cupdate only supports using the Docker socket immediately. Its path should
be configured using the `CUPDATE_DOCKER_HOST` environment variable, setting it
to `unix:///var/run/docker.sock`, for example.

By default, only running containers are used by Cupdate. To use all containers,
set `CUPDATE_DOCKER_INCLUDE_ALL_CONTAINERS` to `true`.
By default, only running containers are processed by Cupdate. To process all
containers, running or not, set `CUPDATE_DOCKER_INCLUDE_ALL_CONTAINERS` to
`true`.

See also [config.md](../config.md).
Whilst the commands above are enough to get you started with Cupdate, you might
want to change some configuration to better suite your needs. Please see the
additional documentation in [../config.md](../config.md).
11 changes: 6 additions & 5 deletions docs/docker/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ services:
ports:
- 8080:8080
environment:
CUPDATE_CACHE_PATH: /run/data/cachev1.boltdb
CUPDATE_DB_PATH: /run/data/dbv1.sqlite
CUPDATE_API_ADDRESS: "0.0.0.0"
CUPDATE_DOCKER_HOST: /run/docker.sock
CUPDATE_CACHE_PATH: /var/run/cachev1.boltdb
CUPDATE_DB_PATH: /var/run/dbv1.sqlite
CUPDATE_DOCKER_HOST: unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/run/docker.sock
- /var/run/docker.sock:/var/run/docker.sock:ro
- target: /tmp
type: tmpfs

0 comments on commit 7f38c20

Please sign in to comment.