1 | FROM ubuntu:16.04
|
2 | ARG NPM_TOKEN
|
3 |
|
4 | RUN apt-get update && apt-get install -y curl git sudo openjdk-8-jdk unzip
|
5 | RUN curl -sL https://raw.githubusercontent.com/binaris/711/master/ubuntu/gradle/4.10.a.sh | sudo -E bash -
|
6 | RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
7 | RUN sudo apt-get install -y nodejs jq gradle
|
8 |
|
9 | ENV TINI_VERSION v0.16.1
|
10 | RUN curl -sL https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini -o /tini
|
11 | RUN chmod +x /tini
|
12 | ENTRYPOINT ["/tini", "--"]
|
13 |
|
14 | RUN groupadd -r dockeruser &&\
|
15 | useradd -r -g dockeruser -m -d /home/dockeruser -s /sbin/nologin dockeruser
|
16 | RUN echo 'dockeruser:binaris' | chpasswd
|
17 | RUN usermod -aG sudo dockeruser
|
18 | RUN chown -R dockeruser:dockeruser /home/dockeruser
|
19 | ENV HOME=/home/dockeruser
|
20 |
|
21 | RUN groupadd docker
|
22 | RUN gpasswd -a dockeruser docker
|
23 | USER dockeruser
|
24 | RUN chmod g+s /home/dockeruser
|
25 | RUN mkdir -p ~/.node
|
26 | RUN mkdir -p ~/binaris
|
27 | RUN mkdir -p ~/test
|
28 | WORKDIR $HOME
|
29 |
|
30 | RUN echo "prefix = ~/.node" >> ~/.npmrc
|
31 | ENV PATH=$HOME/.node/bin:$PATH
|
32 | ENV NODE_PATH="$HOME/.node/lib/node_modules:$NODE_PATH"
|
33 | ENV MANPATH="$HOME/.node/share/man:$MANPATH"
|
34 |
|
35 | WORKDIR /home/dockeruser/binaris
|
36 | COPY ./package.json /home/dockeruser/binaris
|
37 | RUN npm install --save-dev
|
38 | COPY . /home/dockeruser/binaris
|
39 | RUN npm install -g
|
40 |
|
41 | WORKDIR $HOME/test
|