forked from rootless-containers/slirp4netns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.buildtests
51 lines (44 loc) · 2.08 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
ARG LIBSLIRP_COMMIT=v4.7.0
# 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 libseccomp-static git meson
RUN git clone https://git.qemu.org/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
ENV DEBIAN_FRONTEND=noninteractive
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://git.qemu.org/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 7 is no longer tested in this file.
# See Vagrantfile for CentOS 7 tests.
# 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://git.qemu.org/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-opensuse15-dynamic /slirp4netns /buildtest-opensuse15-dynamic