File size: 1,438 Bytes
8aa0467
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.8.1

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

RUN apt-get update && \
      apt-get install -y sudo tmux wget curl htop make tree nano vim cloc && \
      apt-get install -y graphviz pandoc && \
      apt-get install -y iputils-ping telnet && \
      apt-get install -y git git-lfs

RUN --mount=type=secret,id=PASSWORD,mode=0444,required=true \
      useradd -m -u 1000 user && \
      echo "user:$(cat /run/secrets/PASSWORD)" | chpasswd && \
      adduser user sudo

RUN pip install -U pip pysocks
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
     
USER user
ENV HOME=/home/user
ENV PATH=$HOME/.local/bin:$PATH
ENV SHELL=/bin/bash

WORKDIR $HOME

RUN mkdir -p $HOME/runner && \
      cd $HOME/runner && \
      curl -o actions-runner-linux-x64-2.317.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.317.0/actions-runner-linux-x64-2.317.0.tar.gz && \
      echo "9e883d210df8c6028aff475475a457d380353f9d01877d51cc01a17b2a91161d  actions-runner-linux-x64-2.317.0.tar.gz" | shasum -a 256 -c && \
      tar xzf ./actions-runner-linux-x64-2.317.0.tar.gz

COPY --chown=user . $HOME/app

RUN cp $HOME/app/how_to_use_github_action_runner.md $HOME/how_to_use_github_action_runner.md
COPY .bashrc $HOME/.bashrc_append
RUN cat $HOME/.bashrc_append >> $HOME/.bashrc && \
      rm $HOME/.bashrc_append

EXPOSE     7860
ENTRYPOINT []
CMD        ["/bin/bash", "./app/run.sh"]