-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
60 lines (50 loc) · 1.67 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
FROM mmore500/conduit@sha256:8fdf051fb36163216e85bd0f162070a2224b2736874eee48bdd6fa1ace5efc99
USER root
COPY . /opt/signalgp-lite
RUN \
apt-get update -qq \
&& \
apt-get install -y --allow-downgrades --no-install-recommends \
rename \
libdwarf-dev \
&& \
apt-get clean \
&& \
rm -rf /var/lib/apt/lists/* \
&& \
echo "installed apt packages"
# install scripts associated with Python packages to /usr/local/bin
RUN \
python3 -m pip install --timeout 60 --retries 100 --upgrade pip==21.3.1 \
&& \
pip3 install --timeout 60 --retries 100 --ignore-installed -r /opt/signalgp-lite/docs/requirements.txt \
&& \
pip3 install --timeout 60 --retries 100 --ignore-installed -r /opt/signalgp-lite/third-party/requirements.txt \
&& \
echo "installed Python packages"
# make sure unprivileged user has access to new files in opt
# adapted from https://stackoverflow.com/a/27703359
# and https://superuser.com/a/235398
RUN \
chgrp --recursive user /opt/signalgp-lite \
&& \
chmod --recursive g+rwx /opt/signalgp-lite \
&& \
echo "user granted permissions to /opt/signalgp-lite"
USER user
# Define default working directory.
WORKDIR /opt/signalgp-lite
# must be installed as user for executable to be available on PATH
RUN \
pip3 install --timeout 60 --retries 100 editorconfig-checker==2.3.54 \
&& \
ln -s /home/user/.local/bin/ec /home/user/.local/bin/editorconfig-checker \
&& \
echo "installed editorconfig-checker"
# adapted from https://askubuntu.com/a/799306
# and https://stackoverflow.com/a/38905161
ENV PATH "/home/user/.local/bin:$PATH"
RUN \
make install-test-dependencies \
&& \
echo "installed test dependencies"