-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathDockerfile.prc_test.ubuntu
36 lines (32 loc) · 1.16 KB
/
Dockerfile.prc_test.ubuntu
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
ARG os_image
FROM ${os_image}
ARG log_output_dir=/tmp
ENV LOG_OUTPUT_DIR="$log_output_dir"
ARG py_N
ENV PY_N "$py_N"
RUN apt update
RUN apt install -y git netcat-openbsd sudo
RUN apt install -y python${py_N} python${py_N}-pip
RUN useradd -md /home/user -s /bin/bash user
RUN echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
WORKDIR /home/user
COPY ./ ./repo/
RUN chown -R user repo/
USER user
RUN pip${py_N} install --user --upgrade pip==20.3.4 # -- version specified for Ub16
RUN cd repo && python${py_N} -m pip install --user '.[tests]'
RUN python${py_N} repo/docker_build/iinit.py \
host irods-provider \
port 1247 \
user rods \
zone tempZone \
password rods
SHELL ["/bin/bash","-c"]
# -- At runtime: --
# 1. wait for provider to run.
# 2. give user group permissions to access shared irods directories
# 3. run python tests as the new group
CMD echo "Waiting on iRODS server... " ; \
python${PY_N} repo/docker_build/recv_oneshot -h irods-provider -p 8888 -t 360 && \
sudo groupadd -o -g $(stat -c%g /irods_shared) irods && sudo usermod -aG irods user && \
newgrp irods < repo/run_python_tests.sh