Skip to content

Commit 15e3853

Browse files
committed
Convert all stack.yml to compose.yaml
Docker Swarm Mode has been in severely declining usage and maintenance for years now. Meanwhile, Docker Compose has had quite a lot of changes (notably deprecating the `version:` field required by Swarm / forward compatibility). As a result, it no longer makes a ton of sense for us to prefer/suggest Swarm usages. This changes all references to be `compose.yaml` (the upstream-preferred canonical filename: https://github.com/compose-spec/compose-go/blob/9a9cc5d9c3453326bb8d506259bcfccd68af110b/cli/options.go#L384-L385) directly, leaving "swarm compatibility" as an exercise for the minority of readers who might still need/want it. Unfortunately, this also means we need to remove all the play-with-docker links (since it only supports stack deploy via URL arguments, not compose), but my experience with that service is that it hasn't been terribly performant for a while, so I don't think this is a huge loss. (There were also a few trailing references to the long-since-defunct Docker Machine project which have also been cleaned up.)
1 parent affef21 commit 15e3853

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+97
-175
lines changed

.ci/check-ymlfmt.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -Eeuo pipefail
33

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

6-
files="$(find -name '*.yml' -not -path './.github/*')"
6+
files="$(find '(' -name '*.yml' -o -name '*.yaml' ')' -not -path './.github/*')"
77
need=()
88
needdiff=
99
for f in $files; do

.template-helpers/compose.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
... via [`docker-compose`](https://github.com/docker/compose)
1+
... via [`docker compose`](https://github.com/docker/compose)
22

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

5-
%%COMPOSE-YML%%
5+
%%COMPOSE-YAML%%

.template-helpers/stack.md

-7
This file was deleted.

README.md

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

149149
> Go (golang) is a general purpose, higher-level, imperative programming language.
150150
151-
## `stack.yml`
151+
## `compose.yaml`
152152

153-
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/).
153+
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.
154154

155-
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.
155+
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.
156156

157157
# Files for main Docs repo
158158

adminer/stack.yml renamed to adminer/compose.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Use root/example as user/password credentials
22

3-
version: '3.1'
4-
53
services:
64

75
adminer:

adminer/content.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ Then point your web server to port 9000 of the container.
3030

3131
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.
3232

33-
### %%STACK%%
33+
### %%COMPOSE%%
3434

35-
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).
35+
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).
3636

3737
### Loading plugins
3838

backdrop/compose.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
services:
2+
backdrop:
3+
image: backdrop
4+
links:
5+
- db:mysql
6+
ports:
7+
- 8080:80
8+
9+
db:
10+
image: mysql
11+
environment:
12+
MYSQL_USER: backdrop
13+
MYSQL_PASSWORD: backdrop
14+
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
15+
MYSQL_DATABASE: backdrop

backdrop/content.md

+1-20
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,7 @@ $ docker run --name some-%%REPO%% \
4444
-d %%REPO%%
4545
```
4646

47-
## ... via [Docker Compose](https://github.com/docker/compose)
48-
49-
Example `compose.yaml` for `%%REPO%%`:
50-
51-
```yaml
52-
%%REPO%%:
53-
image: %%REPO%%
54-
links:
55-
- db:mysql
56-
ports:
57-
- 8080:80
58-
59-
db:
60-
image: mysql
61-
environment:
62-
MYSQL_USER: %%REPO%%
63-
MYSQL_PASSWORD: %%REPO%%
64-
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
65-
MYSQL_DATABASE: %%REPO%%
66-
```
47+
## %%COMPOSE%%
6748

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

File renamed without changes.

bonita/content.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ docker run --name mydbpostgres -h <hostname> -d bonitasoft/bonita-postgres:16.4
3636

3737
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.
3838

39-
## %%STACK%%
39+
## %%COMPOSE%%
4040

41-
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).
41+
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).
4242

4343
- Replace `<hostname>` with the one used in the licence generation command
4444
- leave double `$$` untouched

drupal/stack.yml renamed to drupal/compose.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Drupal with PostgreSQL
22
#
33
# Access via "http://localhost:8080"
4-
# (or "http://$(docker-machine ip):8080" if using docker-machine)
54
#
65
# During initial Drupal setup,
76
# Database type: PostgreSQL
@@ -10,8 +9,6 @@
109
# Database password: example
1110
# ADVANCED OPTIONS; Database host: postgres
1211

13-
version: '3.1'
14-
1512
services:
1613

1714
drupal:

drupal/content.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ $ docker run --name some-%%REPO%% --network some-network -d \
9898
%%IMAGE%%
9999
```
100100

101-
## %%STACK%%
101+
## %%COMPOSE%%
102102

103-
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`
103+
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`
104104

105105
## Adding additional libraries / extensions
106106

elasticsearch/stack.yml renamed to elasticsearch/compose.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.1'
2-
31
services:
42

53
elasticsearch:

friendica/stack.yml renamed to friendica/compose.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.2'
2-
31
services:
42
db:
53
image: mariadb

friendica/content.md

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ The `apache` tag contains a full Friendica installation including an apache web
1212

1313
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.
1414

15-
[![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]`)
16-
1715
## Using the apache image
1816

1917
You need at least one other mariadb/mysql-container to link it to Friendica.

geonetwork/stack.yml renamed to geonetwork/compose.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# GeoNetwork
22
#
3-
# Access via "http://localhost:8080/geonetwork" (or "http://$(docker-machine ip):8080/geonetwork" if using docker-machine)
3+
# Access via "http://localhost:8080/geonetwork"
44
#
55
# Default user: admin
66
# Default password: admin
77

8-
version: '3.8'
9-
108
volumes:
119
geonetwork:
1210
esdata:

geonetwork/content.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ GeoNetwork listens on port `8080`. If you want to access the container at the ho
118118
docker run --name some-%%REPO%% -d -p 8080:8080 %%IMAGE%%
119119
```
120120

121-
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.
121+
Then, if you are running docker on Linux, you may access geonetwork at http://localhost:8080/geonetwork.
122122

123123
### Set the data directory and H2 db file
124124

@@ -162,9 +162,9 @@ docker run --name some-%%REPO%% -d -p 8080:8080 -e DATA_DIR=/catalogue-data/data
162162
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%%
163163
```
164164

165-
### %%STACK%%
165+
### %%COMPOSE%%
166166

167-
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).
167+
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080/geonetwork` or `http://host-ip:8080/geonetwork` (as appropriate).
168168

169169
### Default credentials
170170

ghost/stack.yml renamed to ghost/compose.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.1'
2-
31
services:
42

53
ghost:

ghost/content.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ All Ghost configuration parameters (such as `url`) can be specified via environm
6868
$ docker run -d --name some-ghost -e NODE_ENV=development -e url=http://some-ghost.example.com %%IMAGE%%
6969
```
7070

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

7373
## What is the Node.js version?
7474

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

9090
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).
9191

92-
## %%STACK%%
92+
## %%COMPOSE%%
9393

94-
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).
94+
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.

joomla/content.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ $ docker run --name some-%%REPO%% --network some-network -e JOOMLA_DB_HOST=10.1.
5050
-e JOOMLA_DB_USER=... -e JOOMLA_DB_PASSWORD=... -d %%IMAGE%%
5151
```
5252

53-
## %%STACK%%
53+
## %%COMPOSE%%
5454

55-
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).
55+
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).
5656

5757
## Adding additional libraries / extensions
5858

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.1'
2-
31
services:
42

53
kibana:
@@ -9,4 +7,3 @@ services:
97

108
elasticsearch:
119
image: elasticsearch
12-

krakend/content.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,9 @@ The configuration above assumes you have a folder structure like the following:
108108

109109
### Docker Compose example
110110

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

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

126125
```yaml
127-
version: "3"
128126
services:
129127
krakend:
130128
image: %%IMAGE%%:<version>

mariadb/stack.yml renamed to mariadb/compose.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Use root/example as user/password credentials
2-
version: '3.1'
32

43
services:
54

mariadb/content.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ $ docker run --detach --name some-%%REPO%% --env MARIADB_RANDOM_ROOT_PASSWORD=1
3434

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

37-
## %%STACK%%
37+
## %%COMPOSE%%
3838

39-
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).
39+
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).
4040

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

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

209209
## No connections until MariaDB init completes
210210

211-
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.
211+
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.
212212

213213
## Health/Liveness/Readiness Checking
214214

mediawiki/stack.yml renamed to mediawiki/compose.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# MediaWiki with MariaDB
22
#
33
# Access via "http://localhost:8080"
4-
# (or "http://$(docker-machine ip):8080" if using docker-machine)
54
services:
65
mediawiki:
76
image: mediawiki

mediawiki/content.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ The paths `/var/www/html/images` and `/var/www/html/LocalSettings.php` are thing
4646
$ docker run --rm %%IMAGE%% tar -cC /var/www/html/sites . | tar -xC /path/on/host/sites
4747
```
4848

49-
## %%STACK%%
49+
## %%COMPOSE%%
5050

51-
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).
51+
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).
5252

5353
## Adding additional libraries / extensions
5454

mongo-express/content.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ $ docker run -it --rm \
6464
%%IMAGE%%
6565
```
6666

67-
This example links to a container name typical of `docker-compose`, changes the editor's color theme, and enables basic authentication.
67+
This example links to a container name typical of `docker compose`, changes the editor's color theme, and enables basic authentication.

mongo/stack.yml renamed to mongo/compose.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Use root/example as user/password credentials
2-
version: '3.1'
32

43
services:
54

mongo/content.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ $ docker run -it --network some-network --rm %%IMAGE%% mongosh --host some-%%REP
3232

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

35-
## %%STACK%%
35+
## %%COMPOSE%%
3636

37-
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).
37+
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8081` or `http://host-ip:8081` (as appropriate).
3838

3939
## Container shell access and viewing MongoDB logs
4040

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

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

6767
```yaml
68-
version: '3.1'
6968
services:
7069
mongo:
7170
image: %%IMAGE%%

mysql/stack.yml renamed to mysql/compose.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Use root/example as user/password credentials
2-
version: '3.1'
32

43
services:
54

mysql/content.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ $ docker run -it --rm %%IMAGE%% mysql -hsome.mysql.host -usome-mysql-user -p
3636

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

39-
## %%STACK%%
39+
## %%COMPOSE%%
4040

41-
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).
41+
Run `docker compose up`, wait for it to initialize completely, and visit `http://localhost:8080` or `http://host-ip:8080` (as appropriate).
4242

4343
## Container shell access and viewing MySQL logs
4444

0 commit comments

Comments
 (0)