@@ -7,53 +7,75 @@ ARG BGR=1.7
77ARG CTD=0.3.0
88ARG MAT=0.1
99
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
1119
20+ # ## 2. Get Java and all required system libraries
1221ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
1322
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 \
1626 software-properties-common \
1727 build-essential \
1828 openjdk-11-jdk-headless \
1929 git \
2030 make \
2131 curl \
2232 tar \
33+ vim \
2334 screen \
2435 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}
2746
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}
2852
29- # ## 3 . Install custom tools
30- WORKDIR /tools
53+ # ## 5 . Install custom tools
54+ WORKDIR $TOOLS
3155
3256# ##### JENA ######
3357RUN curl -O -L http://archive.apache.org/dist/jena/binaries/apache-jena-$JENA.tar.gz \
3458 && 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"
3660
3761# ##### BLAZEGRAPH-RUNNER ######
3862RUN curl -O -L https://github.com/balhoff/blazegraph-runner/releases/download/v$BGR/blazegraph-runner-$BGR.tgz \
3963 && tar -zxf blazegraph-runner-$BGR.tgz \
4064 && chmod +x /tools/blazegraph-runner-$BGR
41- ENV PATH "/tools /blazegraph-runner-$BGR/bin:$PATH"
65+ ENV PATH "$TOOLS /blazegraph-runner-$BGR/bin:$PATH"
4266
4367# ##### MATERIALIZER ######
4468RUN curl -O -L https://github.com/balhoff/materializer/releases/download/v$MAT/materializer-$MAT.tgz \
4569 && tar -zxf materializer-$MAT.tgz \
4670 && chmod +x /tools/materializer-$MAT
47- ENV PATH "/tools /materializer-$MAT/bin:$PATH"
71+ ENV PATH "$TOOLS /materializer-$MAT/bin:$PATH"
4872
4973# ##### CTD-TO-OWL ######
5074RUN curl -O -L https://github.com/balhoff/ctd-to-owl/releases/download/v$CTD/ctd-to-owl-$CTD.tgz \
5175 && tar -zxf ctd-to-owl-$CTD.tgz \
5276 && 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"
5478
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
5881
59- RUN useradd --system --uid 1001 -m cam
0 commit comments