由于无法解决的依赖关系,无法安装插件

时间:2019-05-15 12:28:14

标签: docker docker-compose rubygems redmine redmine-plugins

我正在尝试在plugin环境中安装dockerized redmine

我遇到以下错误:

Bundler could not find compatible versions for gem "json":
   In snapshot (Gemfile.lock):
     json (= 2.2.0)

   In Gemfile:
     httparty (~> 0.13.7) was resolved to 0.13.7, which depends on
       json (~> 1.8)

     simplecov (~> 0.14.1) was resolved to 0.14.1, which depends on
       json (>= 1.8, < 3)

我尝试从容器中安装插件,我可以在其中解决依赖关系,但是,由于docker映像层的性质,重新启动容器时,已安装的gem已消失。

我尝试使用以下Dockerfile构建自定义映像:

FROM redmine:latest
USER root

RUN set -eux; \
        apt-get update; \
        apt-get install -y \
                build-essential

RUN bundle update

RUN gem install httparty

RUN gem install json -v 1.8.6

RUN bundle update

RUN bundle install

RUN chmod -R 777 /home/redmine/.bundle

映像构建成功,但是当docker-compose up到达插件迁移部分时,它将引发相同的错误。

我的docker-compose.yml:

version: '3.1'

services:

  redmine:
    build: .
    restart: always
    ports:
      - 80:3000
    volumes:
        - files:/usr/src/redmine/files
#        - ./sc:/home/redmine/git
#        - ./themes:/usr/src/redmine/public/themes
#        - ./configuration.yml:/usr/src/redmine/config/configuration.yml
        - ./plugins:/usr/src/redmine/plugins
#        - ./gems:/usr/local/bundle/gems
    environment:
      REDMINE_DB_MYSQL: db
      REDMINE_DB_PASSWORD: supersecret
      REDMINE_PLUGINS_MIGRATE: 1

  db:
    image: mysql:5.7
    command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
    restart: always
    volumes:
        - db:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: supersecret
      MYSQL_DATABASE: redmine

volumes:
  files:
  db:

有人能解决类似的问题吗?

0 个答案:

没有答案