forked from irods/irods_development_environment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
irods_runner.centos7.Dockerfile
108 lines (98 loc) · 3.38 KB
/
irods_runner.centos7.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# syntax=docker/dockerfile:1.5
#
# iRODS Runner
#
ARG runner_base=centos:7
FROM ${runner_base} as irods-runner
SHELL [ "/bin/bash", "-c" ]
# Make sure we're starting with an up-to-date image
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
sed -i \
-e 's/mirror.centos.org/vault.centos.org/g' \
-e 's/^#.*baseurl=http/baseurl=http/g' \
-e 's/^mirrorlist=http/#mirrorlist=http/g' \
/etc/yum.repos.d/*.repo && \
yum update -y || [ "$?" -eq 100 ] && \
rm -rf /tmp/*
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
yum install -y \
epel-release \
sudo \
wget \
&& \
sed -i \
-e 's/mirror.centos.org/vault.centos.org/g' \
-e 's/^#.*baseurl=http/baseurl=http/g' \
-e 's/^mirrorlist=http/#mirrorlist=http/g' \
/etc/yum.repos.d/*.repo && \
rm -rf /tmp/*
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
yum install -y \
openssl-devel \
lsof \
postgresql-server \
unixODBC-devel \
&& \
yum install -y \
python36 \
python3-distro \
python36-jsonschema \
python36-psutil \
python36-requests \
&& \
rm -rf /tmp/*
# For Python3 modules not available as packages:
# python3-devel must be installed because pyodbc requires building
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
--mount=type=cache,target=/root/.cache/pip,sharing=locked \
--mount=type=cache,target=/root/.cache/wheel,sharing=locked \
yum install -y \
gcc-c++ \
make \
python3-devel \
python3-pip \
&& \
python3 -m pip install \
pyodbc \
&& \
rm -rf /tmp/*
# install and configure rsyslog
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
yum install -y \
rsyslog \
&& \
sed -i -e 's/\$ModLoad\s\+\([a-z]\+\)/module(load="\1")/' /etc/rsyslog.conf && \
rm -rf /tmp/*
COPY irods.rsyslog /etc/rsyslog.d/00-irods.conf
COPY irods.logrotate /etc/logrotate.d/irods
# irodsauthuser required for some tests
# UID and GID ranges picked to hopefully not overlap with anything
RUN useradd \
--key UID_MIN=40050 \
--key UID_MAX=49000 \
--key GID_MIN=40050 \
--key GID_MAX=49000 \
--create-home \
--shell /bin/bash \
irodsauthuser && \
echo 'irodsauthuser:;=iamnotasecret' | chpasswd
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
rpm --import https://packages.irods.org/irods-signing-key.asc && \
wget -qO - https://packages.irods.org/renci-irods.yum.repo | sudo tee /etc/yum.repos.d/renci-irods.yum.repo && \
rpm --import https://core-dev.irods.org/irods-core-dev-signing-key.asc && \
wget -qO - https://core-dev.irods.org/renci-irods-core-dev.yum.repo | sudo tee /etc/yum.repos.d/renci-irods-core-dev.yum.repo && \
yum check-update -y || { rc=$?; [ "$rc" -eq 100 ] && exit 0; exit "$rc"; } && \
rm -rf /tmp/*
ARG irods_version="4.2.0"
RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \
yum install -y \
'irods-externals*' \
irods-runtime-${irods_version} \
irods-icommands-${irods_version} \
irods-server-${irods_version} \
irods-database-plugin-postgres-${irods_version} \
&& \
rm -rf /tmp/*
COPY ICAT.sql /
COPY --chmod=755 keep_alive.sh /keep_alive.sh
ENTRYPOINT ["/keep_alive.sh"]