Skip to content

Commit

Permalink
OPSEXP-2800 Add share component dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pmacius committed Sep 17, 2024
1 parent e2979b9 commit 14643d6
Show file tree
Hide file tree
Showing 10 changed files with 874 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ prepare_connectors: scripts/fetch-artifacts.sh setenv
@echo "Fetching all artifacts for Connectors targets"
@./scripts/fetch-artifacts.sh connector

prepare_share: scripts/fetch-artifacts.sh setenv
@echo "Fetching all artifacts for Share targets"
@./scripts/fetch-artifacts.sh share

prepare_all: scripts/fetch-artifacts.sh setenv
@echo "Fetching all artifacts"
@./scripts/fetch-artifacts.sh
Expand All @@ -77,6 +81,10 @@ connectors: prepare_connectors
@echo "Building Connectors images"
docker buildx bake ${DOCKER_BAKE_ARGS} connectors

share: prepare_share
@echo "Building Share images"
docker buildx bake ${DOCKER_BAKE_ARGS} share

all: docker-bake.hcl prepare_all
@echo "Building all images"
docker buildx bake ${DOCKER_BAKE_ARGS}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Using this tool to build Alfresco images requires:
require authentication
* Some Unix tools: `jq`, `wget`, `make`

Configuring the authentication to Alfresco NExus server must be dopne using the
Configuring the authentication to Alfresco Nexus server must be done using the
wget rc file `~/.wgetrc` or `~/.netrc`:

```sh
Expand Down
22 changes: 21 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group "default" {
targets = ["content_service", "enterprise-search", "ats", "tengines", "connectors"]
targets = ["content_service", "enterprise-search", "ats", "tengines", "connectors", "share"]
}

group "content_service" {
Expand All @@ -22,6 +22,10 @@ group "connectors" {
targets = ["connector_msteams", "connector_ms365"]
}

group "share" {
targets = ["share"]
}

variable "REGISTRY" {
default = "localhost"
}
Expand Down Expand Up @@ -546,3 +550,19 @@ target "connector_ms365" {
output = ["type=docker"]
platforms = split(",", "${TARGETARCH}")
}

target "share" {
context = "./share"
dockerfile = "Dockerfile"
inherits = ["tomcat_base"]
contexts = {
tomcat_base = "target:tomcat_base"
}
labels = {
"org.opencontainers.image.title" = "${PRODUCT_LINE} Share Enterprise"
"org.opencontainers.image.description" = "Alfresco Share Enterprise"
}
tags = ["${REGISTRY}/${REGISTRY_NAMESPACE}alfresco-share:${TAG}"]
output = ["type=docker"]
platforms = split(",", "${TARGETARCH}")
}
33 changes: 33 additions & 0 deletions share/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM tomcat_base

USER root
EXPOSE 8000

RUN mkdir -p ${CATALINA_HOME}/shared/classes/alfresco/web-extension \
${CATALINA_HOME}/amps_share \
${CATALINA_HOME}/webapps/share/ \
${CATALINA_HOME}/alfresco-mmt/ \
/licenses

COPY substituter.sh ${CATALINA_HOME}/shared/classes/alfresco

ADD distribution /tmp/
ENV DISTDIR="/tmp/distribution"

RUN yum install -y unzip xmlstarlet && \
unzip /tmp/*.zip -d ${DISTDIR} &&\
unzip ${DISTDIR}/alfresco*/web-server/webapps/share.war -d ${CATALINA_HOME}/webapps/share/ &&\
cp ${DISTDIR}/alfresco*/bin/* ${CATALINA_HOME}/alfresco-mmt/ &&\
cp -r ${DISTDIR}/alfresco*/amps ${CATALINA_HOME}/amps_share &&\
cp ${DISTDIR}/alfresco*/web-extension-samples/custom-slingshot-application-context.xml.sample ${CATALINA_HOME}/shared/classes/alfresco/web-extension &&\
cp ${DISTDIR}/alfresco*/web-extension-samples/smartfolders-amp-actions-config.xml ${CATALINA_HOME}/shared/classes/alfresco/web-extension &&\
cp /tmp/share-config-custom.xml ${CATALINA_HOME}/shared/classes/alfresco/web-extension &&\
rm -rf ${DISTDIR} /tmp &&\
sed -i "s/shared.loader=/shared.loader=\${catalina.base}\/shared\/classes/" ${CATALINA_HOME}/conf/catalina.properties &&\
chmod +x ${CATALINA_HOME}/shared/classes/alfresco/substituter.sh &&\
yum clean all && rm -rf /var/cache/yum

RUN java -jar ${CATALINA_HOME}/alfresco-mmt/alfresco-mmt*.jar install \
${CATALINA_HOME}/amps_share ${CATALINA_HOME}/webapps/share -directory -nobackup -force

ENTRYPOINT ["/usr/local/tomcat/shared/classes/alfresco/substituter.sh", "catalina.sh run"]
Empty file added share/README.md
Empty file.
14 changes: 14 additions & 0 deletions share/artifacts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"artifacts": {
"acs23": [
{
"name": "alfresco-content-services-share-distribution",
"version": "23.2.2",
"path": "share/distribution",
"classifier": ".zip",
"group": "org.alfresco",
"repository": "enterprise-releases"
}
]
}
}
17 changes: 17 additions & 0 deletions share/distribution/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Alfresco Content Services share distribution

Place here the version of Alfresco Content Services share distribution you want to
use in your Docker image.
Distribution file must be a ZIP file with the expected structure of an Alfresco
Content Services share distribution.

```tree
amps/
bin/
web-extension-samples/
web-server/
|_webapps/
|_conf/
|_Catalina/
|_localhost/
```
Loading

0 comments on commit 14643d6

Please sign in to comment.