Debian Codegraph @

hack/Dockerfile.compilation-test

raw
1 # Dockerfile for testing compilation with an old version of the kernel headers.
2
3 ARG GOLANG_VERSION=1.19
4 # LINUX_VERSION must be >= 4.12 (https://github.com/torvalds/linux/commit/fcc8487d477a3452a1d0ccbdd4c5e0e1e3cb8bed)
5 ARG LINUX_VERSION=4.12
6
7 FROM golang:${GOLANG_VERSION}
8 ARG LINUX_VERSION
9 RUN curl -sSL -O "https://mirrors.edge.kernel.org/pub/linux/kernel/v$(echo ${LINUX_VERSION} | cut -d. -f1).x/linux-${LINUX_VERSION}.tar.gz"
10 RUN tar Cxzf / "linux-${LINUX_VERSION}.tar.gz" && \
11 cd "/linux-${LINUX_VERSION}" && \
12 make headers_install INSTALL_HDR_PATH=/usr2 && \
13 for f in /usr2/include/*; do rm -rf "/usr/include/$(basename ${f})"; done && \
14 cp -a /usr2/include /usr
15
16 COPY . /go/src/github.com/containerd/btrfs
17 WORKDIR /go/src/github.com/containerd/btrfs
18 RUN make binaries