Skip to content

Improve Docker documentation for 6.0.0+ and MacOS users #7407

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
35 changes: 31 additions & 4 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,24 @@ In general, the environment consist of:
read-only. To prevent this, a new group named `docker-desktop` and GUID 100999
needs to be created, then added to your user and the source code folder:

**For Linux:**
```bash
sudo groupadd -g 100999 docker-desktop
sudo useradd -u 100999 -g 100999 -M docker-desktop
sudo chown -R $USER:docker-desktop $WZ_HOME
sudo usermod -aG docker-desktop $USER
```

**For MacOS:**
```bash
sudo dscl . -create /Groups/docker-desktop
sudo dscl . -create /Groups/docker-desktop PrimaryGroupID 100999
sudo dscl . -create /Users/docker-desktop
sudo dscl . -create /Users/docker-desktop UniqueID 100999
sudo dscl . -create /Users/docker-desktop PrimaryGroupID 100999
sudo chown -R $(whoami):staff $WZ_HOME
```

## Understanding Docker contexts

Before we begin starting Docker containers, we need to understand the
Expand Down Expand Up @@ -107,11 +118,20 @@ This brings up a Dev environment for the `wazuh-dashboard-plugins` development b
```bash
./dev.sh $WZ_HOME up
```
### Important Note for Dashboard Initialization
Starting from version 6.0.0, the Wazuh Dashboard container automatically:

Once the containers are up, **attach a shell to the development container**,
move to the `kbn\plugins\wazuh` and run `yarn` to install the dependencies of
the project. After that, move back to the root folder of the platform and run
`yarn start` to start the App.
- Installs dependencies
- Starts the server with yarn start --no-base-path
This means you don't need to manually enter the container to run these commands. Instead:

1. Access the dashboard at https://localhost:5601 (note the HTTPS protocol)
2. If you encounter the message "Wazuh dashboard server is not ready yet", please be patient while the services initialize.

Optional: You can monitor the startup process by checking the container logs:
```bash
docker logs -f <container_name>
```

The dependencies of the platform (Kibana \ OSD) are already installed, but it
might take a while to optimize all the bundles. We might include the cache in the
Expand Down Expand Up @@ -283,3 +303,10 @@ error getting credentials - err: exit status 1, out: `error getting credentials
[3]: https://prometheus.io/docs/visualization/grafana/ 'Prometheus'
[4]: https://quay.io/organization/wazuh 'quay.io/wazuh'
[5]: https://github.com/wazuh/wazuh-dashboard-plugins/issues/3872#issuecomment-1305507626 'App permissions'

3. "Wazuh dashboard server is not ready yet" error
**Solution:** Check the container logs with docker logs -f <container_name> . Common causes include:

- Initialization still in progress (wait a few minutes and wait until you see a message like "[success][@osd/optimizer] bundles compiled successfully" in the logs)
- Connection issues between services
- Problems with Wazuh indexer
31 changes: 29 additions & 2 deletions docker/osd-dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@

- vm.max_map_count=262144

To modify the vm.max_map_count, you can run this command:
To modify the vm.max_map_count:

**Linux:**
`sudo sysctl -w vm.max_map_count=262144`

**MacOs:**
For Docker Desktop on Mac, this setting needs to be applied to the Linux VM that runs Docker

`docker run --rm --privileged alpine sysctl -w vm.max_map_count=262144`
This command temporarily increases the memory map count limit in the Docker VM, which is required for Elasticsearch/OpenSearch to function properly. The setting will persist until Docker Desktop is restarted.

- jq

To install jq, you can run this command:
Expand All @@ -26,7 +34,7 @@ Use always the provided script to bring up or down the development
environment. For example:

```
./dev.sh [-os <os_version>] [-osd <osd_version>] [--wz-home <wazuh_app_source>] [-saml] [--server <server_version>] -a, --action <action>
./dev.sh [-os <os_version>] [-osd <osd_version>] [--wz-home <wazuh_app_source>] [-saml] [--server <server_version>] [--no-start] -a, --action <action>
```

use `--help` for more info.
Expand All @@ -39,6 +47,25 @@ located.
Use the `saml` flag to bring up KeyCloak IDP. **Add idp to your hosts and start
the server using the `--no-base-path`**.

Use the `--no-start` flag if you want to prevent the automatic startup of the dashboard service. This keeps the container running without starting the service, allowing you to connect to it and run commands manually:

```bash
###For example:
### Start the environment without automatically starting the dashboard service
./dev.sh -os 2.19.1 -osd 2.19.1-5.0.0 --no-start -a up

### Then connect to the container
docker exec -it os-dev-2191-500-osd-1 bash

### Manually install dependencies in all plugin folders for example:
cd plugins/wazuh-core
yarn install

### And manually start the service
cd /home/node/kbn
yarn start --no-base-path
```

```apacheconf
# Linux systems: /etc/hosts
# Windows systems: C:\Windows\System32\drivers\etc\hosts
Expand Down