Public | Automated Build

Last pushed: a year ago
Short Description
Short description is empty for this repo.
Full Description

docker-alfresco

Table of Contents

Introduction

Dockerfile to build an Alfresco container image.

Contributing

Here is how you can help:

  • Send a Pull Request with your awesome new features and bug fixes
  • Report Issues

Installation

Pull the image from the docker index.

docker pull gui81/alfresco:latest

or pull a particular version:

docker pull gui81/alfresco:5.0.d-1

Alternatively, you can build the image yourself:

git clone https://github.com/gui81/docker-alfresco.git
cd docker-alfresco
docker build --tag="$USER/alfresco" .

Quick Start

Run the alfresco image with the name "alfresco".

docker run --name='alfresco' -it --rm -p 8080:8080 gui81/alfresco

NOTE: Please allow a few minutes for the application to start, especially if
populating the database for the first time.

Go to http://localhost:8080/share or point to the ip of your docker server.
On the Mac, if you are running docker-machine, then you can go to the ip
reported by:

docker-machine ip [name of Docker VM]

The default username and password are:

  • username: admin
  • password: admin

Alfresco should now be up and running. The following is an example that would
mount the appropriate volume, connect to a remote PostgreSQL database, and use
an external LDAP server for authentication:

docker run --name='alfresco' -it --rm -p 445:445 -p 7070:7070 -p 8080:8080 \
    -v '/host/alfresco/content:/content' \
    -v '/host/alfresco/data:/alfresco/alf_data' \
    -e 'CONTENT_STORE=/content' \
    -e 'LDAP_ENABLED=true' \
    -e 'LDAP_AUTH_USERNAMEFORMAT=uid=%s,cn=users,cn=accounts,dc=example,dc=com' \
    -e 'LDAP_URL=ldap://ipa.example.com:389' \
    -e 'LDAP_DEFAULT_ADMINS=admin' \
    -e 'LDAP_SECURITY_PRINCIPAL=uid=admin,cn=users,cn=accounts,dc=example,dc=com' \
    -e 'LDAP_SECURITY_CREDENTIALS=password' \
    -e 'LDAP_GROUP_SEARCHBASE=cn=groups,cn=accounts,dc=example,dc=com' \
    -e 'LDAP_USER_SEARCHBASE=cn=users,cn=accounts,dc=example,dc=com' \
    -e 'DB_KIND=postgresql' \
    -e 'DB_HOST=db_server.example.com' \
    -e 'DB_USERNAME=alfresco' \
    -e 'DB_PASSWORD=alfresco' \
    -e 'DB_NAME=alfresco' \
    gui81/alfresco

If you want to use this image in production, then please read on.

Configuration

Datastore

In production, you will want to make sure to specify and mount the
CONTENT_STORE and /alfresco/alf_data directories to persist this data. Example:

  • /content
  • /alfresco/alf_data

Volumes can be mounted by passing the '-v' option to the docker run command.
The following is an example:

docker run --name alfresco -it --rm -v /host/alfresco/content:/content -v /host/alfresco/data:/alfresco/alf_data

Database

If the DB_HOST environment variable is not set, or set to localhost, then the
image will use the internal PostgreSQL server.

PostgreSQL is the default, but MySQL/MariaDB is also supported. If you are
using an existing database installation, then make sure to create the database
and a user:

CREATE ROLE alfresco WITH LOGIN PASSWORD 'alfresco';
CREATE DATABASE alfresco;
GRANT ALL PRIVILEGES ON DATABASE alfresco TO alfresco;

Options

Below is the complete list of currently available parameters that can be set
using environment variables.

  • ALFRESCO_HOSTNAME: hostname of the Alfresco server; default = localhost
  • ALFRESCO_PORT: port for afresco to listen to; default = 8080 if protocol is http or 8443 if protocol is https
  • ALFRESCO_PROTOCOL: protocol used by alfresco to generate links; default = http
  • AMP_DIR_ALFRESCO: directory containing AMP files (modules) for alfresco.war (bind mount as volume)
  • AMP_DIR_SHARE: directory containing AMP files (modules) for share.war (bind mount as volume)
  • CIFS_ENABLED: whether or not to enable CIFS; default = true
  • CIFS_SERVER_NAME: hostname of the CIFS server; default = localhost
  • CIFS_DOMAIN: domain of the CIFS server; default = WORKGROUP
  • CONTENT_STORE: where content is stored; default = /content
  • DB_CONN_PARAMS: database connection parameters; for MySQL, default = ?useSSL=false, otherwise empty
  • DB_HOST: host of the database server; default = localhost
  • DB_KIND: postgresql or mysql; default = postgresql
  • DB_NAME: name of the database to connect to; default = alfresco
  • DB_PASSWORD: password to use when connecting to the database; default = admin
  • DB_USERNAME: username to use when connecting to the database; default = alfresco
  • FTP_PORT: port of the database server; default = 5432
  • LDAP_ENABLED: whether or not to enable LDAP; default = false
  • LDAP_KIND: ldap (e.g. for OpenLDAP) or ldap-ad (Active Directory); default = ldap
  • LDAP_AUTH_USERNAMEFORMAT: default = uid=%s,cn=users,cn=accounts,dc=example,dc=com
  • LDAP_URL: URL of LDAP server; default = ldap://ldap.example.com:389
  • LDAP_DEFAULT_ADMINS: comma separated list of admin names in ldap; default = admin
  • LDAP_SECURITY_PRINCIPAL: default = uid=admin,cn=users,cn=accounts,dc=example,dc=com
  • LDAP_SECURITY_CREDENTIALS: default = password
  • LDAP_GROUP_SEARCHBASE: default = cn=groups,cn=accounts,dc=example,dc=com
  • LDAP_USER_SEARCHBASE: default = cn=users,cn=accounts,dc=example,dc=com
  • MAIL_HOST: hostname or IP where email should be sent; default = localhost
  • MAIL_PORT: default = 25
  • MAIL_USERNAME: username to connect to the smtp server
  • MAIL_PASSWORD: password to connect to the smtp server
  • MAIL_FROM_DEFAULT: what is in the from field; default = alfresco@alfresco.org
  • MAIL_PROTOCOL: smtp or smtps; default = smtp
  • MAIL_SMTP_AUTH: is authentication required or not; default = false
  • MAIL_SMTP_STARTTLS_ENABLE: use starttls or not; default = false
  • MAIL_SMTPS_AUTH: is authentication required or not; default = false
  • MAIL_SMTPS_STARTTLS_ENABLE: use starttls or not; default = false
  • NFS_ENABLED: whether or not to enable NFS; default = true
  • SHARE_HOSTNAME: hostname of the share server; default = localhost
  • SHARE_PORT: port for share to listen to; default = 8080 if protocol is http or 8443 if protocol is https
  • SHARE_PROTOCOL: protocol use by share to generate links; default = http
  • SYSTEM_SERVERMODE: the server running mode for you system; default = PRODUCTION
  • TOMCAT_CSRF_ENABLED: Disable the tomcat CSRF policy; default = false

Upgrading

TODO: I might be able to add some options that aid in upgrading. For now though,
backup, backup, backup, and then follow this guide:

References

Docker Pull Command
Owner
gui81
Source Repository

Comments (13)
eramos
8 days ago

Hi,

I'm using Active Directory and I'm unable to login using LDAP.

I add LDAP_KIND=ldap-ad and change uid for cn.

Anybody is using with AD for help me?

albertorugnone
14 days ago

Hi, great work
I have an additional request:
Is it possible add alfresco installation parameter like --installer-language

jveerd
8 months ago

Not an Alfresco expert at all, but sharing my experience in migrating data. Hope it helps someone.

Step 1
create content and logs folder

Step 2
docker run --name='alfresco' -it --rm -p 445:445 -p 7070:7070 -p 8080:8080 \
-v '/host/alfresco/content:/content' \
-v '/host/alfresco/logs:/alfresco/tomcat/logs' \
-e 'CONTENT_STORE=/content' \
-e 'LDAP_ENABLED=true' \
-e 'LDAP_AUTH_USERNAMEFORMAT=uid=%s,cn=users,cn=accounts,dc=example,dc=com' \
-e 'LDAP_URL=ldap://ipa.example.com:389' \
-e 'LDAP_DEFAULT_ADMINS=admin' \
-e 'LDAP_SECURITY_PRINCIPAL=uid=admin,cn=users,cn=accounts,dc=example,dc=com' \
-e 'LDAP_SECURITY_CREDENTIALS=password' \
-e 'LDAP_GROUP_SEARCHBASE=cn=groups,cn=accounts,dc=example,dc=com' \
-e 'LDAP_USER_SEARCHBASE=cn=users,cn=accounts,dc=example,dc=com' \
-e 'DB_KIND=postgresql' \
-e 'DB_HOST=localhost' \
-e 'DB_USERNAME=alfresco' \
-e 'DB_PASSWORD=admin' \
-e 'DB_NAME=alfresco' \
gui81/alfresco

Step 3
cp -rp /alfresco/alf_data /alfresco/tomcat/logs/
cp -rp to /home/alfresco/alf_data

Step 4
docker run --name='alfresco' -it --rm -p 445:445 -p 7070:7070 -p 8080:8080 \
-v '/host/alfresco/content:/content' \
-v '/host/alfresco/logs:/alfresco/tomcat/logs' \
-v '/host/alfresco/alf_data:/alfresco/alf_data' \
-e 'CONTENT_STORE=/content' \
-e 'LDAP_ENABLED=true' \
-e 'LDAP_AUTH_USERNAMEFORMAT=uid=%s,cn=users,cn=accounts,dc=example,dc=com' \
-e 'LDAP_URL=ldap://ipa.example.com:389' \
-e 'LDAP_DEFAULT_ADMINS=admin' \
-e 'LDAP_SECURITY_PRINCIPAL=uid=admin,cn=users,cn=accounts,dc=example,dc=com' \
-e 'LDAP_SECURITY_CREDENTIALS=password' \
-e 'LDAP_GROUP_SEARCHBASE=cn=groups,cn=accounts,dc=example,dc=com' \
-e 'LDAP_USER_SEARCHBASE=cn=users,cn=accounts,dc=example,dc=com' \
-e 'DB_KIND=postgresql' \
-e 'DB_HOST=localhost' \
-e 'DB_USERNAME=alfresco' \
-e 'DB_PASSWORD=admin' \
-e 'DB_NAME=alfresco' \
gui81/alfresco

Step 5
./pg_restore -U alfresco -d alfresco -c filename.tar

Step 6
copy content store content

Step 7
remove solr4 indexes

Step 8
docker run ...

zopyx
a year ago

Running the image on two docker hosts does not work (anymore).

docker run --name='alfresco' -it --rm -p 8080:8080 gui81/alfresco
2016-03-02 13:23:26,137 CRIT Supervisor running as root (no user in config file)
2016-03-02 13:23:26,141 INFO supervisord started with pid 1
2016-03-02 13:23:27,143 INFO spawned: 'alfresco' with pid 10
2016-03-02 13:23:28,226 INFO success: alfresco entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2016-03-02 13:23:35,256 INFO exited: alfresco (exit status 0; expected)

mathiasconradt
a year ago

When I try to build the docker image on Mac OS, it works fine. When I build it on Windows though, I am getting this error:

Step 5 : RUN /tmp/install_java.sh && rm -f /tmp/install_java.sh
---> Running in 9637e52ef9c6
: No such file or directory
The command '/bin/sh -c /tmp/install_java.sh && rm -f /tmp/install_java.sh' returned a non-zero code: 127

due to the line:

#!/usr/bin/env sh

in install_java.sh.

Does anyone have an idea why that is? Why should the host system matter here?

mathiasconradt
a year ago

For those having trouble with mounting a volume, take a look at this issue and the comments. https://github.com/gui81/docker-alfresco/issues/2

mathiasconradt
a year ago

@paulne: I am getting the same issues. As soon as I mount a volume to /alfresco/alf_data/, Alfresco fails to start with the following error: http://pastebin.com/W27Fy5TN (org.alfresco.error.AlfrescoRuntimeException: 01230001 Keystores are invalid, etc.)

credondocr
a year ago

What's happened with the email configuration? we can configure to using other custom options?

snakefeb
a year ago

I met the same issue as paulne said. troubleshooting now......

paulne
a year ago

If I create a container without attaching a local volume I can log in to Alfresco without issue. However, as soon as I add a local volume for persistence the admin/admin credentials no longer seem to work and I can't log in to Alfresco. Does anyone know why this might be? Am I missing a step?