-
Notifications
You must be signed in to change notification settings - Fork 1
/
opensilex-build-step.docker
43 lines (36 loc) · 1.54 KB
/
opensilex-build-step.docker
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
FROM tomcat:9.0.89-jre11-temurin-jammy
ARG OPENSILEX_RELEASE_TAG=$OPENSILEX_RELEASE_TAG
ARG INTERNAL_DATA_DIRECTORY=$INTERNAL_DATA_DIRECTORY
ARG USERNAME=opensilex
ARG UID=$UID
ARG GID=$GID
RUN groupadd --gid $GID $USERNAME \
&& useradd --uid $UID --gid $GID -m $USERNAME \
#
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
# ********************************************************
# * Anything else you want to do like clean up goes here *
# ********************************************************
ENV RELEASE https://github.com/OpenSILEX/opensilex/releases/download/$OPENSILEX_RELEASE_TAG/opensilex-release-$OPENSILEX_RELEASE_TAG.zip
RUN apt-get -y update && apt-get install -y wget zip gettext-base libc6 libc-bin rsync
RUN mkdir -p /home/$USERNAME
RUN mkdir -p /home/$USERNAME/$INTERNAL_DATA_DIRECTORY
RUN mkdir -p /home/$USERNAME/config
RUN mkdir -p /home/$USERNAME/data
RUN mkdir -p /home/$USERNAME/logs
RUN mkdir -p /home/$USERNAME/bin/modules
RUN chown $USERNAME:$USERNAME -R /home/$USERNAME
USER $USERNAME
WORKDIR /home/$USERNAME/bin
RUN wget -nv ${RELEASE}
RUN unzip $( basename ${RELEASE} )
RUN ls
COPY ./bin/opensilex.sh /home/$USERNAME/bin/
COPY ./bin/logback.xml /home/$USERNAME/bin/
COPY ./config/opensilex-template.yml /home/$USERNAME/config/
COPY ./config/other /home/$USERNAME/config/other
WORKDIR /home/$USERNAME