Official Repository

Last pushed: 8 days ago
Short Description
Redmine is a flexible project management web application written using Ruby on Rails framework
Full Description

Supported tags and respective Dockerfile links

Quick reference

What is Redmine?

Redmine is a free and open source, web-based project management and issue tracking tool. It allows users to manage multiple projects and associated subprojects. It features per project wikis and forums, time tracking, and flexible role based access control. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. Redmine integrates with various version control systems and includes a repository browser and diff viewer.

wikipedia.org/wiki/Redmine

How to use this image

Run Redmine with SQLite3

This is the simplest setup; just run redmine.

$ docker run -d --name some-redmine redmine

not for multi-user production use (redmine wiki)

Run Redmine with a Database Container

Running Redmine with a database server is the recommened way.

  1. start a database container

    • PostgreSQL

      $ docker run -d --name some-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=redmine postgres
      
    • MySQL (replace --link some-postgres:postgres with --link some-mysql:mysql when running redmine)

      $ docker run -d --name some-mysql -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=redmine mysql
      
  2. start redmine

    $ docker run -d --name some-redmine --link some-postgres:postgres redmine
    

... via docker stack deploy or docker-compose

Example stack.yml for redmine:

version: '3.1'

services:

  redmine:
    image: redmine
    ports:
      - 8080:3000
    environment:
      REDMINE_DB_MYSQL: db
      REDMINE_DB_PASSWORD: example

  db:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: example
      MYSQL_DATABASE: redmine

Run docker stack deploy -c stack.yml redmine (or docker-compose -f stack.yml up), wait for it to initialize completely, and visit http://swarm-ip:8080, http://localhost:8080, or http://host-ip:8080 (as appropriate).

Alternative Web Server

The other tags in this repository, like those with passenger, use the same environment and --links as the default tags that use WEBrick (rails s) but instead give you the option of a different web and application server. passenger uses Phusion Passenger. tini is used for reaping zombies.

Accessing the Application

Currently, the default user and password from upstream is admin/admin (logging into the application).

Where to Store Data

Important note: There are several ways to store data used by applications that run in Docker containers. We encourage users of the redmine images to familiarize themselves with the options available, including:

  • Let Docker manage the storage of your files by writing the files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.
  • Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.

The Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blogs and forum postings that discuss and give advice in this area. We will simply show the basic procedure here for the latter option above:

  1. Create a data directory on a suitable volume on your host system, e.g. /my/own/datadir.
  2. Start your redmine container like this:

    $ docker run -d --name some-redmine -v /my/own/datadir:/usr/src/redmine/files --link some-postgres:postgres redmine
    

The -v /my/own/datadir:/usr/src/redmine/files part of the command mounts the /my/own/datadir directory from the underlying host system as /usr/src/redmine/files inside the container, where Redmine will store uploaded files.

Note that users on host systems with SELinux enabled may see issues with this. The current workaround is to assign the relevant SELinux policy type to the new data directory so that the container will be allowed to access it:

$ chcon -Rt svirt_sandbox_file_t /my/own/datadir

Port Mapping

If you'd like to be able to access the instance from the host without the container's IP, standard port mappings can be used. Just add -p 3000:3000 to the docker run arguments and then access either http://localhost:3000 or http://host-ip:3000 in a browser.

Environment Variables

When you start the redmine image, you can adjust the configuration of the instance by passing one or more environment variables on the docker run command line.

REDMINE_DB_MYSQL or REDMINE_DB_POSTGRES

These two variables allow you to set the hostname or IP address of the MySQL or PostgreSQL host, respectively. These values are mutually exclusive so it is undefined behavior if both are set. If neither variable is set, the image will fall back to using SQLite.

REDMINE_DB_PORT

This variable allows you to specify a custom database connection port. If unspecified, it will default to the regular connection ports: 3306 for MySQL, 5432 for PostgreSQL, and empty string for SQLite.

REDMINE_DB_USERNAME

This variable sets the user that Redmine and any rake tasks use to connect to the specified database. If unspecified, it will default to root for MySQL, postgres for PostgreSQL, or redmine for SQLite.

REDMINE_DB_PASSWORD

This variable sets the password that the specified user will use in connecting to the database. There is no default value.

REDMINE_DB_DATABASE

This variable sets the database that Redmine will use in the specified database server. If not specified, it will default to redmine for MySQL, the value of REDMINE_DB_USERNAME for PostgreSQL, or sqlite/redmine.db for SQLite.

REDMINE_DB_ENCODING

This variable sets the character encoding to use when connecting to the database server. If unspecified, it will use the default for the mysql2 library (UTF-8) for MySQL, utf8 for PostgreSQL, or utf8 for SQLite.

REDMINE_NO_DB_MIGRATE

This variable allows you to control if rake db:migrate is run on container start. Just set the variable to a non-empty string like 1 or true and the migrate script will not automatically run on container start.

db:migrate will also not run if you start your image with something other than the default CMD, like bash. See the current docker-entrypoint.sh in your image for details.

REDMINE_PLUGINS_MIGRATE

This variable allows you to control if rake redmine:plugins:migrate is run on container start. Just set the variable to a non-empty string like 1 or true and the migrate script will be automatically run on every container start. It will be run after db:migrate.

redmine:plugins:migrate will not run if you start your image with something other than the default CMD, like bash. See the current docker-entrypoint.sh in your image for details.

REDMINE_SECRET_KEY_BASE

This variable is used to create an initial config/secrets.yml and set the secret_key_base value, which is "used by Rails to encode cookies storing session data thus preventing their tampering. Generating a new secret token invalidates all existing sessions after restart" (session store). If you do not set this variable or provide a secrets.yml one will be generated using rake generate_secret_token.

Docker Secrets

As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. For example:

$ docker run -d --name some-redmine -e REDMINE_DB_MYSQL_FILE=/run/secrets/mysql-host -e REDMINE_DB_PASSWORD_FILE=/run/secrets/mysql-root redmine:tag

Currently, this is only supported for REDMINE_DB_MYSQL, REDMINE_DB_POSTGRES, REDMINE_DB_PORT, REDMINE_DB_USERNAME, REDMINE_DB_PASSWORD, REDMINE_DB_DATABASE, REDMINE_DB_ENCODING, and REDMINE_SECRET_KEY_BASE.

License

Redmine is open source and released under the terms of the GNU General Public License v2 (GPL).

Docker Pull Command

Comments (35)
xanxan8juli
9 days ago

zx1986
a month ago

I got this error too:

block in verify_gemfile_dependencies_are_found!': Could not find gem 'redmine_crm'

akaillidan
2 months ago

About 2 weeks ago, mounting the directory with the plugins worked fine. Now this does not work on all images, error:

/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/resolver.rb:396:in block in verify_gemfile_dependencies_are_found!': Could not find gem 'factory_girl_rails' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound) from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/resolver.rb:366:ineach'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/resolver.rb:366:in verify_gemfile_dependencies_are_found!' from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/resolver.rb:212:instart'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/resolver.rb:191:in resolve' from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/definition.rb:235:inresolve'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/definition.rb:159:in specs' from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/definition.rb:218:inspecs_for'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/definition.rb:207:in requested_specs' from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:109:inblock in definition_method'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/runtime.rb:21:in setup' from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler.rb:101:insetup'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.15.2/lib/bundler/setup.rb:19:in <top (required)>' from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:133:inrequire'
from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:133:in rescue in require' from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:40:inrequire'
from /usr/local/bundle/bin/rake:15:in `<main>'

Plugins:
due_date_reminder
external_links_in_new_window
redmine_agile
redmine_slack

gugledock
3 months ago

When I try to start redmine: 3.3.3-Passenger, I see in the log:

Bundled gems are installed into /usr/local/bundle.
 [passenger_native_support.so] trying to compile for the current user (redmine) and Ruby interpreter...
     (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
     Warning: compilation didn't succeed. To learn why, read this file:
     /tmp/passenger_native_support-135vr28.log
 [passenger_native_support.so] finding downloads for the current Ruby interpreter...
     (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
     Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/5.1.5/rubyext-ruby-2.2.7-x86_64-linux.tar.gz: 2017-06-29 13:19:57 ERROR 404: Not Found.
     Trying next mirror...
     Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/5.1.5/rubyext-ruby-2.2.7-x86_64-linux.tar.gz: 2017-06-29 13:19:57 ERROR 403: Forbidden.
 [passenger_native_support.so] will not be used (can't compile or download) 
  --> Passenger will still operate normally.

Can someone help?

bigkun
4 months ago

how to configure the 'smtp ' settings on docker container instance?

angcaruso
4 months ago

After my previous comment, I opened an issue regarding the dependence on the --link option. I was informed that explicit environment variables do exists, but had simply not been documented. The maintainers then quickly updated the documentation here and closed the issue. Hooray! Thus, my prior comment is now obsolete.

Here are updated example commands, based on my prior comment, that use the proper environment variables, now properly documented as well:

sudo docker network create redmine-net

sudo docker run -d --name postgres-redmine --restart unless-stopped --network=redmine-net -v /var/redmine/postgres/data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=redmine1 -e POSTGRES_USER=redmine postgres

sudo docker run -d --name redmine --restart unless-stopped --network=redmine-net -p 8080:3000 -v /var/redmine/files:/usr/src/redmine/files -e REDMINE_DB_POSTGRES=postgres-redmine -e REDMINE_DB_USERNAME=redmine -e REDMINE_DB_PASSWORD=redmine1 redmine

angcaruso
4 months ago

I had quite a bit of trouble getting things working with Postgres, and I have seen many other people posting questions about it. This image seems to be dependent on the now-deprecated Docker --link option. In particular, I found that to use a private Docker bridge network between the Redmine and Postgres containers (which I understand to be the recommended approach), several environment variables need to be defined for the Redmine container. These environment variable are defined automatically when using the deprecated --link option, and don't seem to be documented anywhere.

Here is an examples that I know works, followed by the corresponding Docker compose syntax:

sudo docker network create redmine-net

sudo docker run -d --name postgres-redmine --restart unless-stopped --network=redmine-net -v /mnt/redmine/postgres/data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=password -e POSTGRES_USER=redmine postgres

sudo docker run -d --name redmine --restart unless-stopped --network=redmine-net -p 11235:3000 -v /mnt/redmine/files:/usr/src/redmine/files -e REDMINE_DB_POSTGRES=postgres-redmine -e POSTGRES_ENV_POSTGRES_USER=redmine -e POSTGRES_ENV_POSTGRES_PASSWORD=password redmine

You can get it to work with docker-compose by adding the same environment variable above to the yml file.

I hope this saves someone a few hours.

peterkirby
5 months ago

Be careful when using the docker-compose example above. It suggests using MariaDB. As of the writing of this comment even the redmine version 3.3.3 compatibility matrix only supports up to mysql 5.5 and says there are issues with MariaDB.

I had some table locking issues with MariaDB that went away when I replaced MariaDB with Mysql 5.5.

ifadi
5 months ago

How to update redmine? i have the latest tag, when i issue

docker pull redmine

i still get the redmine version 3.3.2 and not the latest 3.3.3
on Github the latest have been released.

Thanks for your help in Advance.

hidekuro
6 months ago

@huangsj47
need customizes below:

  • modify mysqld charset to utf8mb4.
  • add ENGINE=InnoDB ROW_FORMAT=DYNAMIC options to CREATE TABLE for MySQL/MariaDB.

here is my sources. it works fine for me.

Dockerfile

FROM redmine:3.3
COPY ./innodb_row_format.rb /usr/src/redmine/config/initializers/innodb_row_format.rb

innodb_row_format.rb

ActiveSupport.on_load :active_record do
  module ActiveRecord::ConnectionAdapters

    class AbstractMysqlAdapter
      def create_table_with_innodb_row_format(table_name, options = {})
        table_options = options.merge(:options => 'ENGINE=InnoDB ROW_FORMAT=DYNAMIC')
        create_table_without_innodb_row_format(table_name, table_options) do |td|
          yield td if block_given?
        end
      end
      alias_method_chain :create_table, :innodb_row_format
    end

  end
end

my.cnf

[mysqld]
character_set_server=utf8mb4
collation_server=utf8mb4_unicode_ci
innodb_large_prefix
innodb_file_per_table
innodb_file_format=barracuda