Docker Redmine image crashing trying to migrate custom workflows plugin

I’m trying to build a docker container running Redmine locally with the plugin named:”custom_workflows” (link: https://www.redmine.org/plugins/custom-workflows)

OS: Ubuntu 19.04

docker version: 18.06.1-ce

docker-compose version: 1.24

ruby version installed within the container: 2.4.5

I’ve tried to build the container with both the Redmine official image and with the bitnami/redmine image.

Here’s my docker-compose.yml (standard template taken from docker hub) customized according to bitnami/redmine.

version: '3.3'
services:
    mariadb:
        image: 'bitnami/mariadb:latest'
        environment:
          - ALLOW_EMPTY_PASSWORD=yes
    volumes:
      - 'mariadb_data:/bitnami'
redmine:
    image: 'bitnami/redmine:3.4.6'
    ports:
      - '80:3000'
    environment:
      - 'REDMINE_PLUGINS_MIGRATE=true'
    volumes:
      - 'redmine_data:/bitnami'
      - './plugins:/opt/bitnami/redmine/plugins'
    depends_on:
      - mariadb
    volumes:
        mariadb_data:
        driver: local
    redmine_data:
        driver: local

Once I run the docker-compose up command, I get this log of errors:

redmine_1  | nami    INFO  Initializing redmine
redmine_1  | redmine INFO  Configuring Redmine database...
redmine_1  | mysql-c INFO  Trying to connect to MySQL server
redmine_1  | mysql-c INFO  Found MySQL server listening at mariadb:3306
redmine_1  | mysql-c INFO  MySQL server listening and working at mariadb:3306
redmine_1  | redmine INFO  Preparing Redmine environment...
redmine_1  | redmine INFO  Migrating database...
redmine_1  | Error executing 'postInstallation': rake aborted!
redmine_1  | StandardError: An error has occurred, all later migrations canceled:
redmine_1  | 
redmine_1  | uninitialized constant RedmineCustomWorkflows::GroupPatch::InstanceMethods::CustomWorkflow
redmine_1  | /opt/bitnami/redmine/plugins/custom_workflows/lib/redmine_custom_workflows/group_patch.rb:32:in `before_save_custom_workflows'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:432:in `block in make_lambda'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:164:in `block in halting'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:504:in `block in call'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:504:in `each'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:504:in `call'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_save_callbacks'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/callbacks.rb:302:in `create_or_update'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/persistence.rb:120:in `save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/validations.rb:37:in `save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/attribute_methods/dirty.rb:21:in `save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:286:in `block (2 levels) in save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:220:in `transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:286:in `block in save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:285:in `save'
redmine_1  | /opt/bitnami/redmine/db/migrate/20140920094058_insert_builtin_groups.rb:8:in `up'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:611:in `exec_migration'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:592:in `block (2 levels) in migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:591:in `block in migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:590:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:768:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:1046:in `ddl_transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:959:in `block in migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:955:in `each'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:955:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:823:in `up'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:801:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
redmine_1  | /opt/bitnami/ruby/bin/bundle:23:in `load'
redmine_1  | /opt/bitnami/ruby/bin/bundle:23:in `<main>'
redmine_1  | 
redmine_1  | Caused by:
redmine_1  | NameError: uninitialized constant RedmineCustomWorkflows::GroupPatch::InstanceMethods::CustomWorkflow
redmine_1  | /opt/bitnami/redmine/plugins/custom_workflows/lib/redmine_custom_workflows/group_patch.rb:32:in `before_save_custom_workflows'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:432:in `block in make_lambda'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:164:in `block in halting'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:504:in `block in call'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:504:in `each'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:504:in `call'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/callbacks.rb:778:in `_run_save_callbacks'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/callbacks.rb:302:in `create_or_update'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/persistence.rb:120:in `save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/validations.rb:37:in `save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/attribute_methods/dirty.rb:21:in `save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:286:in `block (2 levels) in save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:220:in `transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:286:in `block in save'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:285:in `save'
redmine_1  | /opt/bitnami/redmine/db/migrate/20140920094058_insert_builtin_groups.rb:8:in `up'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:611:in `exec_migration'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:592:in `block (2 levels) in migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:591:in `block in migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:590:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:768:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:1046:in `ddl_transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:959:in `block in migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:955:in `each'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:955:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:823:in `up'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/migration.rb:801:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.8/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
redmine_1  | /opt/bitnami/redmine/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
redmine_1  | /opt/bitnami/ruby/bin/bundle:23:in `load'
redmine_1  | /opt/bitnami/ruby/bin/bundle:23:in `<main>'
redmine_1  | Tasks: TOP => db:migrate
redmine_1  | (See full trace by running task with --trace)
redmine_1  | 
redmine-server_redmine_1 exited with code 1

The same log of errors appears with the redmine official image and the bitnami image.

Is there something dumb I’m missing? It works on a local machine, but once on docker fails hard.

Source: StackOverflow