Generate a docker Ubuntu based image for Alfresco Community v5.2.0 with Alfresco Share v5.2.f (see https://sourceforge.net/projects/alfresco/files/Alfresco%20201707%20Community/alfresco-community-installer-201707-linux-x64.bin)
The Dockerfile builds from "dockerfile/ubuntu" see https://hub.docker.com/_/ubuntu/
cd _folder-containing-Dockerfile_
sudo docker build -t _image-name_ .
Examples:
sudo docker build -t alfresco-5.2.0 .
A more complete example is located here
sudo docker run -d -e INITIAL_PASS=_initial-pass_ -t -i -p 8443:8443 _image-name_
Example:
sudo docker run -d -e INITIAL_PASS=admun -t -i -p 8443:8443 alfresco-5.2.0
Note:
Fortunately you can download the pre build image from the corresponding docker hub automatic build using the following command.
docker pull pdubois/docker-alfresco
Values for jvm heap size can be specified using the "XMX" and "XMS" parameters. "XMX" value corresponds to the "-XmxM" and "XMS" to "-XmsM". Default values for for Xmx and Xms are both 2048M.
Example:
sudo docker run -d -e INITIAL_PASS=admun -e XMS=1024 -e XMX=5120 -t -i -p 8443:8443 alfresco-5.2.0
sudo docker stop -t <SECONDS> <CONTAINER ID>
The above command will stop your container with a grace period of SECONDS. Grace period gives the opportunity to alfresco process to stop gracefully ( example: flushing buffers). The “entry.sh” script executed while starting traps SIGTERM signal and calls execute “/opt/alfresco/alfresco.sh stop” when container is stopped.
Exit code of the container can be checked using following command:
sudo docker inspect -f '{{.State.ExitCode}}' <CONTAINER ID>
Under normal circumstance exit code should be “0”. Reasonable value for "SECONDS" is 60.
The approach applied is to use dedicated container for volume sharing between host and container.
Decide where to locate your content, index and database files on your host and create directory for it.
Example:
mkdir /home/phil/compose/alf_data
Creating the container for content, index and database pointing to the folder created in Step1
Example:
docker create -v /home/phil/compose/alf_data:/opt/alfresco/alf_data --name phil-volumes ubuntu /bin/true
Notes:
Start your container using volume from container created on "Step 2"
docker run -d -e INITIAL_PASS=admun \
-e ALF_1=mail.host=smtp.gmail.com \
put your options here...
--volumes-from phil-volumes \
-t -i -p 8450:8443 pdubois/docker-alfresco
Notes:
The same can be achieved using a single command "docker-compose":
The "./yml-with-volumes/docker-compose.yml" under stack descriptor can be used as follows
version: '3'
services:
alfresco:
image: "pdubois/docker-alfresco:master"
volumes:
- ${INDEX_AND_DATA}:/opt/alfresco/alf_data
ports:
- "8443"
environment:
- INITIAL_PASS=admun
Adjust value in of "INDEX_AND_DATA" in ".env" file to indicate your index, content and DB files location on your host. From the "./yml-with-volumes" folder start stack with
sudo docker-compose up
Depending on the environment variable CONTAINER_FUNCTION value passed when running container your container will run Alfresco and postgres together if CONTAINER_FUNCTION is undefined. If CONTAINER_FUNCTION equals tomcat it will start tomcat with Alfresco deployed but no DB. DB will run in a separate container called postgres3 in the example here under. Database creation script will be ran from the "tomcat" container when started initially.
To run this example a dedicated docker network will be created (see: https://docs.docker.com/engine/userguide/networking/)
# create a dedicated network to run in isolation
docker network create --driver bridge isolated_nw
# starting db tier on the network
docker run --network=isolated_nw --name postgres3 -e POSTGRES_PASSWORD=mysecretpassword -d postgres:9.4.4
# starting Alfresco tier
docker run --network=isolated_nw -d -e INITIAL_PASS=admun -e CONTAINER_FUNCTION=tomcat -e ALF_1='db.url.EQ.jdbc:postgresql:\/\/postgres3:5432\/${db.name}' -e ALF_2='db.password.EQ.mysecretpassword' -e DB_CONTAINER_NAME=postgres3 -e ALF_3='db.username.EQ.postgres' -t -i -p 8443 alfresco
Alternatively, you can use docker-compose to start database container and Alfresco tier in one single command. Here under the docker-compose.yml file content:
version: '2'
services:
alfresco:
image: "pdubois/docker-alfresco:master"
ports:
- "8443"
environment:
- INITIAL_PASS=admun
- CONTAINER_FUNCTION=tomcat
- ALF_1=db.url.EQ.jdbc:postgresql:\/\/postgres:5432\/alfresco
- ALF_2=db.password.EQ.mysecretpassword
- ALF_3=db.username.EQ.postgres
- DB_CONTAINER_NAME=postgres
depends_on:
- postgres
postgres:
image: postgres:9.4.4
environment:
- POSTGRES_PASSWORD=mysecretpassword
To start the stack in a single command:
docker-compose up
A more complete example including search server 1.0.0 based on SOLR6 can be found here
The folder nginx-alfresco-80 contains a yml file starting Alfresco on port 80 havin nginx in front of it.
Before starting it with "docker-compose up" host name you are deploying to should be set in ".env" file.
Content type
Image
Digest
sha256:352fb67e0…
Size
1.7 GB
Last updated
over 10 years ago
docker pull pdubois/docker-alfresco