diff --git a/docker/README.md b/docker/README.md index a009788ca99fc..11a8ade4a2c68 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,55 +1,19 @@ -# Indexer development environments +# Docker environments -Install [Docker Desktop][docker-desktop] as per its instructions, available for Windows, Mac -and Linux (Ubuntu, Debian & Fedora). -This ensures that the development experience between Linux, Mac and Windows is as -similar as possible. - -> IMPORTANT: be methodic during the installation of Docker Desktop, and proceed -> step by step as described in their documentation. Make sure that your system -> meets the system requirements before installing Docker Desktop, and read any -> post-installation note, specially on Linux: [Differences between -> Docker Desktop for Linux and Docker Engine][docker-variant]. +Multipurpose Docker environments to run, test and build `wazuh-indexer`. ## Pre-requisites -1. Assign resources to [Docker Desktop][docker-desktop]. The requirements for the - environments are: +1. Install [Docker][docker] as per its instructions. + +1. Your workstation must meet the minimum hardware requirements: - 8 GB of RAM (minimum) - 4 cores The more resources the better ☺ -2. Clone the [wazuh-indexer][wi-repo]. - -3. Set up user permissions - - The Docker volumes will be created by the internal Docker user, making them - 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: - - ```bash - sudo groupadd -g 100999 docker-desktop - sudo useradd -u 100999 -g 100999 -M docker-desktop - sudo chown -R docker-desktop:docker-desktop $WZD_HOME - sudo usermod -aG docker-desktop $USER - ``` - -## Understanding Docker contexts - -Before we begin starting Docker containers, we need to understand the -differences between Docker Engine and Docker Desktop, more precisely, that the -use different contexts. - -Carefully read these two sections of the Docker documentation: - -- [Differences between Docker Desktop for Linux and Docker Engine][docker-variant]. -- [Switch between Docker Desktop and Docker Engine][docker-context]. - -Docker Desktop will change to its context automatically at start, so be sure -that any existing Docker container using the default context is **stopped** -before starting Docker Desktop and any of the environments in this folder. +1. Clone the [wazuh-indexer][wi-repo]. ## Development environments @@ -61,27 +25,24 @@ Example: Usage: ./dev.sh {up|down|stop} ``` -Once the `wi-dev:x.y.z` container is up, attach a shell to it and run `./gradlew run` -to start the application. +Once the `wi-dev:x.y.z` container is up, attach a shell to it and run `./gradlew run` to start the application. ## Containers to generate packages Use the `ci/ci.sh` script to start provisioned containers to generate packages. ```bash -Usage: ./ci.sh {up|down|stop} [ci] +Usage: ./ci.sh {up|down|stop} ``` -Refer to [scripts/README.md](../scripts/README.md) for details about how to build packages. +Refer to [packaging_scripts/README.md](../packaging_scripts/README.md) for details about how to build packages. -[docker-desktop]: https://docs.docker.com/get-docker -[docker-variant]: https://docs.docker.com/desktop/install/linux-install/#differences-between-docker-desktop-for-linux-and-docker-engine -[docker-context]: https://docs.docker.com/desktop/install/linux-install/#context +[docker]: https://docs.docker.com/engine/install [wi-repo]: https://github.com/wazuh/wazuh-indexer ## Building Docker images -The [prod](./prod) folder contains the code to build Docker images. A tarball of `wazuh-indexer` needs to be located at the same level that the Dockerfile. Below there is example of the command needed to build the image. Set the build arguments and the image tag accordingly. +The [prod](./prod) folder contains the code to build Docker images. A tarball of `wazuh-indexer` needs to be located at the same level that the Dockerfile. Below there is an example of the command needed to build the image. Set the build arguments and the image tag accordingly. ```console docker build --build-arg="VERSION=4.10.0" --build-arg="INDEXER_TAR_NAME=wazuh-indexer-4.10.0-1_linux-x64_cfca84f.tar.gz" --tag=wazuh-indexer:4.10.0 --progress=plain --no-cache . diff --git a/docker/ci/ci.yml b/docker/ci/ci.yml index 11a05b79a5c18..da965feda473f 100644 --- a/docker/ci/ci.yml +++ b/docker/ci/ci.yml @@ -1,5 +1,3 @@ -version: "3.9" - services: # Essentially wi-dev, but doesn't expose port 9200 wi-build: diff --git a/docker/dev/dev.yml b/docker/dev/dev.yml index cc55b0737dc84..b485c66f8fc71 100644 --- a/docker/dev/dev.yml +++ b/docker/dev/dev.yml @@ -1,5 +1,3 @@ -version: "3.9" - services: wi-dev: image: wi-dev:${VERSION}