-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (52 loc) · 1.49 KB
/
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
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
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM alpine:3.15 AS build-base
RUN apk update && apk add --quiet --no-cache \
build-base \
make \
;
################################################################################
FROM build-base AS procps
RUN apk add --quiet --no-cache \
git \
automake \
autoconf \
libtool \
gettext \
pkgconf \
gettext-dev \
;
WORKDIR /src
ARG PROCPS_VERSION
RUN git clone --depth 1 --single-branch --branch v${PROCPS_VERSION} \
https://gitlab.com/procps-ng/procps.git /src
COPY patches/procps-${PROCPS_VERSION}* /src
RUN git apply *.patch
RUN ./autogen.sh \
&& ./configure --without-ncurses --without-systemd \
&& make install-libLTLIBRARIES \
;
################################################################################
FROM build-base AS minit
ARG PROCPS_VERSION
RUN apk update && apk add --quiet --no-cache \
# linux-headers \
# musl-dev \
procps-dev~=${PROCPS_VERSION} \
;
WORKDIR /src
ENV LDFLAGS=-static
COPY --from=procps /usr/local/lib/libprocps.* /usr/local/lib
COPY Makefile minit.c /src
RUN make minit
################################################################################
FROM alpine:3.15 AS test
RUN apk update && apk add --quiet --no-cache \
valgrind \
;
COPY --from=minit /src/minit /usr/local/bin/minit
RUN valgrind -q /usr/local/bin/minit sleep 1
################################################################################
FROM scratch
COPY --from=minit /src/minit /usr/local/bin/minit
ENTRYPOINT ["minit"]
CMD ["minit"]
USER 65534:65534