-
Notifications
You must be signed in to change notification settings - Fork 131
/
Dockerfile
65 lines (49 loc) · 1.96 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Minimalistic Java image
FROM almalinux:9-minimal
ENV DCACHE_INSTALL_DIR=/opt/dcache
# Neede by groupadd and useradd
# REVISIT: in some environments base OS kernel doesnt allow use of xattrs and the installation of
# shadow-utils fails.
# RUN microdnf -y install shadow-utils
# Run dCache as user 'dcache'
#
# REVISIT: as we cant use groupadd and useradd add user/group manually
#
# RUN groupadd dcache && useradd -r -g dcache dcache
RUN echo "dcache:x:1000:" >> /etc/group
RUN echo "dcache:x:994:1000::/home/dcache:/bin/bash" >> /etc/passwd
RUN echo "dcache:!!:18438::::::" >> /etc/shadow
# Add JRE
RUN microdnf -y install java-17-openjdk-headless
# Add dCache
COPY maven /opt/dcache
# RUN microdnf -y install openssh-clients
# generate ssh keys
# 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
COPY dcache.conf ${DCACHE_INSTALL_DIR}/etc/dcache.conf
COPY docker-layout.conf ${DCACHE_INSTALL_DIR}/etc/layouts/docker-layout.conf
COPY exports ${DCACHE_INSTALL_DIR}/etc/exports
COPY run.sh /run.sh
# where we store the data
# location of init scripts
# Stupid grid tools....
RUN mkdir -p /pool /dcache.init.d /etc/grid-security/certificates
# adjust permissions
RUN chown -R dcache:dcache ${DCACHE_INSTALL_DIR}/var /pool
# the data log files must survive container restarts
VOLUME ${DCACHE_INSTALL_DIR}/var
VOLUME /pool
VOLUME /dcache.init.d
# expose TCP ports for network services
EXPOSE 2288 22125 2049 32049 22224
ENTRYPOINT ["/run.sh"]
# run as user dcache
USER dcache