Skip to content

Convert all stack.yml to compose.yaml #2566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/check-ymlfmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -Eeuo pipefail

cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.."

files="$(find -name '*.yml' -not -path './.github/*')"
files="$(find '(' -name '*.yml' -o -name '*.yaml' ')' -not -path './.github/*')"
need=()
needdiff=
for f in $files; do
Expand Down
6 changes: 3 additions & 3 deletions .template-helpers/compose.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
... via [`docker-compose`](https://github.com/docker/compose)
... via [`docker compose`](https://github.com/docker/compose)

Example `docker-compose.yml` for `%%REPO%%`:
Example `compose.yaml` for `%%REPO%%`:

%%COMPOSE-YML%%
%%COMPOSE-YAML%%
7 changes: 0 additions & 7 deletions .template-helpers/stack.md

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ All Markdown files here are run through [tianon's fork of `markdownfmt`](https:/
8. [`maintainer.md`](#maintainermd)
9. [`metadata.json`](#metadatajson)
10. [`README-short.txt`](#readme-shorttxt)
11. [`stack.yml`](#stackyml)
11. [`compose.yaml`](#composeyaml)
5. [Files for main Docs repo](#files-for-main-docs-repo)
1. [`update.sh`](#updatesh)
2. [`markdownfmt.sh` and `ymlfmt.sh`](#markdownfmtsh-and-ymlfmtsh)
Expand Down Expand Up @@ -148,11 +148,11 @@ This is the short description for the Docker Hub, limited to 100 characters in a

> Go (golang) is a general purpose, higher-level, imperative programming language.

## `stack.yml`
## `compose.yaml`

This optional file contains a small, working [Compose file for Docker Swarm](https://docs.docker.com/compose/compose-file/compose-file-v3/) showing off how to use the image. To use the `stack.yml`, add `%%STACK%%` to the `content.md` and this will embed the YAML along with a link to directly try it in [Play with Docker](https://labs.play-with-docker.com/).
This optional file contains a small, working [Compose file](https://docs.docker.com/reference/compose-file/) showing off how to use the image. To use the `compose.yaml`, add `%%COMPOSE%%` to the `content.md` and this will embed the YAML.

The file must work via `docker stack deploy` since that is how Play with Docker will launch it, but it is helpful for users to try locally if it works for `docker-compose` as well. Other official images may be referenced within the YAML to demonstrate the functionality of the image, but no images external to the Docker Official Images program may be referenced.
Other official images may be referenced within the YAML to demonstrate the functionality of the image, but no images external to the Docker Official Images program may be referenced.

# Files for main Docs repo

Expand Down
2 changes: 0 additions & 2 deletions adminer/stack.yml → adminer/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Use root/example as user/password credentials

version: '3.1'

services:

adminer:
Expand Down
4 changes: 2 additions & 2 deletions adminer/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Then point your web server to port 9000 of the container.

Note: This exposes the FastCGI socket to the Internet. Make sure to add proper firewall rules or use a private Docker network instead to prevent a direct access.

### %%STACK%%
### %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker-compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate).
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).

### Loading plugins

Expand Down
15 changes: 15 additions & 0 deletions backdrop/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
backdrop:
image: backdrop
links:
- db:mysql
ports:
- 8080:80

db:
image: mysql
environment:
MYSQL_USER: backdrop
MYSQL_PASSWORD: backdrop
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: backdrop
21 changes: 1 addition & 20 deletions backdrop/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,7 @@ $ docker run --name some-%%REPO%% \
-d %%REPO%%
```

## ... via [Docker Compose](https://github.com/docker/compose)

Example `compose.yaml` for `%%REPO%%`:

```yaml
%%REPO%%:
image: %%REPO%%
links:
- db:mysql
ports:
- 8080:80

db:
image: mysql
environment:
MYSQL_USER: %%REPO%%
MYSQL_PASSWORD: %%REPO%%
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: %%REPO%%
```
## %%COMPOSE%%

Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080`.

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions bonita/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ docker run --name mydbpostgres -h <hostname> -d bonitasoft/bonita-postgres:16.4

This image is built from the following [GitHub repository](https://github.com/Bonitasoft-Community/bonita-database-docker/tree/main/postgres/16), which can be further adapted/customized to suit your needs.

## %%STACK%%
## %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate).
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).

- Replace `<hostname>` with the one used in the licence generation command
- leave double `$$` untouched
Expand Down
3 changes: 0 additions & 3 deletions drupal/stack.yml → drupal/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Drupal with PostgreSQL
#
# Access via "http://localhost:8080"
# (or "http://$(docker-machine ip):8080" if using docker-machine)
#
# During initial Drupal setup,
# Database type: PostgreSQL
Expand All @@ -10,8 +9,6 @@
# Database password: example
# ADVANCED OPTIONS; Database host: postgres

version: '3.1'

services:

drupal:
Expand Down
4 changes: 2 additions & 2 deletions drupal/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ $ docker run --name some-%%REPO%% --network some-network -d \
%%IMAGE%%
```

## %%STACK%%
## %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate). When installing select `postgres` as database with the following parameters: `dbname=postgres` `user=postgres` `pass=example` `hostname=postgres`
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate). When installing select `postgres` as database with the following parameters: `dbname=postgres` `user=postgres` `pass=example` `hostname=postgres`

## Adding additional libraries / extensions

Expand Down
2 changes: 0 additions & 2 deletions elasticsearch/stack.yml → elasticsearch/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.1'

services:

elasticsearch:
Expand Down
2 changes: 0 additions & 2 deletions friendica/stack.yml → friendica/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.2'

services:
db:
image: mariadb
Expand Down
2 changes: 0 additions & 2 deletions friendica/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ The `apache` tag contains a full Friendica installation including an apache web

The second option is a `fpm` container. It is based on the [php-fpm](https://hub.docker.com/_/php/) image and runs a fastCGI-Process that serves your Friendica server. To use this image it must be combined with any Webserver that can proxy the http requests to the FastCGI-port of the container.

[![Try in PWD](https://github.com/play-with-docker/stacks/raw/cff22438cb4195ace27f9b15784bbb497047afa7/assets/images/button.png)](http://play-with-docker.com?stack=%%STACK-URL%%) (Admin-E-Mail: `[email protected]`)

## Using the apache image

You need at least one other mariadb/mysql-container to link it to Friendica.
Expand Down
4 changes: 1 addition & 3 deletions geonetwork/stack.yml → geonetwork/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# GeoNetwork
#
# Access via "http://localhost:8080/geonetwork" (or "http://$(docker-machine ip):8080/geonetwork" if using docker-machine)
# Access via "http://localhost:8080/geonetwork"
#
# Default user: admin
# Default password: admin

version: '3.8'

volumes:
geonetwork:
esdata:
Expand Down
6 changes: 3 additions & 3 deletions geonetwork/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ GeoNetwork listens on port `8080`. If you want to access the container at the ho
docker run --name some-%%REPO%% -d -p 8080:8080 %%IMAGE%%
```

Then, if you are running docker on Linux, you may access geonetwork at http://localhost:8080/geonetwork. Otherwise, replace `localhost` by the address of your docker machine.
Then, if you are running docker on Linux, you may access geonetwork at http://localhost:8080/geonetwork.

### Set the data directory and H2 db file

Expand Down Expand Up @@ -162,9 +162,9 @@ docker run --name some-%%REPO%% -d -p 8080:8080 -e DATA_DIR=/catalogue-data/data
docker run --name some-%%REPO%% -d -p 8080:8080 -e GN_CONFIG_PROPERTIES="-Dgeonetwork.dir=/catalogue-data" -e GEONETWORK_DB_NAME=/catalogue-data/db/gn -v /host/%%REPO%%-docker:/catalogue-data %%IMAGE%%
```

### %%STACK%%
### %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080/geonetwork`, `http://localhost:8080/geonetwork`, or `http://host-ip:8080/geonetwork` (as appropriate).
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080/geonetwork` or `http://host-ip:8080/geonetwork` (as appropriate).

### Default credentials

Expand Down
2 changes: 0 additions & 2 deletions ghost/stack.yml → ghost/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.1'

services:

ghost:
Expand Down
6 changes: 3 additions & 3 deletions ghost/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ All Ghost configuration parameters (such as `url`) can be specified via environm
$ docker run -d --name some-ghost -e NODE_ENV=development -e url=http://some-ghost.example.com %%IMAGE%%
```

(There are further configuration examples in the `stack.yml` listed below.)
(There are further configuration examples in the `compose.yaml` listed below.)

## What is the Node.js version?

Expand All @@ -89,6 +89,6 @@ To run Ghost for production you'll also need to be running with MySQL 8, https,

The following example demonstrates some of the necessary configuration for running with MySQL. For more detail, see [Ghost's "Configuration options" documentation](https://ghost.org/docs/config/#configuration-options).

## %%STACK%%
## %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate).
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).
File renamed without changes.
4 changes: 2 additions & 2 deletions joomla/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ $ docker run --name some-%%REPO%% --network some-network -e JOOMLA_DB_HOST=10.1.
-e JOOMLA_DB_USER=... -e JOOMLA_DB_PASSWORD=... -d %%IMAGE%%
```

## %%STACK%%
## %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate).
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).

## Adding additional libraries / extensions

Expand Down
3 changes: 0 additions & 3 deletions kibana/stack.yml → kibana/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.1'

services:

kibana:
Expand All @@ -9,4 +7,3 @@ services:

elasticsearch:
image: elasticsearch

4 changes: 1 addition & 3 deletions krakend/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ The configuration above assumes you have a folder structure like the following:

### Docker Compose example

Finally, a simple `docker-compose` file to start KrakenD with your API would be:
Finally, a simple `docker compose` file to start KrakenD with your API would be:

```yaml
version: "3"
services:
krakend:
image: %%IMAGE%%:<version>
Expand All @@ -124,7 +123,6 @@ services:
And another one that uses the flexible configuration and a custom template filename (`my_krakend.tmpl`) on each start:

```yaml
version: "3"
services:
krakend:
image: %%IMAGE%%:<version>
Expand Down
1 change: 0 additions & 1 deletion mariadb/stack.yml → mariadb/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use root/example as user/password credentials
version: '3.1'

services:

Expand Down
6 changes: 3 additions & 3 deletions mariadb/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ $ docker run --detach --name some-%%REPO%% --env MARIADB_RANDOM_ROOT_PASSWORD=1

... where the container logs will contain the generated root password.

## %%STACK%%
## %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker-compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate).
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).

### Start a `%%IMAGE%%` server instance with user, password and database

Expand Down Expand Up @@ -208,7 +208,7 @@ The `-v /my/own/datadir:/var/lib/mysql:Z` part of the command mounts the `/my/ow

## No connections until MariaDB init completes

If there is no database initialized when the container starts, then a default database will be created. While this is the expected behavior, this means that it will not accept incoming connections until such initialization completes. This may cause issues when using automation tools, such as `docker-compose`, which start several containers simultaneously.
If there is no database initialized when the container starts, then a default database will be created. While this is the expected behavior, this means that it will not accept incoming connections until such initialization completes. This may cause issues when using automation tools, such as `docker compose`, which start several containers simultaneously.

## Health/Liveness/Readiness Checking

Expand Down
1 change: 0 additions & 1 deletion mediawiki/stack.yml → mediawiki/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# MediaWiki with MariaDB
#
# Access via "http://localhost:8080"
# (or "http://$(docker-machine ip):8080" if using docker-machine)
services:
mediawiki:
image: mediawiki
Expand Down
4 changes: 2 additions & 2 deletions mediawiki/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ The paths `/var/www/html/images` and `/var/www/html/LocalSettings.php` are thing
$ docker run --rm %%IMAGE%% tar -cC /var/www/html/sites . | tar -xC /path/on/host/sites
```

## %%STACK%%
## %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate).
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).

## Adding additional libraries / extensions

Expand Down
2 changes: 1 addition & 1 deletion mongo-express/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ $ docker run -it --rm \
%%IMAGE%%
```

This example links to a container name typical of `docker-compose`, changes the editor's color theme, and enables basic authentication.
This example links to a container name typical of `docker compose`, changes the editor's color theme, and enables basic authentication.
1 change: 0 additions & 1 deletion mongo/stack.yml → mongo/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use root/example as user/password credentials
version: '3.1'

services:

Expand Down
7 changes: 3 additions & 4 deletions mongo/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ $ docker run -it --network some-network --rm %%IMAGE%% mongosh --host some-%%REP

... where `some-%%REPO%%` is the name of your original `mongo` container.

## %%STACK%%
## %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker-compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8081`, `http://localhost:8081`, or `http://host-ip:8081` (as appropriate).
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8081` or `http://host-ip:8081` (as appropriate).

## Container shell access and viewing MongoDB logs

Expand Down Expand Up @@ -62,10 +62,9 @@ Most MongoDB configuration can be set through flags to `mongod`. The entrypoint
$ docker run --name some-%%REPO%% -d %%IMAGE%% --serviceExecutor adaptive
```

And here is the same with a `docker-compose.yml` file
And here is the same with a `compose.yaml` file

```yaml
version: '3.1'
services:
mongo:
image: %%IMAGE%%
Expand Down
1 change: 0 additions & 1 deletion mysql/stack.yml → mysql/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Use root/example as user/password credentials
version: '3.1'

services:

Expand Down
4 changes: 2 additions & 2 deletions mysql/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ $ docker run -it --rm %%IMAGE%% mysql -hsome.mysql.host -usome-mysql-user -p

More information about the MySQL command line client can be found in the [MySQL documentation](http://dev.mysql.com/doc/en/mysql.html)

## %%STACK%%
## %%COMPOSE%%

Run `docker stack deploy -c stack.yml %%REPO%%` (or `docker compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate).
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).

## Container shell access and viewing MySQL logs

Expand Down
Loading