Skip to content
Snippets Groups Projects
Commit b4756b9e authored by Sjoerd Simons's avatar Sjoerd Simons
Browse files

Add docker image for running debos


Docker allows for an easy way to get a reproducible build environment,
add a docker file containing debos which can be used for image builds.

Signed-off-by: default avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: default avatarHéctor Orón Martínez <hector.oron@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D7243
parent dc96670c
No related branches found
No related tags found
No related merge requests found
......@@ -35,3 +35,29 @@ Create SDK image from prepared ospack:
```
debos --scratchsize 10G -t type:sdk -t suite:17.12 apertis-image-sdk.yaml
```
Building in docker
==================
To ease testing on a wide variaty of host systems (and building in Jenkins) a
docker file is provided which sets up the build environment. To build using
that:
* build the docker image:
```
docker build -t apertis-image-builder apertis-image-builder
```
* Run the image build in docker e.g:
```
docker run --device /dev/kvm -w /recipes \
-u $(id -u) \
--group-add=$(getent group kvm | cut -d : -f 3) \
-i -v $(pwd):/recipes -t apertis-image-builder \
debos apertis-ospack.yaml
```
The image build will be run in the build docker image using your uid with the
additional kvm group (for debian based systems) to ensure debos/fakemachine can
use hardware virtualisation. For fedora/Redhat based systems the group-add is
likely not needed.
FROM debian:stretch-slim
ARG DEBIAN_FRONTEND=noninteractive
ENV HOME=/recipes
ENV GOPATH=/usr/local/go
ENV PATH=$PATH:/usr/local/go/bin
# Always install procps in case the docker file gets used in jenkins
RUN apt update && apt-get install --no-install-recommends -y procps
RUN apt-get update && \
apt-get install -y --no-install-recommends apt-transport-https \
ca-certificates
RUN mkdir -p /etc/apt/sources.list.d
COPY apertis-tools.list /etc/apt/sources.list.d
RUN mkdir -p /etc/apt/trusted.gpg.d/
COPY collabora-obs-archive-keyring.gpg /etc/apt/trusted.gpg.d
RUN mkdir -p /etc/apt/preferences.d
COPY parted-apertis /etc/apt/preferences.d
# Bits needed to run fakemachine
RUN apt-get update && \
apt-get install --no-install-recommends -y qemu-system-x86 \
busybox \
linux-image-amd64 \
systemd \
dbus
# Bits needed to build debos
RUN apt-get update && \
apt-get install --no-install-recommends -y golang-go \
git \
libostree-dev \
gcc \
libc6-dev \
pkg-config
# Bits to build the image
RUN apt-get update && \
apt-get install --no-install-recommends -y parted \
e2fsprogs \
dosfstools \
qemu-user-static \
binfmt-support \
python3 \
bmap-tools \
rsync \
systemd-container \
openssh-client \
debootstrap \
libnss-wrapper \
ostree
# build debos
RUN go get github.com/go-debos/debos/cmd/debos && \
go install github.com/go-debos/debos/cmd/debos
deb https://repositories.apertis.org/debian/ stretch tools
File added
Package: parted
Pin: release o=Apertis
Pin-Priority: 1000
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