redmine迁移

1. 在ubuntu14.04 上pull镜像redmine(注意版本为3.1.6)

docker pull redmine:3.1.6

 

2. 创建主机目录 /srv/redmine,将原主机上的compose.yml和run拷贝过来,将备份(files目录和redmine.db数据库文件)也拷贝过来

root@karl-v1:/srv/redmine# ls -ahl
total 9.5M
drwxr-xr-x 3 root root   4.0K May  8 11:16 .
drwxr-xr-x 6 root root   4.0K May  7 16:01 ..
-rw-r--r-- 1 root root    283 May  8 10:41 compose.yml
drwxrwxr-x 6  999 docker 4.0K May  7 16:23 files
-rw-r--r-- 1  999 docker 9.4M May  8 11:11 redmine.db
-rwxr-xr-x 1 root root   2.2K May  7 16:00 run
root@karl-v1:/srv/redmine#

 

3. 编辑compose.yml,将备份内容映射到容器中

root@karl-v1:/srv/redmine# cat compose.yml
data:
  image: busybox
  entrypoint: /bin/true
  volumes:
    - /srv/redmine/files:/usr/src/redmine/files

main:
  image: redmine:3.1.6
  volumes_from:
    - data
  volumes:
    - /tmp:/tmp
    - /srv/redmine/redmine.db:/usr/src/redmine/sqlite/redmine.db
  ports:
    - "3000:3000"
root@karl-v1:/srv/redmine#

 

4. 运行redmine容器

root@karl-v1:/srv/redmine#  docker-compose -f compose.yml -p redmine up -d

 

5. 检查redmine容器是否正常运行,并验证redmine页面能否打开

## 检查redmine容器日志
root@karl-v1:/srv/redmine# docker logs redmine_main_1 warning: missing REDMINE_DB_MYSQL or REDMINE_DB_POSTGRES environment variables *** Using sqlite3 as fallback. *** Fetching gem metadata from https://rubygems.org/............... Fetching version metadata from https://rubygems.org/... Fetching dependency metadata from https://rubygems.org/.. Using rake 11.3.0 Using i18n 0.7.0 Using json 1.8.3 ... ... Using rails 4.2.5.2 Bundle complete! 32 Gemfile dependencies, 51 gems now installed. Gems in the groups development and test were not installed. Bundled gems are installed into /usr/local/bundle. /usr/local/bundle/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot" /usr/local/bundle/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot" /usr/local/bundle/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot" [2019-05-08 05:56:31] INFO WEBrick 1.3.1 [2019-05-08 05:56:31] INFO ruby 2.2.5 (2016-04-26) [x86_64-linux] [2019-05-08 05:56:31] INFO WEBrick::HTTPServer#start: pid=1 port=3000


## 在浏览器中输入 103.23.162.74:3000

 

转载于:https://www.cnblogs.com/karl-python/p/10830844.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值