@@ -7,53 +7,75 @@ ARG BGR=1.7
7
7
ARG CTD=0.3.0
8
8
ARG MAT=0.1
9
9
10
- # ## 2. Get Java and all required system libraries
10
+ # Configuration options:
11
+ # - ${USERNAME} is the name of the non-root user to create.
12
+ ARG USERNAME=nru
13
+ # - ${USERID} is the UID of the non-root user.
14
+ ARG USERID=1001
15
+ # - ${DATA} is where the writeable data volume should be mounted.
16
+ ARG DATA=/data
17
+ # - ${TOOLS} is where the writeable tools volume should be mounted.
18
+ ARG TOOLS=/tools
11
19
20
+ # ## 2. Get Java and all required system libraries
12
21
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
13
22
14
- RUN apt-get update \
15
- && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
23
+ RUN apt-get update
24
+ RUN DEBIAN_FRONTEND="noninteractive" apt-get upgrade -y --no-install-recommends
25
+ RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
16
26
software-properties-common \
17
27
build-essential \
18
28
openjdk-11-jdk-headless \
19
29
git \
20
30
make \
21
31
curl \
22
32
tar \
33
+ vim \
23
34
screen \
24
35
rsync \
25
- locales \
26
- && locale-gen "en_US.UTF-8"
36
+ locales
37
+ RUN locale-gen "en_US.UTF-8"
38
+
39
+ # ##### SCALA-CLI ######
40
+ RUN curl -fLo scala-cli.deb https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-pc-linux.deb \
41
+ && dpkg -i scala-cli.deb
42
+
43
+ # ## 3. Set up the $DATA and $TOOLS directory.
44
+ RUN mkdir -p ${DATA}
45
+ RUN mkdir -p ${TOOLS}
27
46
47
+ # ## 4. Set up a non-root user.
48
+ RUN useradd --uid ${USERID} -m ${USERNAME}
49
+ RUN chown ${USERNAME} ${DATA}
50
+ RUN chown ${USERNAME} ${TOOLS}
51
+ USER ${USERNAME}
28
52
29
- # ## 3 . Install custom tools
30
- WORKDIR /tools
53
+ # ## 5 . Install custom tools
54
+ WORKDIR $TOOLS
31
55
32
56
# ##### JENA ######
33
57
RUN curl -O -L http://archive.apache.org/dist/jena/binaries/apache-jena-$JENA.tar.gz \
34
58
&& tar -zxf apache-jena-$JENA.tar.gz
35
- ENV PATH "/tools /apache-jena-$JENA/bin:$PATH"
59
+ ENV PATH "$TOOLS /apache-jena-$JENA/bin:$PATH"
36
60
37
61
# ##### BLAZEGRAPH-RUNNER ######
38
62
RUN curl -O -L https://github.com/balhoff/blazegraph-runner/releases/download/v$BGR/blazegraph-runner-$BGR.tgz \
39
63
&& tar -zxf blazegraph-runner-$BGR.tgz \
40
64
&& chmod +x /tools/blazegraph-runner-$BGR
41
- ENV PATH "/tools /blazegraph-runner-$BGR/bin:$PATH"
65
+ ENV PATH "$TOOLS /blazegraph-runner-$BGR/bin:$PATH"
42
66
43
67
# ##### MATERIALIZER ######
44
68
RUN curl -O -L https://github.com/balhoff/materializer/releases/download/v$MAT/materializer-$MAT.tgz \
45
69
&& tar -zxf materializer-$MAT.tgz \
46
70
&& chmod +x /tools/materializer-$MAT
47
- ENV PATH "/tools /materializer-$MAT/bin:$PATH"
71
+ ENV PATH "$TOOLS /materializer-$MAT/bin:$PATH"
48
72
49
73
# ##### CTD-TO-OWL ######
50
74
RUN curl -O -L https://github.com/balhoff/ctd-to-owl/releases/download/v$CTD/ctd-to-owl-$CTD.tgz \
51
75
&& tar -zxf ctd-to-owl-$CTD.tgz \
52
76
&& chmod +x /tools/ctd-to-owl-$CTD
53
- ENV PATH "/tools /ctd-to-owl-$CTD/bin:$PATH"
77
+ ENV PATH "$TOOLS /ctd-to-owl-$CTD/bin:$PATH"
54
78
55
- # ##### SCALA-CLI ######
56
- RUN curl -fLo scala-cli.deb https://github.com/Virtuslab/scala-cli/releases/latest/download/scala-cli-x86_64-pc-linux.deb \
57
- && dpkg -i scala-cli.deb
79
+ # ## 6. Start in the $DATA directory.
80
+ WORKDIR $DATA
58
81
59
- RUN useradd --system --uid 1001 -m cam
0 commit comments