Skip to content

Commit

Permalink
ci: almalinux:9-minimal as based image with java17
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed Aug 11, 2023
1 parent a565601 commit 27d348c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
22 changes: 9 additions & 13 deletions packages/tar/src/main/container/Dockerfile
@@ -1,27 +1,28 @@

# Minimalistic Java image
FROM alpine:3.15
FROM almalinux:9-minimal

ENV DCACHE_INSTALL_DIR=/opt/dcache

# Run dCache as user 'dcache'
RUN addgroup dcache && adduser -S -G dcache dcache

# Add JRE
RUN apk --no-cache add openjdk11 --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
RUN microdnf -y install shadow-utils java-17-openjdk-headless openssh-clients

# Run dCache as user 'dcache'
RUN groupadd dcache && useradd -r -g dcache dcache

# Add dCache
COPY maven /opt/dcache

# generate ssh keys
RUN apk --update add openssh
RUN ssh-keygen -t rsa -b 2048 -N '' -f ${DCACHE_INSTALL_DIR}/etc/admin/ssh_host_rsa_key
RUN chown dcache:dcache ${DCACHE_INSTALL_DIR}/etc/admin/ssh_host_rsa_key

# fix liquibase
#RUN rm ${DCACHE_INSTALL_DIR}/share/classes/liquibase-core-*.jar
#COPY liquibase-core-3.5.3.jar ${DCACHE_INSTALL_DIR}/share/classes/liquibase-core-3.5.3.jar

# Post-install brutal cleanup
RUN microdnf clean all && rm -rf /var/cache/yum /var/lib/dnf /var/lib/rpm

# add external files into container at the build time
COPY je.properties ${DCACHE_INSTALL_DIR}/var/nfs/je.properties
Expand All @@ -31,17 +32,12 @@ COPY exports ${DCACHE_INSTALL_DIR}/etc/exports
COPY run.sh /run.sh

# where we store the data
RUN mkdir /pool

# location of init scripts
RUN mkdir /dcache.init.d

# Stupid grid tools....
RUN mkdir -p /etc/grid-security/certificates
RUN mkdir -p /pool /dcache.init.d /etc/grid-security/certificates

# adjust permissions
RUN chown -R dcache:dcache ${DCACHE_INSTALL_DIR}/var
RUN chown -R dcache:dcache /pool
RUN chown -R dcache:dcache ${DCACHE_INSTALL_DIR}/var /pool

# the data log files must survive container restarts
VOLUME ${DCACHE_INSTALL_DIR}/var
Expand Down
8 changes: 8 additions & 0 deletions packages/tar/src/main/container/run.sh
Expand Up @@ -42,5 +42,13 @@ fi
-Ddcache.home=${DCACHE_HOME} \
-Ddcache.paths.defaults=${DCACHE_HOME}/share/defaults \
-Dzookeeper.sasl.client=false \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.util=ALL-UNNAMED \
--add-opens=java.base/java.net=ALL-UNNAMED \
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED \
--add-opens=java.base/java.text=ALL-UNNAMED \
--add-opens=java.sql/java.sql=ALL-UNNAMED \
--add-opens=java.base/java.math=ALL-UNNAMED \
--add-opens=java.base/sun.nio.fs=ALL-UNNAMED \
${JAVA_ARGS} \
org.dcache.boot.BootLoader start ${DOMAIN}

0 comments on commit 27d348c

Please sign in to comment.