Bitnami/Redmine doesn't restart after installing plugins in docker container

244 views Asked by At

I want to add plugins to my Redmine container. I can get them to work but once installed, the container fail when restarting.

I use bitnami/redmine:5.1.1 and bitnami/mysql:8.0.34

Both container works fine, I can access Redmine.

I can install the plugins manually and they work but when I restart the container, it doesnt work.

Here is my configurations:

docker-compose.yml

version: '3.9'

services:
  
  database:
    build: ./mysql
    restart: unless-stopped
    ports:
      - 33306:3306
    volumes:
      - /home/dockerfiles/bitnami/mysql/persistance:/bitnami/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=xxxxx
      - MYSQL_USER=redmine
      - MYSQL_PASSWORD=redmine
      - MYSQL_DATABASE=redmine
      - MYSQL_ALLOW_EMPTY_PASSWORD=no

    healthcheck:
      test: bash -c "/opt/bitnami/mysql/bin/mysql -uroot -p$$MYSQL_ROOT_PASSWORD $$MYSQL_DATABASE --silent --execute 'SHOW TABLES;'"
      interval: 15s
      timeout: 5s
      retries: 6
      start_period: 5s
  
  redmine:
    build: ./redmine
    ports:
      - '3000:3000'
    volumes:
      - /home/dockerfiles/bitnami/redmine/persistance:/bitnami/redmine

    depends_on:
      database:
        condition: service_healthy
      
    environment:
      # DATABASE CONNECTION PARAMETERS
      - REDMINE_DATABASE_TYPE=mysql
      - REDMINE_DATABASE_HOST=database
      - REDMINE_DATABASE_PORT=3306
      - REDMINE_DATABASE_NAME=redmine
      - REDMINE_DATABASE_USER=redmine
      - REDMINE_DATABASE_PASSWORD=redmine
      - ALLOW_EMPTY_PASSWORD=no

      #REDMINE PARAMETERS
      - REDMINE_PORT_NUMBER=3000
      - REDMINE_USERNAME=admin
      - REDMINE_PASSWORD=xxxxxx
      - REDMINE_EMAIL=
      - REDMINE_FIRST_NAME=
      - REDMINE_LAST_NAME=
      - REDMINE_LANGUAGE=en
      - REDMINE_LOAD_DEFAULT_DATA=no
      - REDMINE_SKIP_BOOTSTRAP=yes
      - REDMINE_PLUGINS_MIGRATE=no
      - REDMINE_SECRET_KEY_BASE=redmine_secret_key_base


volumes:
  db_data:
    driver: local
  redmine_data:
    driver: local

Redmine dockerfile

FROM bitnami/redmine:5.1.1

RUN apt update
RUN apt install -y micro
RUN gem install bundler
RUN gem update

Once the containers are running with the plugins folder empty, I enter the Redmine instance and copy my plugins inside the plugins folder (/bitnami/redmine/plugins) and then execute those commands:

bundle config set frozen false
bundle install
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
bundle exec rake restart

From there, Redmine is working properly with all my plugins installed.

When I restart the container I get :

redmine_1   | redmine 15:41:34.64 INFO  ==>
redmine_1   | redmine 15:41:34.64 INFO  ==> Welcome to the Bitnami redmine container
redmine_1   | redmine 15:41:34.64 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
redmine_1   | redmine 15:41:34.64 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
redmine_1   | redmine 15:41:34.64 INFO  ==>
redmine_1   | redmine 15:41:34.65 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
redmine_1   | redmine 15:41:34.65 INFO  ==> Validating settings in POSTGRESQL_CLIENT_* env vars
redmine_1   | redmine 15:41:34.67 DEBUG ==> Validating settings in REDMINE_* environment variables...
redmine_1   | redmine 15:41:34.67 INFO  ==> persist directory
redmine_1   | redmine 15:41:34.68 INFO  ==> /bitnami/redmine
redmine_1   | redmine 15:41:34.68 INFO  ==> dir is not empty
redmine_1   | redmine 15:41:34.68 INFO  ==> Directory empty
redmine_1   | redmine 15:41:34.68 INFO  ==> Restoring persisted Redmine installation
redmine_1   | redmine 15:41:34.71 INFO  ==> Trying to connect to the database server
redmine_1   | redmine 15:41:34.71 DEBUG ==> Getting production.host from Redmine configuration
redmine_1   | redmine 15:41:34.71 DEBUG ==> Getting production.port from Redmine configuration
redmine_1   | redmine 15:41:34.72 DEBUG ==> Getting production.database from Redmine configuration
redmine_1   | redmine 15:41:34.72 DEBUG ==> Getting production.username from Redmine configuration
redmine_1   | redmine 15:41:34.73 DEBUG ==> Getting production.password from Redmine configuration
redmine_1   | redmine 15:41:34.73 DEBUG ==> Getting production.adapter from Redmine configuration
redmine_1   | redmine 15:41:34.74 DEBUG ==> Executing SQL command:
redmine_1   | SELECT 1
redmine_1   | /opt/bitnami/mysql/bin/mysql: Deprecated program name. It will be removed in a future release, use '/opt/bitnami/mysql/bin/mariadb' instead
redmine_1   | 1
redmine_1   | redmine 15:41:34.75 INFO  ==> Executing database migrations 2
redmine_1   | redmine 15:41:34.75 DEBUG ==> Generating secret tokens
redmine_1   | bundler: failed to load command: rake (/opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/bin/rake)
redmine_1   | /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/definition.rb:418:in `ensure_equivalent_gemfile_and_lockfile': The dependencies in your gemfile changed, but the lockfile can't be updated because frozen mode is set (Bundler::ProductionError)
redmine_1   |
redmine_1   | You have added to the Gemfile:
redmine_1   | * deface (= 1.6.2)
redmine_1   | * redmine_crm
redmine_1   | * vcard
redmine_1   | * spreadsheet
redmine_1   | * rake
redmine_1   | * slim-rails
redmine_1   | * database_cleaner-active_record (~> 2.0)
redmine_1   | * rspec (~> 3.10)
redmine_1   | * rspec-rails
redmine_1   | * webrick
redmine_1   | * redmine_crm
redmine_1   | * haml-rails
redmine_1   |
redmine_1   | Run `bundle install` elsewhere and add the updated Gemfile.lock to version control.
redmine_1   | If this is a development machine, remove the Gemfile freeze by running `bundle config set frozen false`.
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/runtime.rb:13:in `setup'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler.rb:162:in `setup'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/setup.rb:23:in `block in <top (required)>'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/ui/shell.rb:159:in `with_level'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/ui/shell.rb:111:in `silence'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/setup.rb:23:in `<top (required)>'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/cli/exec.rb:56:in `require_relative'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/cli/exec.rb:56:in `kernel_load'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/cli/exec.rb:23:in `run'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/cli.rb:492:in `exec'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/cli.rb:34:in `dispatch'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/cli.rb:28:in `start'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/exe/bundle:37:in `block in <top (required)>'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
redmine_1   |   from /opt/bitnami/ruby/lib/ruby/gems/3.0.0/gems/bundler-2.4.19/exe/bundle:29:in `<top (required)>'
redmine_1   |   from /opt/bitnami/ruby/bin/bundle:25:in `load'
redmine_1   |   from /opt/bitnami/ruby/bin/bundle:25:in `<main>'

I tried installing the plugins from dockerfile when building my image but since I'm not using builtin sqlite database, the plugins migrations fails.

0

There are 0 answers