Commit 615a6762 authored by Martin Muller's avatar Martin Muller

the first commit

parents
test
\ No newline at end of file
*.class
# Ignore concrete installer
installer/
# Eclipse
.classpath
.settings
.project
# Intellij
.idea/
*.iml
*.iws
# Mac
.DS_Store
# Maven
target/
overlays/
*.log
*.log.*
# Mobile Tools for Java (J2ME)
.mtj
.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
target/docker/
\ No newline at end of file
FROM debian:jessie
ENV ALF_INSTALLER_DIR /alfresco/installer
ENV ALFRESCO_HOME /opt/alfresco
ENV GLOBAL_PROPS $ALFRESCO_HOME/tomcat/shared/classes/alfresco-global.properties
ENV ALF_INSTALL_OPTIONS_FILE install_options.txt
#RUN apt-get update && \
# DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/*
RUN mkdir -p $ALF_INSTALLER_DIR
COPY resources/$ALF_INSTALL_OPTIONS_FILE $ALF_INSTALLER_DIR/
COPY installer/*.bin $ALF_INSTALLER_DIR/
RUN chmod +x $ALF_INSTALLER_DIR/*.bin && $ALF_INSTALLER_DIR/*.bin --optionfile $ALF_INSTALLER_DIR/$ALF_INSTALL_OPTIONS_FILE && rm -r $ALF_INSTALLER_DIR
RUN touch $ALFRESCO_HOME/tomcat/logs/catalina.out
COPY resources $ALFRESCO_HOME/tomcat/shared/classes/alfresco/extension/
RUN mkdir $ALFRESCO_HOME/tomcat/shared/classes/alfresco/module
RUN mkdir $ALFRESCO_HOME/tomcat/shared/classes/alfresco/module/my-hack
COPY resources $ALFRESCO_HOME/tomcat/shared/classes/alfresco/module/my-hack
COPY resources $ALFRESCO_HOME/tomcat/shared/classes/alfresco/web-extension/
# You need to run `mvn clean install` in the root of this project to update the following dependencies
# Copy the JDBC drivers for the database you are using to the lib/ directory.
COPY target/connector/* $ALFRESCO_HOME/tomcat/lib/
# Copy the amps from build context to the image for installing it manually later
COPY target/amps/* /alfresco/
#Enable debugging on port 8000
RUN sed -i "s/exec \"\$PRGDIR\"\/\"\$EXECUTABLE\" start \"\$@\"/exec \"\$PRGDIR\"\/\"\$EXECUTABLE\" jpda start \"\$@\"/" $ALFRESCO_HOME/tomcat/bin/startup.sh
COPY resources $ALFRESCO_HOME/
RUN chmod +x $ALFRESCO_HOME/docker_start.sh
EXPOSE 8080
CMD /bin/bash -c $ALFRESCO_HOME/docker_start.sh
## ACS 5.2 docker image with installer
This is a simple project for creating a 5.2 docker image using an installer. As well it provides some sort of to 6.N migration mechanism through docker compose.
### Quick start
- Put the Linux installer in 'installer/'
- Build the image with ```docker build . --tag alf52``` or use Maven Profile ```mvn clean install -Palf52Docker```
- Use the docker compose in /test for spinning up 5.2.N or 6.N e.g.: ```docker-compose up mysql alf52```
### Thanks
To Alex Mukha. This project was strongly inspired from his project in https://gitlab.alfresco.com/innovation/docked/tree/master/dev/alf-cluster
\ No newline at end of file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.alfresco</groupId>
<version>0.0.1</version>
<artifactId>alf52-docker</artifactId>
<name>Alfresco Enterprise 5.2 Image made from Installer</name>
<packaging>pom</packaging>
<properties>
<image.name>alfresco/alf52docker</image.name>
<image.registry>quay.io</image.registry>
<alfresco.s3connector.version>2.1.0</alfresco.s3connector.version>
<dependency.mysql.version>5.1.42</dependency.mysql.version>
<dependency.mariadb.version>2.2.5</dependency.mariadb.version>
<dependency.fabric8.version>3.5.37</dependency.fabric8.version>
</properties>
<distributionManagement>
<repository>
<id>alfresco-internal</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/enterprise-releases</url>
</repository>
<snapshotRepository>
<id>alfresco-internal-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/enterprise-snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>org.alfresco.integrations</groupId>
<artifactId>alfresco-s3-connector</artifactId>
<version>${alfresco.s3connector.version}</version>
<type>amp</type>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${dependency.mariadb.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${dependency.mysql.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/connector</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/connector</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<id>copy-resources-amps</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.alfresco.integrations</groupId>
<artifactId>alfresco-s3-connector</artifactId>
<type>amp</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/amps</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${dependency.fabric8.version}</version>
<configuration>
<images>
<image>
<name>${image.name}</name>
<build>
<dockerFileDir>${project.basedir}/</dockerFileDir>
</build>
</image>
</images>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>alf52Docker</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${dependency.fabric8.version}</version>
<executions>
<execution>
<id>build-image</id>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
\ No newline at end of file
#heartbeat.enabled=true
#heartbeat.target.url=https://6dq8ekdk0g.execute-api.us-east-1.amazonaws.com/Stage/ingest
#log4j.logger.org.opensaml=debug
#log4j.logger.org.alfresco.repo.security.authentication.saml=debug
#!/bin/bash
# Fix host and port in alfresco-global.properties
sed -i 's:^[ \t]*alfresco.host[ \t]*=\([ \t]*.*\)$:alfresco.host=localhost:' $GLOBAL_PROPS
sed -i 's:^[ \t]*share.host[ \t]*=\([ \t]*.*\)$:share.host=localhost:' $GLOBAL_PROPS
sed -i 's:^[ \t]*alfresco.port[ \t]*=\([ \t]*.*\)$:alfresco.port=80:' $GLOBAL_PROPS
sed -i 's:^[ \t]*share.port[ \t]*=\([ \t]*.*\)$:share.port=80:' $GLOBAL_PROPS
# Configure Alfresco Clustering
echo -e '\n
alfresco.cluster.enabled=false\n
alfresco.hazelcast.mancenter.enabled=false\n
\n
dir.remote=/opt/alfresco/alf_data_shared\n
dir.contentstore=${dir.remote}/contentstore\n
dir.contentstore.deleted=${dir.remote}/contentsore.deleted\n
' >> $GLOBAL_PROPS
# Configure Tomcat
sed -i "s|^[ \t]*<Engine name=\"Catalina\" defaultHost=\"localhost\">[ \t]*|<Engine name=\"Catalina\" defaultHost=\"localhost\" jvmRoute=\"$ENV_NODE_NAME\">|" $ALFRESCO_HOME/tomcat/conf/server.xml
# Configure Share
# First delete the last tag
sed -i '/^[ \t]*<\/alfresco-config>/d' $ALFRESCO_HOME/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml
# Then add the config with the last tag
echo -e ' <config evaluator="string-compare" condition="CSRFPolicy" replace="true">\n
<filter/>\n
</config>\n
</alfresco-config>\n
' >> $ALFRESCO_HOME/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml
# Start alfresco (exits immediately running the server as a daemon)
$ALFRESCO_HOME/alfresco.sh start
# Long running process that will keep the daemonised docker process alive
# and may be seen with 'docker logs [-f] alfresco' where alfresco is the name of the container.
tail -f $ALFRESCO_HOME/tomcat/logs/catalina.out
mode=unattended
enable-components=javaalfresco,alfrescosolr4,libreofficecomponent
disable-components=postgres
# Use JDBC settings for an existing database
jdbc_url=jdbc:mysql://mysql:3306/alfresco?useUnicode=yes&characterEncoding=UTF-8
jdbc_driver=com.mysql.jdbc.Driver
jdbc_database=alfresco
jdbc_username=alfresco
jdbc_password=alfresco
alfresco_admin_password=admin
prefix=/opt/alfresco
baseunixservice_install_as_service=0
mode=unattended
enable-components=javaalfresco,alfrescosolr4,libreofficecomponent
disable-components=postgres
# Use JDBC settings for an existing database
jdbc_url=jdbc:postgresql://postgres:5432/alfresco
jdbc_driver=org.postgresql.Driver
jdbc_database=alfresco
jdbc_username=alfresco
jdbc_password=alfresco
alfresco_admin_password=admin
prefix=/opt/alfresco
baseunixservice_install_as_service=0
version: '2'
services:
postgres:
image: postgres:10.1
mem_limit: 512m
environment:
- POSTGRES_PASSWORD=alfresco
- POSTGRES_USER=alfresco
- POSTGRES_DB=alfresco
command: postgres -c max_connections=300 -c log_min_messages=LOG
ports:
- 5432:5432
alf52:
image: alfresco/alf52dockerpostgres:latest
links:
- mysql
volumes:
- /tmp/data:/opt/alfresco/alf_data_shared
privileged: true
ports:
- 8080:8080 #Browser port
- 8000:8000 #Debug port
- 50500:50500 #RMI port service:jmx:rmi:///jndi/rmi://localhost:50500/jmxrmi
# Taking a 6.1 with s3 and mariadb driver
alfresco61:
image: alfresco/alfresco-content-repository:6.1.0-RC7
mem_limit: 1700m
volumes:
- /tmp/data:/alf_data
environment:
JAVA_OPTS: "
-Ddb.driver=org.postgresql.Driver
-Ddb.username=alfresco
-Ddb.password=alfresco
-Ddb.url=jdbc:postgresql://postgres:5432/alfresco
-Dshare.host=127.0.0.1
-Dshare.port=8080
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos
-Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\"
-Ddeployment.method=DOCKER_COMPOSE
-Dlocal.transform.service.enabled=true
-Dtransform.service.enabled=false
-Dcsrf.filter.enabled=false
-Ds3.accessKey=xxxx
-Ds3.secretKey=xxxx
-Ds3.bucketName=xxxx
-Ds3.bucketLocation=us-east-1
-Ds3.encryption=kms
-Ds3.awsKmsKeyId=alias/xxxx
-Xms1500m -Xmx1500m
"
ports:
- 8080:8080 #Browser port
share:
image: alfresco/alfresco-share:6.1.0-RC3
mem_limit: 1g
environment:
REPO_HOST: "alfresco"
REPO_PORT: "8080"
JAVA_OPTS: "
-Xms500m
-Xmx500m
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Dalfresco.context=alfresco
-Dalfresco.protocol=http
"
activemq:
image: alfresco/alfresco-activemq:5.15.6
mem_limit: 1g
ports:
- 8161:8161 # Web Console
- 5672:5672 # AMQP
- 61616:61616 # OpenWire
- 61613:61613 # STOMP
#volumes:
# alf_data:
# driver: local
version: '2'
services:
mysql:
image: mysql:5.7.23
hostname: mysql
environment:
MYSQL_PASSWORD: alfresco
MYSQL_USER: alfresco
MYSQL_DATABASE: alfresco
MYSQL_ROOT_PASSWORD: alfresco
ports:
- 3306:3306
alf52:
image: alfresco/alf52docker:latest
links:
- mysql
volumes:
- /tmp/data:/opt/alfresco/alf_data_shared
privileged: true
ports:
- 8080:8080 #Browser port
- 8000:8000 #Debug port
- 50500:50500 #RMI port service:jmx:rmi:///jndi/rmi://localhost:50500/jmxrmi
# Taking a 6.1 with s3 and mariadb driver
alfresco:
image: alfresco/alfresco-content-repository-aws:6.1.0-RC7
mem_limit: 1700m
volumes:
- /tmp/data:/usr/local/tomcat/alf_data
environment:
JAVA_OPTS: "
-Ddb.driver=org.mariadb.jdbc.Driver
-Ddb.username=alfresco
-Ddb.password=alfresco
-Ddb.url='jdbc:mysql://mysql:3306/alfresco?useUnicode=yes&characterEncoding=UTF-8'
-Dshare.host=127.0.0.1
-Dshare.port=8080
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos
-Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\"
-Ddeployment.method=DOCKER_COMPOSE
-Dlocal.transform.service.enabled=true
-Dtransform.service.enabled=false
-Dcsrf.filter.enabled=false
-Ds3.accessKey=xxxx
-Ds3.secretKey=xxxx
-Ds3.bucketName=xxxx
-Ds3.bucketLocation=us-east-1
-Ds3.encryption=kms
-Ds3.awsKmsKeyId=alias/xxx
-Xms1500m -Xmx1500m
"
ports:
- 8080:8080 #Browser port
share:
image: alfresco/alfresco-share:6.1.0-RC3
mem_limit: 1g
environment:
REPO_HOST: "alfresco"
REPO_PORT: "8080"
JAVA_OPTS: "
-Xms500m
-Xmx500m
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Dalfresco.context=alfresco
-Dalfresco.protocol=http
"
ports:
- 8081:8080 #Browser port
activemq:
image: alfresco/alfresco-activemq:5.15.6
mem_limit: 1g
ports:
- 8161:8161 # Web Console
- 5672:5672 # AMQP
- 61616:61616 # OpenWire
- 61613:61613 # STOMP
#volumes:
# alf_data:
# driver: local
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment