Skip to content

Commit e8698f9

Browse files
Improve Docker documentation for 6.0.0+ and MacOS users (#7407)
* Improve Docker documentation for 5.0.0+ and MacOS users Signed-off-by: gonzaarancibia <[email protected]> * improve wording in dashboard initialization instructions Signed-off-by: gonzaarancibia <[email protected]> * remove redundant setup instructions from README Signed-off-by: gonzaarancibia <[email protected]> * add documentation for --no-start flag Signed-off-by: gonzaarancibia <[email protected]> * improve formatting in --no-start flag example Signed-off-by: gonzaarancibia <[email protected]> * add --no-base-path flag to manual start example Signed-off-by: gonzaarancibia <[email protected]> * improve and delete deprecated doc Signed-off-by: gonzaarancibia <[email protected]> * docs(docker-readme): Adds detailed information about the code optimization process Signed-off-by: gonzaarancibia <[email protected]> * docs(docker-readme): Fixes MacOS user permission setup by using $(whoami) instead of $USER Signed-off-by: gonzaarancibia <[email protected]> * docs(docker-readme): Update paths, commands, comments to OpenSearch Dashboard in osd-dev documentation Signed-off-by: gonzaarancibia <[email protected]> * doc: update README.md --------- Signed-off-by: gonzaarancibia <[email protected]>
1 parent dbf0272 commit e8698f9

File tree

2 files changed

+60
-6
lines changed

2 files changed

+60
-6
lines changed

docker/README.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,24 @@ In general, the environment consist of:
6666
read-only. To prevent this, a new group named `docker-desktop` and GUID 100999
6767
needs to be created, then added to your user and the source code folder:
6868

69+
**For Linux:**
6970
```bash
7071
sudo groupadd -g 100999 docker-desktop
7172
sudo useradd -u 100999 -g 100999 -M docker-desktop
7273
sudo chown -R $USER:docker-desktop $WZ_HOME
7374
sudo usermod -aG docker-desktop $USER
7475
```
7576

77+
**For MacOS:**
78+
```bash
79+
sudo dscl . -create /Groups/docker-desktop
80+
sudo dscl . -create /Groups/docker-desktop PrimaryGroupID 100999
81+
sudo dscl . -create /Users/docker-desktop
82+
sudo dscl . -create /Users/docker-desktop UniqueID 100999
83+
sudo dscl . -create /Users/docker-desktop PrimaryGroupID 100999
84+
sudo chown -R $(whoami):staff $WZ_HOME
85+
```
86+
7687
## Understanding Docker contexts
7788

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

111-
Once the containers are up, **attach a shell to the development container**,
112-
move to the `kbn\plugins\wazuh` and run `yarn` to install the dependencies of
113-
the project. After that, move back to the root folder of the platform and run
114-
`yarn start` to start the App.
124+
- Installs dependencies
125+
- Starts the server with yarn start --no-base-path
126+
This means you don't need to manually enter the container to run these commands. Instead:
127+
128+
1. Access the dashboard at https://localhost:5601 (note the HTTPS protocol)
129+
2. If you encounter the message "Wazuh dashboard server is not ready yet", please be patient while the services initialize.
130+
131+
Optional: You can monitor the startup process by checking the container logs:
132+
```bash
133+
docker logs -f <container_name>
134+
```
115135
116136
The dependencies of the platform (Kibana \ OSD) are already installed, but it
117137
might take a while to optimize all the bundles. We might include the cache in the
@@ -283,3 +303,10 @@ error getting credentials - err: exit status 1, out: `error getting credentials
283303
[3]: https://prometheus.io/docs/visualization/grafana/ 'Prometheus'
284304
[4]: https://quay.io/organization/wazuh 'quay.io/wazuh'
285305
[5]: https://github.com/wazuh/wazuh-dashboard-plugins/issues/3872#issuecomment-1305507626 'App permissions'
306+
307+
3. "Wazuh dashboard server is not ready yet" error
308+
**Solution:** Check the container logs with docker logs -f <container_name> . Common causes include:
309+
310+
- 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)
311+
- Connection issues between services
312+
- Problems with Wazuh indexer

docker/osd-dev/README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44

55
- vm.max_map_count=262144
66

7-
To modify the vm.max_map_count, you can run this command:
7+
To modify the vm.max_map_count:
8+
9+
**Linux:**
810
`sudo sysctl -w vm.max_map_count=262144`
11+
12+
**MacOs:**
13+
For Docker Desktop on Mac, this setting needs to be applied to the Linux VM that runs Docker
914

15+
`docker run --rm --privileged alpine sysctl -w vm.max_map_count=262144`
16+
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.
17+
1018
- jq
1119

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

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

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

50+
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:
51+
52+
```bash
53+
###For example:
54+
### Start the environment without automatically starting the dashboard service
55+
./dev.sh -os 2.19.1 -osd 2.19.1-5.0.0 --no-start -a up
56+
57+
### Then connect to the container
58+
docker exec -it os-dev-2191-500-osd-1 bash
59+
60+
### Manually install dependencies in all plugin folders for example:
61+
cd plugins/wazuh-core
62+
yarn install
63+
64+
### And manually start the service
65+
cd /home/node/kbn
66+
yarn start --no-base-path
67+
```
68+
4269
```apacheconf
4370
# Linux systems: /etc/hosts
4471
# Windows systems: C:\Windows\System32\drivers\etc\hosts

0 commit comments

Comments
 (0)