问题1:

docker pull redmine:latest
docker pull mysql:latest


docker run -d -p 23306:3306 --name=server-mysql \
    -v /srv/redmine/mysql:/var/lib/mysql \
    -e MYSQL_ROOT_PASSWORD="password"  \
    -e MYSQL_DATABASE=redmine \
    mysql:latest --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

#slepp 10

# 注意如果把创建mysql和redmine容器的命令写到一个脚本里,中间需要个sleep,否则数据库还没建好就启动redmine容器,redmine容器会启动失败。

#注意这里的--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci,如果不加上,redmine里使用中文会有问题。

docker run -d -p 28080:3000 --name=server-redmine \
    -e MYSQL_ROOT_PASSWORD="password" \
    --link server-mysql:mysql \
    -v /srv/redmine/redmine:/usr/src/redmine/files \
    redmine:latest


问题2:

#注意,官方redmine容器里debian无法update问题,解决办法:


备份/etc/apt/sources.list,

echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib" >/etc/apt/sources.list && \
echo "deb http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list && \
echo "deb-src http://mirrors.163.com/debian/ jessie main non-free contrib" >>/etc/apt/sources.list && \
echo "deb-src http://mirrors.163.com/debian/ jessie-proposed-updates main non-free contrib" >>/etc/apt/sources.list

apt update -y

apt install vim 测试一下,OK.


问题3:

要修改数据库配置,修改 /usr/src/redmine/config/database.yml

要配置smtp,需要手动增加一个configuration.yml (以configuration.yml.example为模板)。

附件保存路径与旧版本redmine不兼容,需要手动指定storage_path:

vi /usr/src/redmine/app/models/attachment.rb

  #@@storage_path = Redmine::Configuration['attachments_storage_path'] || File.join(Rails.root, "files")
  @@storage_path = "/usr/src/redmine/files/files"

# 注意后面是两个files

参考资料:

https://blog.csdn.net/zzulp/article/details/54175909
https://hub.docker.com/_/redmine/
https://hub.docker.com/_/mysql/
http://www.laozuo.org/10783.html


Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐