一、安装docker
(1)查看内核版本
uname -r
(2)更新yum包
sudo yum update
(3)卸载旧版本docker
sudo yum remove docker docker-common docker-selinux docker-engine
(4)安装需要的软件包
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
(5)设置yum源
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
(6)查看所有仓库中的docker版本
yum list docker-ce --showduplicates | sort -r
(7)安装
sudo yum install docker-ce
(8)启动并加入开机启动
sudo systemctl start docker
sudo systemctl enable docker
(9) 查看版本
sudo docker version
二、安装mysql
(1)sudo docker search mysql
(2)sudo docker pull docker.io/sameersbn/mysql
sudo docker run -p 10084:3306 --name=redmine_mysql --env='DB_NAME=redmine' --env='DB_USER=redmine' --env='DB_PASS=58f564823c633508' --volume=/opt/redmine/mysql:/var/lib/mysql -d sameersbn/mysql
三、安装redmine
(1)sudo docker search redmine
(2)sudo docker pull docker.io/sameersbn/redmine
(3)
sudo docker run --name=redmineNorm -d --link=redmine_mysql:mysql --publish=10083:80 --env='REDMINE_PORT=10083' --volume=/opt/redmine/redmine:/home/redmine/data ----env='SMTP_HOST=10.209.202.212' --env='SMTP_METHOD=smtp' --env='SMTP_PORT=25' --env='SMTP_DOMAIN=alarm.360.cn' --env='SMTP_USER=opentest' --env='SMTP_PASS=opentest' sameersbn/redmine
或者 sudo docker run --name=redmineNorm -d --link=redmine_mysql:mysql --publish=10083:80 --env='REDMINE_PORT=10083' --volume=/opt/redmine/redmine:/home/redmine/data --env='SMTP_HOST=smtp.163.com' --env='SMTP_METHOD=async_smtp' --env='SMTP_PORT=25' --env='SMTP_DOMAIN=smtp.163.com' --env='SMTP_USER=redmine_qa_qihoo@163.com' --env='SMTP_PASS=redmine123456' -e TZ="Asia/Shanghai" -v /etc/localtime:/etc/localtime:ro sameersbn/redmine
或者 docker run --name=redmine -d --link=postgresql-redmine:postgresql --publish=10083:80 --env='REDMINE_PORT=10083' --env='SMTP_HOST=smtp.163.com' --env='SMTP_METHOD=async_smtp' --env='SMTP_PORT=465' --env='SMTP_USER=' --env='SMTP_PASS=' -e TZ="Asia/Shanghai" -v /etc/localtime:/etc/localtime:ro --volume=/srv/docker/redmine/redmine:/home/redmine/data sameersbn/redmine
四、备份docker数据库
(1)导入
docker exec -it f51f7dbc1387 mysqldump -uredmine -p58f564823c633508 redmine > /opt/redmine/redmine_bak.sql
(2)导出
docker exec -i f51f7dbc1387 redmine < /opt/redmine/redmine.sql