Migrate to Docker Compose v2

This commit is contained in:
vcerenu
2025-05-16 09:25:36 -03:00
parent 0f15acb783
commit 74c34e87b1
12 changed files with 17 additions and 71 deletions

View File

@@ -116,12 +116,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
echo "Installed Docker Compose version: $(docker-compose --version)"
- name: Build Wazuh images
run: |
IMAGE_TAG=${{ inputs.image_tag }}

View File

@@ -10,11 +10,6 @@ jobs:
- name: Check out code
uses: actions/checkout@v3
- name: Install docker-compose
run: |
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
- name: Build Wazuh images
run: build-docker-images/build-images.sh
@@ -68,11 +63,6 @@ jobs:
- name: Check out code
uses: actions/checkout@v3
- name: Install docker-compose
run: |
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
- name: Create enviroment variables
run: cat .env > $GITHUB_ENV
@@ -99,10 +89,10 @@ jobs:
- name: Create single node certficates
run: docker-compose -f single-node/generate-indexer-certs.yml run --rm generator
run: docker compose -f single-node/generate-indexer-certs.yml run --rm generator
- name: Start single node stack
run: docker-compose -f single-node/docker-compose.yml up -d
run: docker compose -f single-node/docker-compose.yml up -d
- name: Check Wazuh indexer start
run: |
@@ -196,11 +186,6 @@ jobs:
- name: Check out code
uses: actions/checkout@v3
- name: Install docker-compose
run: |
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
- name: Create enviroment variables
run: cat .env > $GITHUB_ENV
@@ -230,10 +215,10 @@ jobs:
rm -rf wazuh-manager.tar wazuh-indexer.tar wazuh-dashboard.tar
- name: Create multi node certficates
run: docker-compose -f multi-node/generate-indexer-certs.yml run --rm generator
run: docker compose -f multi-node/generate-indexer-certs.yml run --rm generator
- name: Start multi node stack
run: docker-compose -f multi-node/docker-compose.yml up -d
run: docker compose -f multi-node/docker-compose.yml up -d
- name: Check Wazuh indexer start
run: |

View File

@@ -65,7 +65,7 @@ build() {
echo WAZUH_FILEBEAT_MODULE=$WAZUH_FILEBEAT_MODULE >> .env
echo WAZUH_UI_REVISION=$WAZUH_UI_REVISION >> .env
docker-compose -f build-docker-images/build-images.yml --env-file .env build --no-cache || clean 1
docker compose -f build-docker-images/build-images.yml --env-file .env build --no-cache || clean 1
return 0
}

View File

@@ -1,6 +1,4 @@
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
version: '3.7'
services:
wazuh.manager:
build:

View File

@@ -5,5 +5,5 @@ The dockerfile hosted in this directory is used to build the image used to boot
To create the image, the following command must be executed:
```
$ docker build -t wazuh/wazuh-certs-generator:0.0.1 .
$ docker build -t wazuh/wazuh-certs-generator:0.0.2 .
```

View File

@@ -6,35 +6,12 @@ The example is migrating from v4.2 to v4.4.
Assuming that you have a v4.2 production deployment, perform the following steps.
**1. Stop 4.2 environment**
`docker-compose -f production-cluster.yml stop`
`docker compose -f production-cluster.yml stop`
**2. List elasticsearch volumes**
`docker volume ls --filter name='wazuh-docker_elastic-data'`
**3. Inspect elasticsearch volume**
`docker volume inspect wazuh-docker_elastic-data-1`
**4. Spin down the 4.2 environment.**
`docker-compose -f production-cluster.yml down`
**Steps 5 and 6 can be done with the volume-migrator.sh script, specifying Docker compose version and project name as parameters.**
Ex: $ multi-node/volume-migrator.sh 1.25.0 multi-node
**5. Run the volume create command:** create new indexer and Wazuh manager volumes using the `com.docker.compose.version` label value from the previous command.
```
docker volume create \
--label com.docker.compose.project=multi-node \
--label com.docker.compose.version=1.25.0 \
--label com.docker.compose.volume=wazuh-indexer-data-1 \
multi-node_wazuh-indexer-data-1
```
```
docker volume create \
--label com.docker.compose.project=multi-node \
--label com.docker.compose.version=1.25.0 \
--label com.docker.compose.volume=wazuh-indexer-data-2 \
**3. Inspect elasticsearch volume**docker-compose
multi-node_wazuh-indexer-data-2
```
```

View File

@@ -1,6 +1,6 @@
# Deploy Wazuh Docker in multi node configuration
This deployment is defined in the `docker-compose.yml` file with two Wazuh manager containers, three Wazuh indexer containers, and one Wazuh dashboard container. It can be deployed by following these steps:
This deployment is defined in the `docker-compose.yml` file with two Wazuh manager containers, three Wazuh indexer containers, and one Wazuh dashboard container. It can be deployed by following these steps:
1) Increase max_map_count on your host (Linux). This command must be run with root permissions:
```
@@ -8,18 +8,18 @@ $ sysctl -w vm.max_map_count=262144
```
2) Run the certificate creation script:
```
$ docker-compose -f generate-indexer-certs.yml run --rm generator
$ docker compose -f generate-indexer-certs.yml run --rm generator
```
3) Start the environment with docker-compose:
3) Start the environment with docker compose:
- In the foregroud:
```
$ docker-compose up
$ docker compose up
```
- In the background:
```
$ docker-compose up -d
$ docker compose up -d
```

View File

@@ -1,6 +1,4 @@
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
version: '3.7'
services:
wazuh.master:
image: wazuh/wazuh-manager:4.12.0

View File

@@ -1,6 +1,4 @@
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
version: '3'
services:
generator:
image: wazuh/wazuh-certs-generator:0.0.2

View File

@@ -8,17 +8,17 @@ $ sysctl -w vm.max_map_count=262144
```
2) Run the certificate creation script:
```
$ docker-compose -f generate-indexer-certs.yml run --rm generator
$ docker compose -f generate-indexer-certs.yml run --rm generator
```
3) Start the environment with docker-compose:
3) Start the environment with docker compose:
- In the foregroud:
```
$ docker-compose up
$ docker compose up
```
- In the background:
```
$ docker-compose up -d
$ docker compose up -d
```
The environment takes about 1 minute to get up (depending on your Docker host) for the first time since Wazuh Indexer must be started for the first time and the indexes and index patterns must be generated.

View File

@@ -1,6 +1,4 @@
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
version: '3.7'
services:
wazuh.manager:
image: wazuh/wazuh-manager:4.12.0

View File

@@ -1,6 +1,4 @@
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
version: '3'
services:
generator:
image: wazuh/wazuh-certs-generator:0.0.2