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: Or within a container:
```shell ```shell
docker-compose exec diun diun notif test docker compose exec diun diun notif test
``` ```
## Customize the hostname ## Customize the hostname
The hostname that appears in your notifications is the one associated with the 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: By default, it's a random string like `d2219b854598`. To change it:
```console ```console
$ docker run --hostname "diun" ... $ docker run --hostname "diun" ...
``` ```
Or if you use docker-compose: Or if you use Docker Compose:
```yaml ```yaml
services: services:
diun: diun:
image: crazymax/diun:latest image: crazymax/diun:latest
hostname: diun hostname: diun
...
``` ```
## Notification template ## 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`: your docker config file `$HOME/.docker/config.json` if you are already connected to the registry with `docker login`:
```yaml ```yaml
version: "3.5" name: diun
services: services:
diun: 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): [`--profiler-path` and `--profiler` flags with `serve` command](usage/command-line.md#serve):
```yaml ```yaml
version: "3.5" name: diun
services: services:
diun: diun:
@@ -323,7 +322,7 @@ services:
restart: always restart: always
``` ```
Following profilers are available: The following profilers are available:
* `cpu` enables cpu profiling * `cpu` enables cpu profiling
* `mem` enables memory profiling * `mem` enables memory profiling

View File

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

View File

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

View File

@@ -2,20 +2,23 @@
## About ## About
The Docker provider allows you to analyze the containers of your Docker instance to extract images found and check The Docker provider allows you to analyze the containers of your Docker instance
for updates on the registry. to extract images found and check for updates on the registry.
## Quick start ## 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 Here we use a single Docker provider with a minimum configuration to analyze
(watch by default disabled), even stopped ones, of your local Docker instance. 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 ```yaml
version: "3.5" name: cloudflared
services: services:
diun: diun:
@@ -53,12 +56,13 @@ services:
restart: always restart: always
``` ```
As an example we use [crazymax/cloudflared:latest](https://github.com/crazy-max/docker-cloudflared) Docker image. As an example we use [crazymax/cloudflared:latest](https://github.com/crazy-max/docker-cloudflared)
A few [labels](#docker-labels) are added to configure the image analysis of this container for Diun. Now start this Docker image. A few [labels](#docker-labels) are added to configure the image
composition with `docker-composes up -d` and take a look at the logs: 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 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.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" 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: Now let's create a simple stack for Diun:
```yaml ```yaml
version: "3.5" name: diun
services: services:
diun: diun:
@@ -43,7 +43,7 @@ services:
And another one with a simple service: And another one with a simple service:
```yaml ```yaml
version: "3.5" name: diun
services: services:
nginx: nginx:
@@ -59,10 +59,11 @@ services:
- "diun.enable=true" - "diun.enable=true"
``` ```
As an example we use [nginx](https://hub.docker.com/_/nginx/) Docker image. A few [labels](#docker-labels) are added As an example we use [nginx](https://hub.docker.com/_/nginx/) Docker image. A
to configure the image analysis of this service for Diun. We can now start these 2 stacks: 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 diun.yml diun
docker stack deploy -c nginx.yml nginx docker stack deploy -c nginx.yml nginx
``` ```

View File

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

View File

@@ -1,17 +1,19 @@
# Docker + File providers # 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. 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) In this section we quickly go over a basic Docker Compose file to run Diun
and [file](../providers/file.md) providers. using the [docker](../providers/docker.md) and [file](../providers/file.md)
providers.
## Setup ## Setup
Create a `docker-compose.yml` file that uses the official Diun image: Create a `docker-compose.yml` file that uses the official Diun image:
```yaml ```yaml
version: "3.5" name: diun
services: services:
diun: diun:
@@ -47,12 +49,13 @@ services:
- ^\d+\.\d+\..* - ^\d+\.\d+\..*
``` ```
Here we use a minimal configuration to analyze **all running containers** (watch by default enabled) of Here we use a minimal configuration to analyze **all running containers**
your **local Docker** instance with the [Docker provider](../providers/docker.md) and also **custom images** (watch by default enabled) of your **local Docker** instance with the
through the [File provider](../providers/file.md) **every 6 hours**. [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: That's it. Now you can launch Diun with the following command:
```shell ```shell
docker-compose up -d docker compose up -d
``` ```