0

我需要你的帮助。我的任务是 dockerized 我当前的 redmine。将近 2 周我正在完成这项任务。我将公共文件夹从主机 redmine 复制到 docker 容器 redmine/public 我复制了所有插件并成功安装,但问题是图像,我的主题背景图像,wiki 图像未显示。

我认为我的 docker redmine 找不到图像路径。

有人知道如何显示图像吗?

我将解释到目前为止我做了什么。

docker network create --driver bridge redmine_network
docker volume create postgres-data
docker volume create redmine-data

docker container run -d                         \ 
      --name postgres                           \ 
      --network redmine_network                 \ 
      -v postgres-data:/var/lib/postgresql/data \ 
      --restart always                          \ 
      -e POSTGRES_PASSWORD='password'             \ 
      -e POSTGRES_DB='redmine'                  \ 
      postgres:latest



docker container run -d                         \ 
    --name redmine                              \ 
    --network redmine_network                   \ 
    -p 80:3000                                  \ 
    --restart always                            \ 
    -v redmine-data:/usr/src/redmine/files      \ 
    -e REDMINE_DB_POSTGRES='postgres'           \ 
    -e REDMINE_DB_DATABASE='redmine'            \ 
    -e REDMINE_DB_PASSWORD='password'           \ 
    redmine:latest

在容器内,我为我的插件安装了一些包和 gem

docker exec -it redmine bash

apt update 
apt install build-essential libpq-dev pkg-config libmagickwand-dev ruby ruby-dev
bundle install --no-deployment
gem install will_paginate 
gem install jenkins_api_client
gem install activesupport -v 4.2.8
gem install  haml-rails -v 1.0
gem install deface -v 1.0.2
gem install brakeman -v 4.8.0
bundle updates

docker redmine 日志文件

Resolving dependencies...
The Gemfile's dependencies are satisfied
[2020-03-17 16:31:41] INFO  WEBrick 1.3.1
[2020-03-17 16:31:41] INFO  ruby 2.4.4 (2018-03-28) [x86_64-linux]
[2020-03-17 16:31:41] INFO  WEBrick::HTTPServer#start: pid=1 port=3000
[2020-03-17 16:32:03] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:16 
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `eof?'
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `run'
    /usr/local/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
[2020-03-17 16:32:03] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:14 
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `eof?'
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `run'
    /usr/local/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
[2020-03-17 16:32:08] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:19 
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `eof?'
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `run'
    /usr/local/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
[2020-03-17 16:32:08] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:13 
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `eof?'
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `run'
    /usr/local/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
[2020-03-17 16:32:08] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:18 
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `eof?'
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `run'
    /usr/local/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
[2020-03-17 16:32:09] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:16 
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `eof?'
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `run'
    /usr/local/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'
[2020-03-17 16:32:09] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:14 
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `eof?'
    /usr/local/lib/ruby/2.4.0/webrick/httpserver.rb:82:in `run'
    /usr/local/lib/ruby/2.4.0/webrick/server.rb:308:in `block in start_thread'

任何人都可以解释如何清除此错误..请

4

1 回答 1

0

我想让 docker redmine 和我的主机 redmine 一样。我可以解释到目前为止我做了什么。

为 redmine 3.4.4 和 postgresql 创建 docker 容器:最新的每个容器的网络和卷 https://medium.com/@gurayy/setting-up-redmine-with-docker-be110387ba1c

在 redmine 容器中安装包和 gem

复制 /public 文件夹到 docker redmine:/usr/src/redmine

将所有插件复制到 docker redmine:/usr/src/redmine/plugins

安装插件 bundle exec rake redmine:plugins NAME=readme_at_repositories RAILS_ENV=production

docker 容器重启 redmine

检查一切正常

从我的主机做一个 pg_dump

/usr/bin/pg_dump -U postgres -h localhost -W -F -T --file=/tmp/redminedata.sqlc projectportal

进入我的 postgresql 容器并恢复我的数据库

pg_restore -c -U postgres -h postgres -d projectportal /tmp/redminedata.sqlc

重新启动 redmine 容器,然后在浏览器中再次检查 redmine

当我检查我的 redmine .png 和 .jpg 文件不起作用(未显示)时,所有数据都已迁移,但图像丢失并且我的主题背景图像。

在此处输入图像描述

于 2020-03-18T18:23:27.783 回答