-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (45 loc) · 1.88 KB
/
Dockerfile
File metadata and controls
61 lines (45 loc) · 1.88 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM debian:buster
ARG GH_ACTIONS_RUNNER_VERSION=2.278.0
ARG PACKAGES="gnupg2 apt-transport-https ca-certificates software-properties-common pwgen git make curl wget zip libicu-dev build-essential libssl-dev"
# install basic stuff
RUN apt-get update \
&& apt-get install -y -q ${PACKAGES} \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# install docker
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& apt-key fingerprint 0EBFCD88 \
&& add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable" \
&& apt-get update \
&& apt-get install -y docker-ce-cli \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
&& chmod +x /usr/local/bin/docker-compose
# create "runner" user
RUN useradd -d /runner --uid=1000 runner \
&& echo 'runner:runner' | chpasswd \
&& mkdir /runner \
&& chown -R runner:runner /runner
# install SUDO within docker and add runner user to sudoers
RUN apt-get update \
&& apt-get -y install sudo \
&& adduser runner sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get update \
&& apt-get install -y -q nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g yarn truffle
USER runner
WORKDIR /runner
# install github actions runner
RUN curl -o actions-runner-linux-x64.tar.gz -L https://github.com/actions/runner/releases/download/v${GH_ACTIONS_RUNNER_VERSION}/actions-runner-linux-x64-${GH_ACTIONS_RUNNER_VERSION}.tar.gz \
&& tar xzf ./actions-runner-linux-x64.tar.gz \
&& rm -f actions-runner-linux-x64.tar.gz
COPY start.sh /
CMD /start.sh