-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.Dockerfile
29 lines (28 loc) · 965 Bytes
/
run.Dockerfile
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
FROM ubuntu:18.04 as perf
WORKDIR /
ADD sandbox/run/sources.txt /etc/apt/sources.list
RUN \
apt-get update -qq && \
apt-get install -y -q --no-upgrade --no-install-recommends \
dpkg-dev \
flex bison libbz2-dev libdw-dev libelf-dev systemtap-sdt-dev libaudit-dev \
libssl-dev libslang2-dev libunwind-dev libiberty-dev binutils-dev \
make build-essential \
&& \
apt-get source linux-image-unsigned-4.15.0-50-generic && \
apt-get clean && \
cd /linux-4.15.0/tools/perf && \
make -j LDFLAGS=-static CFLAGS='-DNDEBUG -O3' && \
cp perf /perf && \
rm -rf /linux-4.15.0
FROM alpine:3.11.2
COPY --from=perf perf /usr/local/bin/
ENV LOGIN=sandbox UID=2000 TIMEOUT=60
RUN mkdir -p "/in" && \
adduser -s /bin/sh -D -u ${UID} $LOGIN && \
chown -R $LOGIN:$LOGIN "/in"
WORKDIR "/in"
COPY sandbox/run/init.sh /opt/bin/init.sh
RUN chmod +x /opt/bin/init.sh
ENTRYPOINT ["/opt/bin/init.sh"]
USER ${UID}