Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: "Print the host info"
Expand Down
55 changes: 12 additions & 43 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
ARG DEBIAN_VERSION=11.2
ARG KERNEL_VERSION=5.15
ARG GOLANG_VERSION=1.17.6
ARG DEBIAN_VERSION=12.9
ARG GOLANG_VERSION=1.24.1
ARG DOCKER_CHANNEL=stable
ARG DOCKER_VERSION=5:20.10.12~3-0~debian-bullseye
ARG SLIRP4NETNS_VERSION=1.2.0-beta.0

FROM debian:$DEBIAN_VERSION as kernel_build

RUN \
apt-get update && \
apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc wget flex bison libelf-dev -y && \
apt-get install -y --no-install-recommends libarchive-tools

ARG KERNEL_VERSION

RUN \
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-$KERNEL_VERSION.tar.xz && \
tar -xf linux-$KERNEL_VERSION.tar.xz && \
rm linux-$KERNEL_VERSION.tar.xz

WORKDIR linux-$KERNEL_VERSION
COPY KERNEL.config .config
RUN make ARCH=um oldconfig && make ARCH=um prepare
RUN make ARCH=um -j `nproc`
RUN mkdir /out && cp -f linux /out/linux

RUN cp .config /KERNEL.config

# usage: docker build -t foo --target print_config . && docker run -it --rm foo > KERNEL.config
FROM debian:$DEBIAN_VERSION AS print_config
COPY --from=kernel_build /KERNEL.config /KERNEL.CONFIG
CMD ["cat", "/KERNEL.CONFIG"]
# TODO: support Docker v28 (may need changing the design of diuid-docker-proxy)
ARG DOCKER_VERSION=5:27.5.1-1~debian.12~bookworm

FROM golang:$GOLANG_VERSION AS diuid-docker-proxy
COPY diuid-docker-proxy /go/src/github.com/weber-software/diuid/diuid-docker-proxy
Expand All @@ -44,23 +16,28 @@ LABEL maintainer="weber@weber-software.com"
RUN \
apt-get update && \
apt-get install -y wget net-tools openssh-server psmisc rng-tools \
apt-transport-https ca-certificates gnupg2 software-properties-common iptables iproute2
apt-transport-https ca-certificates gnupg2 software-properties-common iptables iproute2 \
user-mode-linux slirp4netns kmod

RUN \
update-alternatives --set iptables /usr/sbin/iptables-legacy && \
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

RUN \
mkdir /root/.ssh && \
mkdir -p /root/.ssh && \
ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N "" && \
cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys

RUN \
mkdir -p /lib/modules && \
ln -s /usr/lib/uml/modules/$(linux --version) /lib/modules/$(linux --version)

#install docker
ARG DOCKER_CHANNEL
ARG DOCKER_VERSION
RUN \
wget -O - https://download.docker.com/linux/debian/gpg | apt-key add - && \
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) $DOCKER_CHANNEL" && \
echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) $DOCKER_CHANNEL" > /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-cache madison docker-ce && \
apt-get install -y docker-ce=$DOCKER_VERSION docker-ce-cli=$DOCKER_VERSION containerd.io
Expand All @@ -69,14 +46,6 @@ RUN \
COPY --from=diuid-docker-proxy /diuid-docker-proxy /usr/bin
RUN echo GatewayPorts=yes >> /etc/ssh/sshd_config

#install slirp4netns (used by UML)
ARG SLIRP4NETNS_VERSION
RUN \
wget -O /usr/bin/slirp4netns https://github.com/rootless-containers/slirp4netns/releases/download/v${SLIRP4NETNS_VERSION}/slirp4netns-x86_64 && \
chmod +x /usr/bin/slirp4netns

#install kernel and scripts
COPY --from=kernel_build /out/linux /linux/linux
ADD kernel.sh kernel.sh
ADD entrypoint.sh entrypoint.sh
ADD init.sh init.sh
Expand Down
Loading