forked from rootless-containers/slirp4netns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.buildtests
71 lines (62 loc) · 3.06 KB
/
Dockerfile.buildtests
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
ARG LIBSLIRP_COMMIT=v4.3.1
# Alpine
FROM alpine:3 AS buildtest-alpine3-static
RUN apk add --no-cache git build-base autoconf automake libtool linux-headers glib-dev glib-static libcap-static libcap-dev libseccomp-dev git meson
RUN git clone https://gitlab.freedesktop.org/slirp/libslirp.git /libslirp
WORKDIR /libslirp
ARG LIBSLIRP_COMMIT
RUN git pull && git checkout ${LIBSLIRP_COMMIT} && meson setup --default-library=both build && ninja -C build install
COPY . /src
WORKDIR /src
RUN ./autogen.sh && ./configure LDFLAGS="-static" && make && cp -f slirp4netns /
# Ubuntu
FROM ubuntu:18.04 AS buildtest-ubuntu1804-common
RUN apt update && apt install -y automake autotools-dev make gcc libglib2.0-dev libcap-dev libseccomp-dev git ninja-build python3-pip
RUN pip3 install meson
RUN git clone https://gitlab.freedesktop.org/slirp/libslirp.git /libslirp
WORKDIR /libslirp
ARG LIBSLIRP_COMMIT
RUN git pull && git checkout ${LIBSLIRP_COMMIT} && meson setup build && ninja -C build install
COPY . /src
WORKDIR /src
RUN ./autogen.sh
FROM buildtest-ubuntu1804-common AS buildtest-ubuntu1804-dynamic
RUN ./configure && make && cp -f slirp4netns /
# CentOS
FROM centos:7 AS buildtest-centos7-common
RUN yum install -y epel-release
RUN yum install -y autoconf automake gcc glib2-devel git make libcap-devel libseccomp-devel ninja-build python3-pip
RUN pip3 install meson
RUN git clone https://gitlab.freedesktop.org/slirp/libslirp.git /libslirp
WORKDIR /libslirp
ARG LIBSLIRP_COMMIT
RUN git pull && git checkout ${LIBSLIRP_COMMIT} && meson setup --default-library=both --prefix=/usr build && ninja-build -C build install
COPY . /src
WORKDIR /src
RUN ./autogen.sh
FROM buildtest-centos7-common AS buildtest-centos7-dynamic
RUN ./configure && make && cp -f slirp4netns /
FROM buildtest-centos7-common AS buildtest-centos7-static
RUN yum install -y glibc-static glib2-static
RUN yum-config-manager --add-repo=https://buildlogs.centos.org/centos/7/virt/x86_64/container && \
yum install --nogpgcheck -y libseccomp-static
RUN ./configure LDFLAGS="-static" && make && cp -f slirp4netns /
# openSUSE (dynamic only)
FROM opensuse/leap:15 AS buildtest-opensuse15-common
RUN zypper install -y --no-recommends autoconf automake gcc glib2-devel git make libcap-devel libseccomp-devel ninja python3-pip
RUN pip3 install meson
RUN git clone https://gitlab.freedesktop.org/slirp/libslirp.git /libslirp
WORKDIR /libslirp
ARG LIBSLIRP_COMMIT
RUN git pull && git checkout ${LIBSLIRP_COMMIT} && meson setup --default-library=both build && ninja -C build install
COPY . /src
WORKDIR /src
RUN ./autogen.sh
FROM buildtest-opensuse15-common AS buildtest-opensuse15-dynamic
RUN ./configure && make && cp -f slirp4netns /
FROM scratch AS buildtest-final-stage
COPY --from=buildtest-alpine3-static /slirp4netns /buildtest-alpine3-static
COPY --from=buildtest-ubuntu1804-dynamic /slirp4netns /buildtest-ubuntu1804-dynamic
COPY --from=buildtest-centos7-dynamic /slirp4netns /buildtest-centos7-dynamic
COPY --from=buildtest-centos7-static /slirp4netns /buildtest-centos7-static
COPY --from=buildtest-opensuse15-dynamic /slirp4netns /buildtest-opensuse15-dynamic