You can preserve plugins between container recreations by adding additional data volumes to keep them. Since spawning docker containers without docker-compose
is a pain, let me use it for further explanation.
1. Create docker-compose.yml
describing your setup
It should create two services (one for each of MySQL and Redmine) in a separate bridged network:
version: '2'
networks:
redmine-network:
volumes:
redmine-plugins:
redmine-themes:
redmine-data:
services:
mysql-for-redmine:
image: mysql:5.6
networks:
- redmine-network
volumes:
# Consider using separate volume containers
# instead of host directory mounts.
- /my/custom:/etc/mysql/conf.d
- /storage/mysql/datadir:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "<india>"
MYSQL_DATABASE: "redmine"
redmine:
image: redmine:3.3-passenger
ports:
- 3000:3000
networks:
- redmine-network
volumes:
- redmine-plugins:/usr/src/redmine/plugins
- redmine-themes:/usr/src/redmine/public/themes
- redmine-data:/usr/src/redmine/files
environment:
# Host name matches the MySQL container name.
REDMINE_DB_MYSQL: "mysql-for-redmine"
REDMINE_DB_USERNAME: "root"
REDMINE_DB_PASSWORD: "<india>"
REDMINE_SECRET_KEY_BASE: "..."
restart: always
2. Deploy your config
Simply run docker-compose up -d
from the directory where you put your configuration file.
3. Install your plugins (and themes) manually
Find the name of the container running Redmine with docker ps
; on my system it's root_redmine_1
. Run the following to attach into it:
# docker exec -ti root_redmine_1 gosu redmine bash
It will open a shell for "redmine" user inside the container. Use wget
and tar xjf
to download and extract plugins you need. Exit the shell when it's done.
4. Restart your instance to check if plugins work
Cast docker restart root_redmine_1
command and see if it's working as supposed. Since the plugins are put on a separate data volume, they should survive container recreation as well.