Switch to docker compose v2 (#1692)
* refactor: docker compose migration * fix compose download link * set static name for electric container --------- Co-authored-by: nicktrn <55853254+nicktrn@users.noreply.github.com>
This commit is contained in:
+24
-15
@@ -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/latest/download/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:
|
||||
|
||||
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.
|
||||
```
|
||||
Docker Compose version vX.Y.Z
|
||||
```
|
||||
|
||||
When you've verified that the `docker-compose` package is installed and you proceed to start Docker with `pnpm run docker`.
|
||||
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`.
|
||||
|
||||
You'll probably get an error similar to the one below:
|
||||
|
||||
|
||||
@@ -140,6 +140,7 @@ services:
|
||||
# - "REDIS_CLUSTER_CREATOR=yes"
|
||||
|
||||
electric:
|
||||
container_name: electric
|
||||
image: electricsql/electric:1.0.0-beta.15@sha256:4ae0f895753b82684aa31ea1c708e9e86d0a9bca355acb7270dcb24062520810
|
||||
restart: always
|
||||
environment:
|
||||
|
||||
+5
-5
@@ -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 --concurrency=1 -- --run",
|
||||
"test:webapp": "turbo run test --filter webapp -- --run",
|
||||
"test:packages": "turbo run test --concurrency=1 --filter \"@trigger.dev/*\" -- --run",
|
||||
|
||||
Reference in New Issue
Block a user