From de0220bc056fee83e117243fba5b4da188833ab3 Mon Sep 17 00:00:00 2001 From: rharkor Date: Tue, 11 Feb 2025 11:00:33 +0100 Subject: [PATCH] refactor: docker compose migration --- DOCKER_INSTALLATION.md | 39 ++++++++++++++++++++++++--------------- package.json | 10 +++++----- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/DOCKER_INSTALLATION.md b/DOCKER_INSTALLATION.md index a46e904ee2..7b5a24bbe6 100644 --- a/DOCKER_INSTALLATION.md +++ b/DOCKER_INSTALLATION.md @@ -8,47 +8,56 @@ If you don't have Docker installed on your machine, you'll run into some complic Below are the steps on how you can avoid that. -First you need to setup docker-compose as it is an underlying tool that this command: `pnpm run docker` fires behind the scene. +First you need to setup docker compose as it is an underlying tool that this command: `pnpm run docker` fires behind the scene. ## Linux -To install Docker Compose on Linux Ubuntu via the terminal, you can follow these steps: +To install Docker Compose on Linux Ubuntu, you can follow these steps: -1. Update the package index on your system by running the following command: +1. Create the Docker config directory and cli-plugins subdirectory: ```shell - sudo apt update + DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker} + mkdir -p $DOCKER_CONFIG/cli-plugins ``` -2. Install the required dependencies by running the following command: +2. Download the Docker Compose plugin: ```shell - sudo apt install curl + curl -SL "https://github.com/docker/compose/releases/download/latest/docker-compose-$(uname -s)-$(uname -m)" -o $DOCKER_CONFIG/cli-plugins/docker-compose ``` -3. Download the Docker Compose binary into the `/usr/local/bin` directory using the `curl` command: + Note: + + - To install for all users, replace `$DOCKER_CONFIG/cli-plugins` with `/usr/local/lib/docker/cli-plugins` + +3. Set the appropriate permissions to make the Docker Compose plugin executable: ```shell - sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose ``` -4. Set the appropriate permissions to make the `docker-compose` binary executable: + If you installed for all users: ```shell - sudo chmod +x /usr/local/bin/docker-compose + sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose ``` -5. Verify that Docker Compose has been successfully installed by running the following command: +4. Verify that Docker Compose has been successfully installed: ```shell - docker-compose --version + docker compose version ``` - This command should display the version information of Docker Compose without any errors. + You should see output similar to: + + ``` + Docker Compose version vX.Y.Z + ``` -After following these steps, you should have Docker Compose installed on your Ubuntu system, and you can use it by running `docker-compose` commands in the terminal. +After following these steps, you should have Docker Compose installed on your Ubuntu system, and you can use it by running `docker compose` commands in the terminal. -When you've verified that the `docker-compose` package is installed and you proceed to start Docker with `pnpm run docker`. +When you've verified that the `docker compose` package is installed and you proceed to start Docker with `pnpm run docker`. You'll probably get an error similar to the one below: diff --git a/package.json b/package.json index 50ee8dc9e1..0285b98133 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,11 @@ "format": "prettier . --write --config prettier.config.js", "generate": "turbo run generate", "lint": "turbo run lint", - "docker": "docker-compose -p triggerdotdev-docker -f docker/docker-compose.yml up -d --build --remove-orphans", - "docker:stop": "docker-compose -p triggerdotdev-docker -f docker/docker-compose.yml stop", - "dev:docker": "docker-compose -p triggerdotdev-dev-docker -f docker/dev-compose.yml up -d", - "dev:docker:build": "docker-compose -p triggerdotdev-dev-docker -f docker/dev-compose.yml up -d --build", - "dev:docker:stop": "docker-compose -p triggerdotdev-dev-docker -f docker/dev-compose.yml stop", + "docker": "docker compose -p triggerdotdev-docker -f docker/docker-compose.yml up -d --build --remove-orphans", + "docker:stop": "docker compose -p triggerdotdev-docker -f docker/docker-compose.yml stop", + "dev:docker": "docker compose -p triggerdotdev-dev-docker -f docker/dev-compose.yml up -d", + "dev:docker:build": "docker compose -p triggerdotdev-dev-docker -f docker/dev-compose.yml up -d --build", + "dev:docker:stop": "docker compose -p triggerdotdev-dev-docker -f docker/dev-compose.yml stop", "test": "turbo run test", "test:dev": "turbo run test:dev", "start": "turbo run start",