Skip to content

Commit

Permalink
feat!: Remove support for Compose v1
Browse files Browse the repository at this point in the history
There has been no release of the deprecated 'docker-compose' Python
package since v1.29.2, which was published in May 2021[1]. This release
is currently broken due to a breaking change in the 'docker' Python
package at version 7.0.0[1], and there is seemlingly no plan to release
a patch version of Compose v1 to address the problem.

The official path forward is to use Compose v2, which is now bundled
with the Docker client and available on all platforms where Docker is
supported.

This commit additionally removes the 'version' attribute from Compose
files, since it was obsoleted in the Compose Spec[3].

Closes #1017

[1]: https://pypi.org/project/docker-compose/#history
[2]: docker/docker-py#3194
[3]: https://compose-spec.io
  • Loading branch information
antoineco committed Sep 17, 2024
1 parent de57b24 commit 24306fd
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 42 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ Other available stack variants:
## tl;dr

```sh
docker-compose up setup
docker compose up setup
```

```sh
docker-compose up
docker compose up
```

![Animated demo](https://user-images.githubusercontent.com/3299086/155972072-0c89d6db-707a-47a1-818b-5f976565f95a.gif)
Expand Down Expand Up @@ -91,7 +91,7 @@ own_. [sherifabdlnaby/elastdocker][elastdocker] is one example among others of p
### Host setup

* [Docker Engine][docker-install] version **18.06.0** or newer
* [Docker Compose][compose-install] version **1.28.0** or newer (including [Compose V2][compose-v2])
* [Docker Compose][compose-install] version **2.0.0** or newer
* 1.5 GB of RAM

> [!NOTE]
Expand Down Expand Up @@ -128,7 +128,7 @@ instructions from the [documentation][mac-filesharing] to add more locations.
## Usage

> [!WARNING]
> You must rebuild the stack images with `docker-compose build` whenever you switch branch or update the
> You must rebuild the stack images with `docker compose build` whenever you switch branch or update the
> [version](#version-selection) of an already existing stack.
### Bringing up the stack
Expand All @@ -142,13 +142,13 @@ git clone https://github.com/deviantony/docker-elk.git
Then, initialize the Elasticsearch users and groups required by docker-elk by executing the command:

```sh
docker-compose up setup
docker compose up setup
```

If everything went well and the setup completed without error, start the other stack components:

```sh
docker-compose up
docker compose up
```

> [!NOTE]
Expand Down Expand Up @@ -186,15 +186,15 @@ reset the passwords of all aforementioned Elasticsearch users to random secrets.
of them.

```sh
docker-compose exec elasticsearch bin/elasticsearch-reset-password --batch --user elastic
docker compose exec elasticsearch bin/elasticsearch-reset-password --batch --user elastic
```

```sh
docker-compose exec elasticsearch bin/elasticsearch-reset-password --batch --user logstash_internal
docker compose exec elasticsearch bin/elasticsearch-reset-password --batch --user logstash_internal
```

```sh
docker-compose exec elasticsearch bin/elasticsearch-reset-password --batch --user kibana_system
docker compose exec elasticsearch bin/elasticsearch-reset-password --batch --user kibana_system
```

If the need for it arises (e.g. if you want to [collect monitoring information][ls-monitoring] through Beats and
Expand Down Expand Up @@ -223,7 +223,7 @@ reset the passwords of all aforementioned Elasticsearch users to random secrets.
1. Restart Logstash and Kibana to re-connect to Elasticsearch using the new passwords

```sh
docker-compose up -d logstash kibana
docker compose up -d logstash kibana
```

> [!NOTE]
Expand Down Expand Up @@ -260,7 +260,7 @@ Elasticsearch data is persisted inside a volume by default.
In order to entirely shutdown the stack and remove all persisted data, use the following Docker Compose command:

```sh
docker-compose down -v
docker compose down -v
```

### Version selection
Expand All @@ -269,7 +269,7 @@ This repository stays aligned with the latest version of the Elastic stack. The
version (8.x).

To use a different version of the core Elastic components, simply change the version number inside the [`.env`](.env)
file. If you are upgrading an existing stack, remember to rebuild all container images using the `docker-compose build`
file. If you are upgrading an existing stack, remember to rebuild all container images using the `docker compose build`
command.

> [!IMPORTANT]
Expand Down Expand Up @@ -359,7 +359,7 @@ To run the setup container again and re-initialize all users for which a passwor
simply "up" the `setup` Compose service again:

```console
$ docker-compose up setup
$ docker compose up setup
⠿ Container docker-elk-elasticsearch-1 Running
⠿ Container docker-elk-setup-1 Created
Attaching to docker-elk-setup-1
Expand Down Expand Up @@ -393,7 +393,7 @@ To add plugins to any ELK component you have to:

1. Add a `RUN` statement to the corresponding `Dockerfile` (eg. `RUN logstash-plugin install logstash-filter-json`)
1. Add the associated plugin code configuration to the service configuration (eg. Logstash input/output)
1. Rebuild the images using the `docker-compose build` command
1. Rebuild the images using the `docker compose build` command

### How to enable the provided extensions

Expand Down Expand Up @@ -471,7 +471,6 @@ See the following Wiki pages:
[docker-install]: https://docs.docker.com/get-docker/
[compose-install]: https://docs.docker.com/compose/install/
[compose-v2]: https://docs.docker.com/compose/compose-v2/
[linux-postinstall]: https://docs.docker.com/engine/install/linux-postinstall/
[bootstrap-checks]: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:

# The 'setup' service runs a one-off script which initializes users inside
Expand Down
2 changes: 1 addition & 1 deletion extensions/curator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ If you want to include the Curator extension, run Docker Compose from the root o
command line argument referencing the `curator-compose.yml` file:

```bash
$ docker-compose -f docker-compose.yml -f extensions/curator/curator-compose.yml up
$ docker compose -f docker-compose.yml -f extensions/curator/curator-compose.yml up
```

This sample setup demonstrates how to run `curator` every minute using `cron`.
Expand Down
2 changes: 0 additions & 2 deletions extensions/curator/curator-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
curator:
build:
Expand Down
4 changes: 2 additions & 2 deletions extensions/enterprise-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ To include Enterprise Search in the stack, run Docker Compose from the root of t
line argument referencing the `enterprise-search-compose.yml` file:

```console
$ docker-compose -f docker-compose.yml -f extensions/enterprise-search/enterprise-search-compose.yml up
$ docker compose -f docker-compose.yml -f extensions/enterprise-search/enterprise-search-compose.yml up
```

Allow a few minutes for the stack to start, then open your web browser at the address <http://localhost:3002> to see the
Expand Down Expand Up @@ -120,7 +120,7 @@ enterprise-search:
Any change to the Enterprise Search configuration requires a restart of the Enterprise Search container:

```console
$ docker-compose -f docker-compose.yml -f extensions/enterprise-search/enterprise-search-compose.yml restart enterprise-search
$ docker compose -f docker-compose.yml -f extensions/enterprise-search/enterprise-search-compose.yml restart enterprise-search
```

Please refer to the following documentation page for more details about how to configure Enterprise Search inside a
Expand Down
2 changes: 0 additions & 2 deletions extensions/enterprise-search/enterprise-search-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
enterprise-search:
build:
Expand Down
4 changes: 2 additions & 2 deletions extensions/filebeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To include Filebeat in the stack, run Docker Compose from the root of the reposi
argument referencing the `filebeat-compose.yml` file:

```console
$ docker-compose -f docker-compose.yml -f extensions/filebeat/filebeat-compose.yml up
$ docker compose -f docker-compose.yml -f extensions/filebeat/filebeat-compose.yml up
```

## Configuring Filebeat
Expand All @@ -25,7 +25,7 @@ the help of the [Configuration reference][filebeat-config].
Any change to the Filebeat configuration requires a restart of the Filebeat container:

```console
$ docker-compose -f docker-compose.yml -f extensions/filebeat/filebeat-compose.yml restart filebeat
$ docker compose -f docker-compose.yml -f extensions/filebeat/filebeat-compose.yml restart filebeat
```

Please refer to the following documentation page for more details about how to configure Filebeat inside a Docker
Expand Down
2 changes: 0 additions & 2 deletions extensions/filebeat/filebeat-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
filebeat:
build:
Expand Down
2 changes: 1 addition & 1 deletion extensions/fleet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To include Fleet Server in the stack, run Docker Compose from the root of the re
argument referencing the `fleet-compose.yml` file:

```console
$ docker-compose -f docker-compose.yml -f extensions/fleet/fleet-compose.yml up
$ docker compose -f docker-compose.yml -f extensions/fleet/fleet-compose.yml up
```

## Configuring Fleet Server
Expand Down
4 changes: 1 addition & 3 deletions extensions/fleet/agent-apmserver-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
version: '3.7'

# Example of Fleet-enrolled Elastic Agent pre-configured with an agent policy
# for running the APM Server integration (see kibana.yml).
#
# Run with
# docker-compose \
# docker compose \
# -f docker-compose.yml \
# -f extensions/fleet/fleet-compose.yml \
# -f extensions/fleet/agent-apmserver-compose.yml \
Expand Down
2 changes: 0 additions & 2 deletions extensions/fleet/fleet-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
fleet-server:
build:
Expand Down
4 changes: 2 additions & 2 deletions extensions/heartbeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To include Heartbeat in the stack, run Docker Compose from the root of the repos
argument referencing the `heartbeat-compose.yml` file:

```console
$ docker-compose -f docker-compose.yml -f extensions/heartbeat/heartbeat-compose.yml up
$ docker compose -f docker-compose.yml -f extensions/heartbeat/heartbeat-compose.yml up
```

## Configuring Heartbeat
Expand All @@ -24,7 +24,7 @@ with the help of the [Configuration reference][heartbeat-config].
Any change to the Heartbeat configuration requires a restart of the Heartbeat container:

```console
$ docker-compose -f docker-compose.yml -f extensions/heartbeat/heartbeat-compose.yml restart heartbeat
$ docker compose -f docker-compose.yml -f extensions/heartbeat/heartbeat-compose.yml restart heartbeat
```

Please refer to the following documentation page for more details about how to configure Heartbeat inside a
Expand Down
2 changes: 0 additions & 2 deletions extensions/heartbeat/heartbeat-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
heartbeat:
build:
Expand Down
4 changes: 2 additions & 2 deletions extensions/metricbeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To include Metricbeat in the stack, run Docker Compose from the root of the repo
argument referencing the `metricbeat-compose.yml` file:

```console
$ docker-compose -f docker-compose.yml -f extensions/metricbeat/metricbeat-compose.yml up
$ docker compose -f docker-compose.yml -f extensions/metricbeat/metricbeat-compose.yml up
```

## Configuring Metricbeat
Expand All @@ -25,7 +25,7 @@ with the help of the [Configuration reference][metricbeat-config].
Any change to the Metricbeat configuration requires a restart of the Metricbeat container:

```console
$ docker-compose -f docker-compose.yml -f extensions/metricbeat/metricbeat-compose.yml restart metricbeat
$ docker compose -f docker-compose.yml -f extensions/metricbeat/metricbeat-compose.yml restart metricbeat
```

Please refer to the following documentation page for more details about how to configure Metricbeat inside a
Expand Down
2 changes: 0 additions & 2 deletions extensions/metricbeat/metricbeat-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
metricbeat:
build:
Expand Down

0 comments on commit 24306fd

Please sign in to comment.