Skip to content
Snippets Groups Projects
Commit 802c2285 authored by Christopher Obbard's avatar Christopher Obbard Committed by Emanuele Aina
Browse files

{image,flatpak}-builder: Install packaged version of debos


The user-mode-linux support for debos has now been merged upstream, the
packages have also been updated. Switch the builder images to use these
new packaged versions rather than installing from source.

Signed-off-by: default avatarChristopher Obbard <chris.obbard@collabora.com>
parent 841b271c
No related branches found
No related tags found
2 merge requests!155v2022dev1 ← v2022dev0 forward port: Automatic KVM/UML backend selection for Debos/Fakemachine,!93WIP: documentation-builder: Rebase on Apertis instead of Debian Buster
......@@ -2,41 +2,6 @@ ARG REGISTRY=registry.gitlab.apertis.org/infrastructure/apertis-docker-images
ARG RELEASE
ARG TAG=latest
# Build Debos from source to use the wip/uml fakemachine branch
# with the UML backend
FROM debian:buster-slim AS debos-builder
ENV DEBIAN_FRONTEND=noninteractive
ENV GOPATH=/usr/local/go
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
gcc \
git \
golang-go \
libc6-dev \
libostree-dev && \
rm -rf /var/lib/apt/lists/*
RUN go get -v -d github.com/go-debos/debos/cmd/debos
RUN git -C ${GOPATH}/src/github.com/go-debos/debos checkout -b uml d2ab9d3b08056c416bfbcd63c01199e14b2fc3b9 && \
git -C ${GOPATH}/src/github.com/go-debos/fakemachine checkout wip/uml && \
go install github.com/go-debos/debos/cmd/debos
# Build the slirp helpers, needed by UML for unprivileged networking
FROM rust:1.42-slim-buster AS slirp-builder
RUN echo 'deb http://deb.debian.org/debian bullseye main' > /etc/apt/sources.list.d/debian-bullseye.list && \
printf 'Package: *\nPin: release a=testing\nPin-Priority: 400\n' > /etc/apt/preferences.d/50-testing && \
apt-get update && \
apt-get install -y --no-install-recommends \
git \
libdbus-1-dev \
libglib2.0-dev \
libslirp-dev \
pkg-config && \
rm -rf /var/lib/apt/lists/*
RUN git clone https://gitlab.freedesktop.org/sjoerd/libslirp-rs -b wip/sjoerd/slirp-seq /tmp/libslirp-rs && \
cd /tmp/libslirp-rs && \
cargo install --all-features --verbose --path . --root /usr/local
# Build the main image
FROM $REGISTRY/$RELEASE-base:$TAG
ARG RELEASE
......@@ -47,7 +12,6 @@ ENV LC_ALL C.UTF-8
ENV HOME="/scratch"
ENV DEBIAN_FRONTEND=noninteractive
ENV GOPATH=/usr/local/go
# Need tmp to be somewhere we can write
# It needs to be a tmpfs with exec enabled
......@@ -61,12 +25,14 @@ RUN apt-get update && \
binutils \
ca-certificates \
curl \
debos \
devscripts \
elfutils \
flatpak \
flatpak-builder \
git \
libnss-wrapper \
libslirp-helper \
linux-image-amd64 \
openssh-client \
ostree \
......@@ -80,27 +46,10 @@ RUN apt-get update && \
qemu-utils \
qemu-user-static \
rsync \
systemd-container \
time \
user-mode-linux \
udev
# Create /lib/modules as fakemachine will try to mount the uml modules at that
# location
RUN mkdir -p /lib/modules
# FIXME: move to a packaged version
RUN apt-get update && \
apt-get install --no-install-recommends -y busybox systemd-container debootstrap
ENV PATH=$PATH:/usr/local/go/bin
COPY bin/debos-wrapper /usr/bin/debos
COPY --from=debos-builder ${GOPATH}/bin/debos ${GOPATH}/bin/debos.real
# FIXME: move to a packaged version
RUN apt-get update && \
apt-get install -y --no-install-recommends libslirp0
COPY --from=slirp-builder /usr/local/bin/* /usr/local/bin/
# FIXME: move to a packaged version
RUN git clone --branch apertis/$RELEASE --depth 1 https://gitlab.apertis.org/infrastructure/apertis-flatdeb.git /opt/apertis-flatdeb
......
#!/bin/sh
set -e
if [ -f /tmp/libslirp ]; then
rm /tmp/libslirp
fi
slirp-seq --listen-seqsocket-path=/tmp/libslirp \
--exit-with-parent &
exec debos.real "$@"
......@@ -2,41 +2,6 @@ ARG REGISTRY=registry.gitlab.apertis.org/infrastructure/apertis-docker-images
ARG RELEASE
ARG TAG=latest
# Build Debos from source to use the wip/uml fakemachine branch
# with the UML backend
FROM debian:buster-slim AS debos-builder
ENV DEBIAN_FRONTEND=noninteractive
ENV GOPATH=/usr/local/go
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
gcc \
git \
golang-go \
libc6-dev \
libostree-dev && \
rm -rf /var/lib/apt/lists/*
RUN go get -v -d github.com/go-debos/debos/cmd/debos
RUN git -C ${GOPATH}/src/github.com/go-debos/debos checkout -b uml d2ab9d3b08056c416bfbcd63c01199e14b2fc3b9 && \
git -C ${GOPATH}/src/github.com/go-debos/fakemachine checkout wip/uml && \
go install github.com/go-debos/debos/cmd/debos
# Build the slirp helpers, needed by UML for unprivileged networking
FROM rust:1.42-slim-buster AS slirp-builder
RUN echo 'deb http://deb.debian.org/debian bullseye main' > /etc/apt/sources.list.d/debian-bullseye.list && \
printf 'Package: *\nPin: release a=testing\nPin-Priority: 400\n' > /etc/apt/preferences.d/50-testing && \
apt-get update && \
apt-get install -y --no-install-recommends \
git \
libdbus-1-dev \
libglib2.0-dev \
libslirp-dev \
pkg-config && \
rm -rf /var/lib/apt/lists/*
RUN git clone https://gitlab.freedesktop.org/sjoerd/libslirp-rs -b wip/sjoerd/slirp-seq /tmp/libslirp-rs && \
cd /tmp/libslirp-rs && \
cargo install --all-features --verbose --path . --root /usr/local
# Build the main image
FROM $REGISTRY/$RELEASE-base:$TAG
ENV LANG=C.UTF-8
......@@ -46,7 +11,6 @@ ENV LC_ALL C.UTF-8
ENV HOME="/scratch"
ENV DEBIAN_FRONTEND=noninteractive
ENV GOPATH=/usr/local/go
# Need tmp to be somewhere we can write
# It needs to be a tmpfs with exec enabled
......@@ -64,6 +28,7 @@ RUN apt-get update && \
ca-certificates \
cryptsetup \
curl \
debos \
device-tree-compiler \
devscripts \
dosfstools \
......@@ -73,6 +38,8 @@ RUN apt-get update && \
jq \
kmod \
libnss-wrapper \
libslirp-helper \
linux-image-amd64 \
lqa \
mtd-utils \
openssh-client \
......@@ -84,27 +51,10 @@ RUN apt-get update && \
qemu-utils \
qemu-user-static \
rsync \
systemd-container \
user-mode-linux \
u-boot-tools \
udev
# Create /lib/modules as fakemachine will try to mount the uml modules at that
# location
RUN mkdir -p /lib/modules
# FIXME: move to a packaged version
RUN apt-get update && \
apt-get install --no-install-recommends -y busybox systemd-container debootstrap
ENV PATH=$PATH:/usr/local/go/bin
COPY bin/debos-wrapper /usr/bin/debos
COPY --from=debos-builder ${GOPATH}/bin/debos ${GOPATH}/bin/debos.real
# FIXME: move to a packaged version
RUN apt-get update && \
apt-get install -y --no-install-recommends libslirp0
COPY --from=slirp-builder /usr/local/bin/* /usr/local/bin/
# Defer libnss-unknown package installation to the end to avoid possible UID/GID problems
RUN apt-get update && \
apt-get install --no-install-recommends -y libnss-unknown
......
#!/bin/sh
set -e
if [ -f /tmp/libslirp ]; then
rm /tmp/libslirp
fi
slirp-seq --listen-seqsocket-path=/tmp/libslirp \
--exit-with-parent &
exec debos.real "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment