Skip to content

Commit

Permalink
Use common way of poiting to Dockerfile in order to get more clear ba…
Browse files Browse the repository at this point in the history
…ke summary (#31)
  • Loading branch information
pmacius authored Aug 7, 2024
1 parent 8ef97f3 commit 96dfcfd
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 40 deletions.
4 changes: 2 additions & 2 deletions ats/sfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG ALFRESCO_SFS_GROUP_ID
ARG ALFRESCO_SFS_USER_NAME
ARG ALFRESCO_SFS_USER_ID

ADD ats/sfs/alfresco-shared-file-store-controller*.jar /opt/app.jar
ADD alfresco-shared-file-store-controller*.jar /opt/app.jar

# Set default environment args
ARG FILE_STORE_DIR=/tmp/Alfresco
Expand All @@ -25,5 +25,5 @@ USER ${ALFRESCO_SFS_USER_NAME}
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=1m \
CMD curl -f http://localhost:8099/actuator/health || exit 1

COPY ats/sfs/entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
4 changes: 2 additions & 2 deletions ats/trouter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG ALFRESCO_TROUTER_GROUP_ID
ARG ALFRESCO_TROUTER_USER_NAME
ARG ALFRESCO_TROUTER_USER_ID

ADD ats/trouter/alfresco-transform-router*.jar /opt/app.jar
ADD alfresco-transform-router*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_TROUTER_GROUP_ID} ${ALFRESCO_TROUTER_GROUP_NAME} && \
useradd -u ${ALFRESCO_TROUTER_USER_ID} -g ${ALFRESCO_TROUTER_GROUP_NAME} ${ALFRESCO_TROUTER_USER_NAME} && \
Expand All @@ -19,5 +19,5 @@ USER ${ALFRESCO_TROUTER_USER_NAME}
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=1m \
CMD curl -f http://localhost:8095/actuator/health || exit 1

COPY ats/trouter/entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
33 changes: 22 additions & 11 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ variable "ALFRESCO_REPO_USER_NAME" {
}

target "java_base" {
dockerfile = "./java/Dockerfile"
context = "./java"
dockerfile = "Dockerfile"
args = {
DISTRIB_NAME = "${DISTRIB_NAME}"
DISTRIB_MAJOR = "${DISTRIB_MAJOR}"
Expand Down Expand Up @@ -141,7 +142,8 @@ variable "TCNATIVE_SHA512" {
}

target "tomcat_base" {
dockerfile = "./tomcat/Dockerfile"
context = "./tomcat"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand Down Expand Up @@ -208,7 +210,8 @@ target "search_liveindexing" {
args = {
LIVEINDEXING = "${liveindexing.artifact}"
}
dockerfile = "./search/enterprise/common/Dockerfile"
context = "./search/enterprise/common"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand All @@ -230,7 +233,8 @@ variable "ALFRESCO_TROUTER_USER_ID" {
}

target "ats_trouter" {
dockerfile = "./ats/trouter/Dockerfile"
context = "./ats/trouter"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand Down Expand Up @@ -258,7 +262,8 @@ variable "ALFRESCO_SFS_USER_ID" {
}

target "ats_sfs" {
dockerfile = "./ats/sfs/Dockerfile"
context = "./ats/sfs"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand Down Expand Up @@ -286,7 +291,8 @@ variable "ALFRESCO_IMAGEMAGICK_USER_ID" {
}

target "tengine_imagemagick" {
dockerfile = "./tengine/imagemagick/Dockerfile"
context = "./tengine/imagemagick"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand Down Expand Up @@ -314,7 +320,8 @@ variable "ALFRESCO_LIBREOFFICE_USER_ID" {
}

target "tengine_libreoffice" {
dockerfile = "./tengine/libreoffice/Dockerfile"
context = "./tengine/libreoffice"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand Down Expand Up @@ -342,7 +349,8 @@ variable "ALFRESCO_MISC_USER_ID" {
}

target "tengine_misc" {
dockerfile = "./tengine/misc/Dockerfile"
context = "./tengine/misc"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand Down Expand Up @@ -370,7 +378,8 @@ variable "ALFRESCO_TIKA_USER_ID" {
}

target "tengine_tika" {
dockerfile = "./tengine/tika/Dockerfile"
context = "./tengine/tika"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand Down Expand Up @@ -398,7 +407,8 @@ variable "ALFRESCO_PDFRENDERER_USER_ID" {
}

target "tengine_pdfrenderer" {
dockerfile = "./tengine/pdfrenderer/Dockerfile"
context = "./tengine/pdfrenderer"
dockerfile = "Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand Down Expand Up @@ -426,7 +436,8 @@ variable "ALFRESCO_AIO_USER_ID" {
}

target "tengine_aio" {
dockerfile = "./tengine/aio/Dockerfile"
context = "./tengine"
dockerfile = "aio/Dockerfile"
inherits = ["java_base"]
contexts = {
java_base = "target:java_base"
Expand Down
4 changes: 2 additions & 2 deletions search/enterprise/common/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ARG LIVEINDEXING
ENV PORT=8080
EXPOSE 8080

ADD search/enterprise/common/${LIVEINDEXING}*-app.jar /opt/app.jar
ADD ${LIVEINDEXING}*-app.jar /opt/app.jar

HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=1m \
CMD curl -f http://localhost:8080/actuator/health || exit 1

COPY search/enterprise/common/entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
7 changes: 3 additions & 4 deletions tengine/aio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM java_base
ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80

ENV COMMON_PATH=tengine
ENV AIO_COMMON_PATH=tengine/aio
ENV EPEL_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

EXPOSE 8090
Expand All @@ -13,7 +12,7 @@ ARG ALFRESCO_AIO_GROUP_ID
ARG ALFRESCO_AIO_USER_NAME
ARG ALFRESCO_AIO_USER_ID

RUN --mount=type=bind,source=${COMMON_PATH},target=/dist \
RUN --mount=type=bind,source=/,target=/dist \
mkdir /tmp/dist && \
tar xzf /dist/libreoffice/*.gz -C /tmp/dist && \
yum localinstall -y /tmp/dist/LibreOffice*/RPMS/*.rpm && \
Expand All @@ -25,7 +24,7 @@ RUN --mount=type=bind,source=${COMMON_PATH},target=/dist \
rm -rf /tmp/dist && \
yum clean all

ADD ${AIO_COMMON_PATH}/alfresco-transform-core-aio*.jar /opt/app.jar
ADD aio/alfresco-transform-core-aio*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_AIO_GROUP_ID} ${ALFRESCO_AIO_GROUP_NAME} && \
useradd -u ${ALFRESCO_AIO_USER_ID} -g ${ALFRESCO_AIO_GROUP_NAME} ${ALFRESCO_AIO_USER_NAME} && \
Expand All @@ -36,5 +35,5 @@ USER ${ALFRESCO_AIO_USER_NAME}
HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \
CMD curl -f http://localhost:8090/live || exit 1

COPY ${AIO_COMMON_PATH}/entrypoint.sh /entrypoint.sh
COPY aio/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
9 changes: 4 additions & 5 deletions tengine/imagemagick/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ EXPOSE 8090

ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80
ENV IMAGEMAGICK_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
ENV IMAGEMAGICK_COMMON_PATH=tengine/imagemagick

ARG ALFRESCO_IMAGEMAGICK_GROUP_NAME
ARG ALFRESCO_IMAGEMAGICK_GROUP_ID
ARG ALFRESCO_IMAGEMAGICK_USER_NAME
ARG ALFRESCO_IMAGEMAGICK_USER_ID

ADD ${IMAGEMAGICK_COMMON_PATH}/alfresco-transform-imagemagick*.jar /opt/app.jar
ADD ${IMAGEMAGICK_COMMON_PATH}/imagemagick-distribution*-el9.rpm /tmp/imagemagick-distribution-el9.rpm
ADD ${IMAGEMAGICK_COMMON_PATH}/libs/imagemagick-distribution*-libs-el9.rpm /tmp/imagemagick-distribution-libs-el9.rpm
ADD alfresco-transform-imagemagick*.jar /opt/app.jar
ADD imagemagick-distribution*-el9.rpm /tmp/imagemagick-distribution-el9.rpm
ADD libs/imagemagick-distribution*-libs-el9.rpm /tmp/imagemagick-distribution-libs-el9.rpm

RUN yum install -y $IMAGEMAGICK_DEP_RPM_URL && \
yum install -y /tmp/imagemagick-distribution-el9.rpm /tmp/imagemagick-distribution-libs-el9.rpm; \
Expand All @@ -28,5 +27,5 @@ USER ${ALFRESCO_IMAGEMAGICK_USER_NAME}
HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \
CMD curl -f http://localhost:8090/live || exit 1

COPY ${IMAGEMAGICK_COMMON_PATH}/entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
7 changes: 3 additions & 4 deletions tengine/libreoffice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM java_base

ENV LIBREOFFICE_COMMON_PATH=tengine/libreoffice
ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80

EXPOSE 8090
Expand All @@ -10,15 +9,15 @@ ARG ALFRESCO_LIBREOFFICE_GROUP_ID
ARG ALFRESCO_LIBREOFFICE_USER_NAME
ARG ALFRESCO_LIBREOFFICE_USER_ID

RUN --mount=type=bind,source=${LIBREOFFICE_COMMON_PATH},target=/dist \
RUN --mount=type=bind,source=/,target=/dist \
mkdir /tmp/dist && \
tar xzf /dist/*.gz -C /tmp/dist && \
yum localinstall -y /tmp/dist/LibreOffice*/RPMS/*.rpm && \
yum install -y cairo cups-libs libSM libGLU && \
rm -rf /tmp/dist && \
yum clean all

ADD ${LIBREOFFICE_COMMON_PATH}/alfresco-transform-libreoffice*.jar /opt/app.jar
ADD alfresco-transform-libreoffice*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_LIBREOFFICE_GROUP_ID} ${ALFRESCO_LIBREOFFICE_GROUP_NAME} && \
useradd -u ${ALFRESCO_LIBREOFFICE_USER_ID} -g ${ALFRESCO_LIBREOFFICE_GROUP_NAME} ${ALFRESCO_LIBREOFFICE_USER_NAME} && \
Expand All @@ -29,5 +28,5 @@ USER ${ALFRESCO_LIBREOFFICE_USER_NAME}
HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \
CMD curl -f http://localhost:8090/live || exit 1

COPY ${LIBREOFFICE_COMMON_PATH}/entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
5 changes: 2 additions & 3 deletions tengine/misc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM java_base

ENV MISC_COMMON_PATH=tengine/misc
ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80

EXPOSE 8090
Expand All @@ -10,7 +9,7 @@ ARG ALFRESCO_MISC_GROUP_ID
ARG ALFRESCO_MISC_USER_NAME
ARG ALFRESCO_MISC_USER_ID

ADD ${MISC_COMMON_PATH}/alfresco-transform-misc*.jar /opt/app.jar
ADD alfresco-transform-misc*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_MISC_GROUP_ID} ${ALFRESCO_MISC_GROUP_NAME} && \
useradd -u ${ALFRESCO_MISC_USER_ID} -g ${ALFRESCO_MISC_GROUP_NAME} ${ALFRESCO_MISC_USER_NAME} && \
Expand All @@ -21,5 +20,5 @@ USER ${ALFRESCO_MISC_USER_NAME}
HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \
CMD curl -f http://localhost:8090/live || exit 1

COPY ${MISC_COMMON_PATH}/entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
7 changes: 3 additions & 4 deletions tengine/pdfrenderer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM java_base

ENV PDFRENDERER_COMMON_PATH=tengine/pdfrenderer
ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80

EXPOSE 8090
Expand All @@ -10,11 +9,11 @@ ARG ALFRESCO_PDFRENDERER_GROUP_ID
ARG ALFRESCO_PDFRENDERER_USER_NAME
ARG ALFRESCO_PDFRENDERER_USER_ID

RUN --mount=type=bind,source=${PDFRENDERER_COMMON_PATH},target=/dist \
RUN --mount=type=bind,source=/,target=/dist \
tar xzf /dist/*.tgz -C /usr/bin && \
yum clean all

ADD ${PDFRENDERER_COMMON_PATH}/alfresco-transform-pdf-renderer*.jar /opt/app.jar
ADD alfresco-transform-pdf-renderer*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_PDFRENDERER_GROUP_ID} ${ALFRESCO_PDFRENDERER_GROUP_NAME} && \
useradd -u ${ALFRESCO_PDFRENDERER_USER_ID} -g ${ALFRESCO_PDFRENDERER_GROUP_NAME} ${ALFRESCO_PDFRENDERER_USER_NAME} && \
Expand All @@ -25,5 +24,5 @@ USER ${ALFRESCO_PDFRENDERER_USER_NAME}
HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \
CMD curl -f http://localhost:8090/live || exit 1

COPY ${PDFRENDERER_COMMON_PATH}/entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
5 changes: 2 additions & 3 deletions tengine/tika/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM java_base

ENV JAVA_OPTS_CONTAINER_FLAGS=-XX:MaxRAMPercentage=80
ENV TIKA_COMMON_PATH=tengine/tika
ENV TIKA_DEP_RPM_URL=https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

EXPOSE 8090
Expand All @@ -15,7 +14,7 @@ RUN yum install -y ${TIKA_DEP_RPM_URL} && \
yum -y install perl-Image-ExifTool && \
yum clean all

ADD ${TIKA_COMMON_PATH}/alfresco-transform-tika*.jar /opt/app.jar
ADD alfresco-transform-tika*.jar /opt/app.jar

RUN groupadd -g ${ALFRESCO_TIKA_GROUP_ID} ${ALFRESCO_TIKA_GROUP_NAME} && \
useradd -u ${ALFRESCO_TIKA_USER_ID} -g ${ALFRESCO_TIKA_GROUP_NAME} ${ALFRESCO_TIKA_USER_NAME} && \
Expand All @@ -26,5 +25,5 @@ USER ${ALFRESCO_TIKA_USER_NAME}
HEALTHCHECK --interval=20s --timeout=10s --retries=3 --start-period=30s \
CMD curl -f http://localhost:8090/live || exit 1

COPY ${TIKA_COMMON_PATH}/entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]

0 comments on commit 96dfcfd

Please sign in to comment.