Skip to content

Commit 78dce8e

Browse files
authored
Merge pull request docker-library#941 from marcosnils/stacks
Migrate current compose examples to PWD capable stacks
2 parents 00e9fb6 + c4be9bb commit 78dce8e

File tree

19 files changed

+122
-21
lines changed

19 files changed

+122
-21
lines changed

adminer/content.md

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ 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%%
34+
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).
36+
3337
### Loading plugins
3438

3539
This image bundles all official adminer plugins. You can find the list of plugins on GitHub: https://github.com/vrana/adminer/tree/master/plugins.

adminer/stack.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Use root/example as user/password credentials
2+
3+
version: '3.1'
4+
5+
services:
6+
7+
adminer:
8+
image: adminer
9+
ports:
10+
- 8080:8080
11+
12+
db:
13+
image: mysql:5.6
14+
environment:
15+
MYSQL_ROOT_PASSWORD: example

drupal/content.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ $ docker run --name some-%%REPO%% --link some-postgres:postgres -d \
8181
-v %%REPO%%-themes:/var/www/html/themes \
8282
```
8383

84-
## %%COMPOSE%%
84+
## %%STACK%%
85+
86+
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`
8587

8688
## Adding additional libraries / extensions
8789

drupal/docker-compose.yml renamed to drupal/stack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Database password: example
1111
# ADVANCED OPTIONS; Database host: postgres
1212

13-
version: '2'
13+
version: '3.1'
1414

1515
services:
1616

elasticsearch/content.md

+4
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,7 @@ $ docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data elasticsearch
6060
```
6161

6262
This image includes `EXPOSE 9200 9300` ([default `http.port`](http://www.elastic.co/guide/en/elasticsearch/reference/1.5/modules-http.html)), so standard container linking will make it automatically available to the linked containers.
63+
64+
## %%STACK%%
65+
66+
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:5601`, `http://localhost:5601`, or `http://host-ip:5601` (as appropriate).

elasticsearch/stack.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3.1'
2+
3+
services:
4+
5+
elasticsearch:
6+
image: elasticsearch
7+
8+
kibana:
9+
image: kibana
10+
ports:
11+
- 5601:5601

geonetwork/content.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ If you want the data directory to live beyond restarts, or even destruction of t
5252
$ docker run --name some-%%REPO%% -d -p 8080:8080 -e DATA_DIR=/var/lib/geonetwork_data -v /host/geonetwork-docker:/var/lib/geonetwork_data %%REPO%%
5353
```
5454

55-
## %%COMPOSE%%
55+
## %%STACK%%
5656

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

5959
## Default credentials
6060

geonetwork/docker-compose.yml renamed to geonetwork/stack.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Default user: admin
66
# Default password: admin
77

8-
version: '2'
8+
version: '3.1'
99
services:
1010

1111
geonetwork:
@@ -15,4 +15,8 @@ services:
1515
environment:
1616
DATA_DIR: /var/lib/geonetwork_data
1717
volumes:
18-
- "/host/geonetwork-docker:/var/lib/geonetwork_data"
18+
- geonetwork:/var/lib/geonetwork_data
19+
20+
volumes:
21+
geonetwork:
22+

joomla/content.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ $ docker run --name some-%%REPO%% -e JOOMLA_DB_HOST=10.1.2.3:3306 \
3636
-e JOOMLA_DB_USER=... -e JOOMLA_DB_PASSWORD=... -d %%REPO%%
3737
```
3838

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

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

4343
## Adding additional libraries / extensions
4444

joomla/docker-compose.yml

-11
This file was deleted.

joomla/stack.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '3.1'
2+
3+
services:
4+
joomla:
5+
image: joomla
6+
links:
7+
- joomladb:mysql
8+
ports:
9+
- 8080:80
10+
environment:
11+
JOOMLA_DB_HOST: joomladb
12+
JOOMLA_DB_PASSWORD: example
13+
14+
joomladb:
15+
image: mysql:5.6
16+
environment:
17+
MYSQL_ROOT_PASSWORD: example

kibana/content.md

+4
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ $ docker run --name some-kibana -e ELASTICSEARCH_URL=http://some-elasticsearch:9
3535
```
3636

3737
Then, access it via `http://localhost:5601` or `http://host-ip:5601` in a browser.
38+
39+
## %%STACK%%
40+
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:5601`, `http://localhost:5601`, or `http://host-ip:5601` (as appropriate).

kibana/stack.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3.1'
2+
3+
services:
4+
5+
kibana:
6+
image: kibana
7+
ports:
8+
- 5601:5601
9+
10+
elasticsearch:
11+
image: elasticsearch
12+

mysql/content.md

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ $ docker run -it --rm %%REPO%% mysql -hsome.mysql.host -usome-mysql-user -p
4444

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

47+
## %%STACK%%
48+
49+
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).
50+
4751
## Container shell access and viewing MySQL logs
4852

4953
The `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `%%REPO%%` container:

mysql/stack.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Use root/example as user/password credentials
2+
version: '3.1'
3+
4+
services:
5+
6+
db:
7+
image: mysql
8+
environment:
9+
MYSQL_ROOT_PASSWORD: example
10+
11+
adminer:
12+
image: adminer
13+
ports:
14+
- 8080:8080
15+

owncloud/content.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@ The [`occ` tool from upstream](https://doc.owncloud.org/server/9.0/admin_manual/
4444
$ docker exec -u www-data some-owncloud php occ status
4545
```
4646

47-
## %%COMPOSE%%
47+
## %%STACK%%
48+
49+
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).

owncloud/docker-compose.yml renamed to owncloud/stack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Database name: pick any name
99
# Database host: replace "localhost" with "mysql"
1010

11-
version: '2'
11+
version: '3.1'
1212

1313
services:
1414

postgres/content.md

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ postgres=# SELECT 1;
4242

4343
```
4444

45+
## %%STACK%%
46+
47+
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).
48+
4549
## Environment Variables
4650

4751
The PostgreSQL image uses several environment variables which are easy to miss. While none of the variables are required, they may significantly aid you in using the image.

postgres/stack.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Use postgres/example user/password credentials
2+
version: '3.1'
3+
4+
services:
5+
6+
db:
7+
image: postgres
8+
environment:
9+
POSTGRES_PASSWORD: example
10+
11+
adminer:
12+
image: adminer
13+
ports:
14+
- 8080:8080

0 commit comments

Comments
 (0)