Skip to content

Commit cff3186

Browse files
Run update.sh
1 parent bfd4e18 commit cff3186

File tree

2 files changed

+149
-4
lines changed

2 files changed

+149
-4
lines changed

node/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ WARNING:
3131
- [`6.14.2-onbuild`, `6.14-onbuild`, `6-onbuild`, `boron-onbuild` (*6/onbuild/Dockerfile*)](https://github.com/nodejs/docker-node/blob/11a62b615492325d4cbe4ebed29dc6813c6b6826/6/onbuild/Dockerfile)
3232
- [`6.14.2-slim`, `6.14-slim`, `6-slim`, `boron-slim` (*6/slim/Dockerfile*)](https://github.com/nodejs/docker-node/blob/947280600648b70e067d35415d6812fd03127def/6/slim/Dockerfile)
3333
- [`6.14.2-stretch`, `6.14-stretch`, `6-stretch`, `boron-stretch` (*6/stretch/Dockerfile*)](https://github.com/nodejs/docker-node/blob/947280600648b70e067d35415d6812fd03127def/6/stretch/Dockerfile)
34-
- [`10.3.0-jessie`, `10.3-jessie`, `10-jessie`, `jessie`, `10.3.0`, `10.3`, `10`, `latest` (*10/jessie/Dockerfile*)](https://github.com/nodejs/docker-node/blob/bbae51a013b0ebef90afcd6d2ea2ac49697d3823/10/jessie/Dockerfile)
35-
- [`10.3.0-alpine`, `10.3-alpine`, `10-alpine`, `alpine` (*10/alpine/Dockerfile*)](https://github.com/nodejs/docker-node/blob/bbae51a013b0ebef90afcd6d2ea2ac49697d3823/10/alpine/Dockerfile)
36-
- [`10.3.0-slim`, `10.3-slim`, `10-slim`, `slim` (*10/slim/Dockerfile*)](https://github.com/nodejs/docker-node/blob/bbae51a013b0ebef90afcd6d2ea2ac49697d3823/10/slim/Dockerfile)
37-
- [`10.3.0-stretch`, `10.3-stretch`, `10-stretch`, `stretch` (*10/stretch/Dockerfile*)](https://github.com/nodejs/docker-node/blob/bbae51a013b0ebef90afcd6d2ea2ac49697d3823/10/stretch/Dockerfile)
34+
- [`10.4.0-jessie`, `10.4-jessie`, `10-jessie`, `jessie`, `10.4.0`, `10.4`, `10`, `latest` (*10/jessie/Dockerfile*)](https://github.com/nodejs/docker-node/blob/8efaa064853a2f866481f162eb4e424c5ee8ac9e/10/jessie/Dockerfile)
35+
- [`10.4.0-alpine`, `10.4-alpine`, `10-alpine`, `alpine` (*10/alpine/Dockerfile*)](https://github.com/nodejs/docker-node/blob/8efaa064853a2f866481f162eb4e424c5ee8ac9e/10/alpine/Dockerfile)
36+
- [`10.4.0-slim`, `10.4-slim`, `10-slim`, `slim` (*10/slim/Dockerfile*)](https://github.com/nodejs/docker-node/blob/8efaa064853a2f866481f162eb4e424c5ee8ac9e/10/slim/Dockerfile)
37+
- [`10.4.0-stretch`, `10.4-stretch`, `10-stretch`, `stretch` (*10/stretch/Dockerfile*)](https://github.com/nodejs/docker-node/blob/8efaa064853a2f866481f162eb4e424c5ee8ac9e/10/stretch/Dockerfile)
3838
- [`chakracore-8.11.1`, `chakracore-8.11`, `chakracore-8` (*chakracore/8/Dockerfile*)](https://github.com/nodejs/docker-node/blob/947280600648b70e067d35415d6812fd03127def/chakracore/8/Dockerfile)
3939
- [`chakracore-10.1.0`, `chakracore-10.1`, `chakracore-10`, `chakracore` (*chakracore/10/Dockerfile*)](https://github.com/nodejs/docker-node/blob/384512d45794367e0da3c4721559ae9e9ce9412e/chakracore/10/Dockerfile)
4040

xwiki/README.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,142 @@ volumes:
241241
xwiki-data: {}
242242
```
243243

244+
### Using Docker Swarm
245+
246+
Here are some examples of using this image with Docker Swarm. These examples leverage additional features of Docker Swarm such as Docker secrets, and Docker configs. As such, these examples require Docker to be in swarm mode.
247+
248+
You can read more about these features and Docker swarm mode here:
249+
250+
- [Docker swarm mode](https://docs.docker.com/engine/swarm/)
251+
- [Creating Docker secrets](https://docs.docker.com/engine/reference/commandline/secret_create/)
252+
- [Creating Docker configs](https://docs.docker.com/engine/reference/commandline/config_create/)
253+
254+
#### MySQL Example
255+
256+
This example presupposes the existence of the Docker secrets `xwiki-db-username`, `xwiki-db-password` and `xwiki-db-root-password`, and the Docker config `xwiki-mysql-config`.
257+
258+
You can create these secrets and configs with the following:
259+
260+
- `echo ${MY_XWIKI_USER:-xwiki} | docker secret create xwiki-db-username -`
261+
- `echo $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) | docker secret create xwiki-db-password -`
262+
- `echo $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) | docker secret create xwiki-db-root-password -`
263+
- `docker config create xwiki-mysql-config /path/to/mysql/xwiki.cnf`
264+
265+
To deploy this example, save the following YAML as `xwiki-stack.yaml`, then run:
266+
267+
- `docker stack deploy -c xwiki-stack.yaml xwiki`
268+
269+
```yaml
270+
version: '3.3'
271+
services:
272+
web:
273+
image: "xwiki:mysql-tomcat"
274+
ports:
275+
- "8080:8080"
276+
environment:
277+
- DB_USER_FILE=/run/secrets/xwiki-db-username
278+
- DB_PASSWORD_FILE=/run/secrets/xwiki-db-password
279+
- DB_DATABASE=xwiki
280+
- DB_HOST=db
281+
volumes:
282+
- xwiki-data:/usr/local/xwiki
283+
secrets:
284+
- xwiki-db-username
285+
- xwiki-db-password
286+
db:
287+
image: "mysql:5.7"
288+
volumes:
289+
- mysql-data:/var/lib/mysql
290+
environment:
291+
- MYSQL_ROOT_PASSWORD=/run/secrets/xwiki-db-root-password
292+
- MYSQL_USER_FILE=/run/secrets/xwiki-db-username
293+
- MYSQL_PASSWORD_FILE=/run/secrets/xwiki-db-password
294+
- MYSQL_DATABASE=xwiki
295+
secrets:
296+
- xwiki-db-username
297+
- xwiki-db-password
298+
- xwiki-db-root-password
299+
configs:
300+
- source: mysql-config
301+
target: /etc/mysql/conf.d/xwiki.cnf
302+
volumes:
303+
mysql-data:
304+
xwiki-data:
305+
secrets:
306+
xwiki-db-username:
307+
external:
308+
name: xwiki-db-username
309+
xwiki-db-password:
310+
external:
311+
name: xwiki-db-password
312+
xwiki-db-root-password:
313+
external:
314+
name: xwiki-db-root-password
315+
configs:
316+
mysql-config:
317+
external:
318+
name: xwiki-mysql-config
319+
```
320+
321+
#### PostgreSQL Example
322+
323+
This example presupposes the existence of the Docker secrets `xwiki-db-username`, `xwiki-db-password`, and `xwiki-db-root-password`.
324+
325+
You can create these secrets with the following:
326+
327+
- `echo ${MY_XWIKI_USER:-xwiki} | docker secret create xwiki-db-username -`
328+
- `echo $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) | docker secret create xwiki-db-password -`
329+
- `echo $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) | docker secret create xwiki-db-root-password -`
330+
331+
To deploy this example, save the following YAML as `xwiki-stack.yaml` then run:
332+
333+
- `docker stack deploy -c xwiki-stack.yaml xwiki`
334+
335+
```yaml
336+
version: '3.3'
337+
services:
338+
web:
339+
image: "xwiki:mysql-postgres"
340+
ports:
341+
- "8080:8080"
342+
environment:
343+
- DB_USER_FILE=/run/secrets/xwiki-db-username
344+
- DB_PASSWORD_FILE=/run/secrets/xwiki-db-password
345+
- DB_DATABASE=xwiki
346+
- DB_HOST=db
347+
volumes:
348+
- xwiki-data:/usr/local/xwiki
349+
secrets:
350+
- xwiki-db-username
351+
- xwiki-db-password
352+
db:
353+
image: "postgres:9.5"
354+
volumes:
355+
- postgres-data:/var/lib/postgresql/data
356+
environment:
357+
- POSTGRES_ROOT_PASSWORD_FILE=/run/secrets/xwiki-db-root-password
358+
- POSTGRES_USER_FILE=/run/secrets/xwiki-db-username
359+
- POSTGRES_PASSWORD_FILE=/run/secrets/xwiki-db-password
360+
- POSTGRES_DB=xwiki
361+
secrets:
362+
- xwiki-db-username
363+
- xwiki-db-password
364+
- xwiki-db-root-password
365+
volumes:
366+
postgres-data:
367+
xwiki-data:
368+
secrets:
369+
xwiki-db-username:
370+
external:
371+
name: xwiki-db-username
372+
xwiki-db-password:
373+
external:
374+
name: xwiki-db-password
375+
xwiki-db-root-password:
376+
external:
377+
name: xwiki-db-root-password
378+
```
379+
244380
## Building
245381

246382
This allows you to rebuild the XWiki docker image locally. Here are the steps:
@@ -280,6 +416,15 @@ The first time you create a container out of the xwiki image, a shell script (`/
280416
- `DB_DATABASE`: The name of the XWiki database to use/create.
281417
- `DB_HOST`: The name of the host (or docker container) containing the database. Default is "db".
282418

419+
In order to support [Docker secrets](https://docs.docker.com/engine/swarm/secrets/), the configuration values can also be given to the container as files containing that value.
420+
421+
- `DB_USER_FILE`: The location, inside the container, of a file containing the value for `DB_USER`
422+
- `DB_PASSWORD_FILE`: The location, inside the container, of a file containing the value for `DB_PASSWORD`
423+
- `DB_DATABASE_FILE`: The location, inside the container, of a file containing the value for `DB_DATABASE`
424+
- `DB_HOST_FILE`: The location, inside the container, of a file containing the value for `DB_HOST`
425+
426+
*Note:* For each configuration value, the normal environment variable and \_FILE environment variable are mutually exclusive. Providing values for both variables will result in an error.
427+
283428
The main XWiki configuration files (`xwiki.cfg`, `xwiki.properties` and `hibernate.cfg.xml`) are available in the mapped local directory for the permanent directory on your host.
284429

285430
If you need to perform some advanced configuration, you can execute another container and attach to the running XWiki container by issuing (but note that these won't be saved if you remove the container):

0 commit comments

Comments
 (0)