Добрый день! Есть два контейнера с медиавики, которые созданы командой docker compose ( см. под катом первый листинг )
Посоветуйте порядок действий, если мне нужно остановить контейтеры, потенциально изменить конфигурацию, и запустить их снова?
Сможет ли кто-то объяснить такое поведение ( смотри второй листинг ): В результате остановки и запуска контейнера с хешом 78882d4b4360 появляется новый контейнер с хешом 009ed3f3c1ed
Есть основной контейтер с Apache и PHP и зависимый c MariaDB, всё, как советует MediaWiki.
$ cat regional_docker_latest.yml
# MediaWiki with MariaDB
#
# Access via "http://localhost:8080"
# (or "http://$(docker-machine ip):8080" if using docker-machine)
version: '3'
services:
reg2:
image: mediawiki:latest
restart: always
ports:
- 8080:80
links:
- regdb
volumes:
- /var/www/html/images
# After initial setup, download LocalSettings.php to the same directory as
# this yaml and uncomment the following line and use compose to restart
# the mediawiki service
- ./LocalSettings(3).php:/var/www/html/LocalSettings.php
regdb2:
image: mariadb
restart: always
environment:
# @see https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/DefaultSettings.php
MYSQL_DATABASE: my_wiki
MYSQL_USER: wikiuser
MYSQL_PASSWORD: password
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
volumes:
- ./mysql2:/var/lib/mysql:rw
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
78882d4b4360 mediawiki:latest "docker-php-entrypoi…" 2 hours ago Up 2 hours 80/tcp reg2_reg2.1.b6snjpfvxnc4a39lu4esgzx1t
bd629330c991 mediawiki:latest "docker-php-entrypoi…" 2 weeks ago Up 2 weeks 80/tcp reg2_reg2.1.6pt4wgfnusimhx24wiu8fha4e
09da868f47be mariadb:latest "docker-entrypoint.s…" 2 weeks ago Up 2 weeks 3306/tcp reg2_regdb2.1.hwvzvzyvldb4ckaz7z7zyzxki
$ docker exec -it 78882d4b4360 bash
root@78882d4b4360:/var/www/html# stat /var/www/html/extensions/CreatedPagesList/extension.json
stat: cannot stat '/var/www/html/extensions/CreatedPagesList/extension.json': No such file or directory
root@78882d4b4360:/var/www/html# exit
exit
$ docker exec -it bd629330c991 bash
root@bd629330c991:/var/www/html# stat /var/www/html/extensions/CreatedPagesList/extension.json
File: /var/www/html/extensions/CreatedPagesList/extension.json
Size: 1411 Blocks: 8 IO Block: 4096 regular file
Device: 902h/2306d Inode: 3365284 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ UNKNOWN) Gid: ( 1000/ UNKNOWN)
Access: 2020-05-25 18:07:54.000000000 +0000
Modify: 2020-05-25 18:07:54.000000000 +0000
Change: 2020-09-21 15:08:38.280515316 +0000
Birth: -
root@bd629330c991:/var/www/html# exit
exit
$ docker stop 78882d4b4360
78882d4b4360
$ docker exec -it bd629330c991 bash
root@bd629330c991:/var/www/html# stat /var/www/html/extensions/CreatedPagesList/extension.json
File: /var/www/html/extensions/CreatedPagesList/extension.json
Size: 1411 Blocks: 8 IO Block: 4096 regular file
Device: 902h/2306d Inode: 3365284 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ UNKNOWN) Gid: ( 1000/ UNKNOWN)
Access: 2020-05-25 18:07:54.000000000 +0000
Modify: 2020-05-25 18:07:54.000000000 +0000
Change: 2020-09-21 15:08:38.280515316 +0000
Birth: -
root@bd629330c991:/var/www/html# exit
exit
$ docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
009ed3f3c1ed mediawiki:latest "docker-php-entrypoi…" 25 minutes ago Up 24 minutes 80/tcp reg2_reg2.1.8dm8mj3jipi30nh03m5yg878l
78882d4b4360 mediawiki:latest "docker-php-entrypoi…" 3 hours ago Exited (0) 25 minutes ago reg2_reg2.1.b6snjpfvxnc4a39lu4esgzx1t
6cd2ec9e8954 mediawiki:latest "docker-php-entrypoi…" 2 weeks ago Exited (0) 30 minutes ago reg2_reg2.1.ihvw4xa4zoa1ngr91g6sjnton
bd629330c991 mediawiki:latest "docker-php-entrypoi…" 2 weeks ago Up 2 weeks 80/tcp reg2_reg2.1.6pt4wgfnusimhx24wiu8fha4e
8e6f9fc78a8c mediawiki:latest "docker-php-entrypoi…" 2 weeks ago Exited (0) 2 weeks ago reg2_reg2.1.fjtihvn1nq1khfya2heqqppcq
09da868f47be mariadb:latest "docker-entrypoint.s…" 2 weeks ago Up 2 weeks 3306/tcp reg2_regdb2.1.hwvzvzyvldb4ckaz7z7zyzxki
4c7c7a5c8053 mariadb:latest "docker-entrypoint.s…" 2 weeks ago Exited (0) 2 weeks ago reg2_regdb2.1.xwjsekm65wbn0hnaqc880cbg0