docs: fix compose examples to use latest stable syntax

This commit is contained in:
CrazyMax
2024-06-10 09:47:54 +02:00
parent 7d6850e793
commit e67315ccd6
7 changed files with 57 additions and 49 deletions

View File

@@ -23,27 +23,26 @@ diun notif test
Or within a container:
```shell
docker-compose exec diun diun notif test
docker compose exec diun diun notif test
```
## Customize the hostname
The hostname that appears in your notifications is the one associated with the
container if you use the Diun image with `docker run` or `docker-compose up -d`.
container if you use the Diun image with `docker run` or `docker compose up -d`.
By default, it's a random string like `d2219b854598`. To change it:
```console
$ docker run --hostname "diun" ...
```
Or if you use docker-compose:
Or if you use Docker Compose:
```yaml
services:
diun:
image: crazymax/diun:latest
hostname: diun
...
```
## Notification template
@@ -90,7 +89,7 @@ You can authenticate against the registry through the [`regopts` settings](confi
your docker config file `$HOME/.docker/config.json` if you are already connected to the registry with `docker login`:
```yaml
version: "3.5"
name: diun
services:
diun:
@@ -303,7 +302,7 @@ Diun provides a simple way to manage runtime/pprof profiling through the
[`--profiler-path` and `--profiler` flags with `serve` command](usage/command-line.md#serve):
```yaml
version: "3.5"
name: diun
services:
diun:
@@ -323,7 +322,7 @@ services:
restart: always
```
Following profilers are available:
The following profilers are available:
* `cpu` enables cpu profiling
* `mem` enables memory profiling

View File

@@ -35,16 +35,16 @@ Image: crazymax/diun:latest
## Usage
!!! note
This reference setup guides users through the setup based on `docker-compose` and the
[Docker provider](../providers/docker.md), but the installation of `docker-compose` is out of scope of this
documentation. To install `docker-compose` itself, follow the official
[install instructions](https://docs.docker.com/compose/install/).
This reference setup guides users through the setup based on Docker Compose
and the [Docker provider](../providers/docker.md), but the installation of
Docker Compose is out of scope of this documentation. To install Docker
Compose itself, follow the official [install instructions](https://docs.docker.com/compose/install/).
You can also use the [Swarm](../providers/swarm.md) or [Kubernetes](../providers/kubernetes.md) providers
if you don't want to use `docker-compose`.
if you don't want to use Docker Compose.
```yaml
version: "3.5"
name: diun
services:
diun:
@@ -67,8 +67,8 @@ services:
Edit this example with your preferences and run the following commands to bring up Diun:
```shell
docker-compose up -d
docker-compose logs -f
docker compose up -d
docker compose logs -f
```
Or use the following command:
@@ -89,14 +89,14 @@ docker run -d --name diun \
To upgrade your installation to the latest release:
```shell
docker-compose pull
docker-compose up -d
docker compose pull
docker compose up -d
```
If you prefer to rely on the configuration file instead of environment variables:
```yaml
version: "3.5"
name: diun
services:
diun:

View File

@@ -241,7 +241,7 @@ configuration file:
[default places](../config/index.md#configuration-file)
```yaml
version: "3.5"
name: diun
services:
diun:

View File

@@ -2,20 +2,23 @@
## About
The Docker provider allows you to analyze the containers of your Docker instance to extract images found and check
for updates on the registry.
The Docker provider allows you to analyze the containers of your Docker instance
to extract images found and check for updates on the registry.
## Quick start
In this section we quickly go over a basic docker-compose file using your local docker provider.
In this section we quickly go over a basic Docker Compose file using your local
docker provider.
Here we use a single Docker provider with a minimum configuration to analyze labeled containers
(watch by default disabled), even stopped ones, of your local Docker instance.
Here we use a single Docker provider with a minimum configuration to analyze
labeled containers (watch by default disabled), even stopped ones, of your
local Docker instance.
Now let's create a simple docker-compose file with Diun and some simple services:
Now let's create a simple `docker-compose.yml` file with Diun and some simple
services:
```yaml
version: "3.5"
name: cloudflared
services:
diun:
@@ -53,12 +56,13 @@ services:
restart: always
```
As an example we use [crazymax/cloudflared:latest](https://github.com/crazy-max/docker-cloudflared) Docker image.
A few [labels](#docker-labels) are added to configure the image analysis of this container for Diun. Now start this
composition with `docker-composes up -d` and take a look at the logs:
As an example we use [crazymax/cloudflared:latest](https://github.com/crazy-max/docker-cloudflared)
Docker image. A few [labels](#docker-labels) are added to configure the image
analysis of this container for Diun. Now start this composition with
`docker compose up -d` and take a look at the logs:
```
$ docker-compose logs -f
$ docker compose logs -f
Attaching to bin_diun_1, cloudflared
cloudflared | time="2019-12-14T15:30:07+01:00" level=info msg="Adding DNS upstream" url="https://1.1.1.1/dns-query"
cloudflared | time="2019-12-14T15:30:07+01:00" level=info msg="Adding DNS upstream" url="https://1.0.0.1/dns-query"

View File

@@ -15,7 +15,7 @@ disabled).
Now let's create a simple stack for Diun:
```yaml
version: "3.5"
name: diun
services:
diun:
@@ -43,7 +43,7 @@ services:
And another one with a simple service:
```yaml
version: "3.5"
name: diun
services:
nginx:
@@ -59,10 +59,11 @@ services:
- "diun.enable=true"
```
As an example we use [nginx](https://hub.docker.com/_/nginx/) Docker image. A few [labels](#docker-labels) are added
to configure the image analysis of this service for Diun. We can now start these 2 stacks:
As an example we use [nginx](https://hub.docker.com/_/nginx/) Docker image. A
few [labels](#docker-labels) are added to configure the image analysis of this
service for Diun. We can now start these 2 stacks:
```
```shell
docker stack deploy -c diun.yml diun
docker stack deploy -c nginx.yml nginx
```

View File

@@ -1,13 +1,14 @@
# Basic example
In this section we quickly go over a basic docker-compose file to run Diun using the docker provider.
In this section we quickly go over a basic Docker Compose file to run Diun
using the docker provider.
## Setup
Create a `docker-compose.yml` file that uses the official Diun image:
```yaml
version: "3.5"
name: diun
services:
diun:
@@ -29,19 +30,19 @@ services:
restart: always
```
Here we use a minimal configuration to analyze **all running containers** (watch by default enabled) of
your **local Docker** instance **every 6 hours**.
Here we use a minimal configuration to analyze **all running containers**
(watch by default enabled) of your **local Docker** instance **every 6 hours**.
That's it. Now you can launch Diun with the following command:
```shell
docker-compose up -d
docker compose up -d
```
If you prefer to rely on the configuration file instead of environment variables:
```yaml
version: "3.5"
name: diun
services:
diun:

View File

@@ -1,17 +1,19 @@
# Docker + File providers
It is possible to use several providers at the same time with Diun. This can be particularly useful if you want to
It is possible to use several providers at the same time with Diun. This can be
particularly useful if you want to
analyze some images that you don't manage through a container.
In this section we quickly go over a basic docker-compose file to run Diun using the [docker](../providers/docker.md)
and [file](../providers/file.md) providers.
In this section we quickly go over a basic Docker Compose file to run Diun
using the [docker](../providers/docker.md) and [file](../providers/file.md)
providers.
## Setup
Create a `docker-compose.yml` file that uses the official Diun image:
```yaml
version: "3.5"
name: diun
services:
diun:
@@ -47,12 +49,13 @@ services:
- ^\d+\.\d+\..*
```
Here we use a minimal configuration to analyze **all running containers** (watch by default enabled) of
your **local Docker** instance with the [Docker provider](../providers/docker.md) and also **custom images**
through the [File provider](../providers/file.md) **every 6 hours**.
Here we use a minimal configuration to analyze **all running containers**
(watch by default enabled) of your **local Docker** instance with the
[Docker provider](../providers/docker.md) and also **custom images** through
the [File provider](../providers/file.md) **every 6 hours**.
That's it. Now you can launch Diun with the following command:
```shell
docker-compose up -d
docker compose up -d
```