From 7e44c032c8368cab0152196b87d6a3b5cac6d1e5 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 10 Jan 2018 14:13:49 -0500 Subject: [PATCH] experiments-and-demos: New subdir with skopeo2ostree Dockerfile Before I went all in on jigdo I was playing around with doing a build from `Dockerfile` of something that looked like Atomic Host, and then importing that build into an ostree repo. For a lot of reasons, I think this is not the way to go in general right now, but let's keep this demo around so we can pick things up back later if we want to (or someone else does). Closes: #1193 Approved by: jlebon --- .../skopeo2ostree/Dockerfile | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 experiments-and-demos/skopeo2ostree/Dockerfile diff --git a/experiments-and-demos/skopeo2ostree/Dockerfile b/experiments-and-demos/skopeo2ostree/Dockerfile new file mode 100644 index 00000000..56f2ea5a --- /dev/null +++ b/experiments-and-demos/skopeo2ostree/Dockerfile @@ -0,0 +1,33 @@ +# This generates a Docker/OCI image that looks a lot like an +# Atomic Host ostree (in terms of filesystem layout). +# +# See https://github.com/ostreedev/ostree-releng-scripts/pull/14 +# and in particular its `skopeo2ostree` tool. +# +# One could in theory actually combine the whole chain of +# `docker build` on this Dockerfile with `skopeo2ostree` +# and then `rpm-ostree ex commit2jigdo`. +FROM fedora:26 +RUN yum -y install kernel{,-core,-modules} dracut-config-generic @core \ + lvm2 cryptsetup audit policycoreutils \ + rpm-ostree ostree{,-grub2} nss-altfiles \ + && yum -y remove cronie plymouth \ + && semodule -nB \ + && yum clean all \ + && rpm -evh dnf libdnf dnf-{yum,conf} dnf-plugins-core \ + libcomps deltarpm rpm-plugin-systemd-inhibit python3-{dnf,dnf-plugins-core,hawkey,gpg,libcomps,librepo} \ + && rm -rf /var/lib/dnf \ + && rpm -qa|sort +# https://bugzilla.redhat.com/show_bug.cgi?id=1265295 +RUN echo 'Storage=persistent' >> /etc/systemd/journald.conf +# Undo the container base changes +RUN systemctl unmask systemd-remount-fs.service dev-hugepages.mount sys-fs-fuse-connections.mount systemd-logind.service getty.target console-getty.service +# FIXME - not starting for some reason +RUN systemctl mask firewalld +# https://ostree.readthedocs.io/en/latest/manual/adapting-existing/ +RUN for x in srv home media mnt opt; do mv /${x} /var/${x} && ln -sr /var/${x} /${x}; done \ + && rm /root -rf && ln -sr /var/roothome /root \ + && rm /usr/local -rf && ln -sr /var/usrlocal /usr/local \ + && mkdir -p /sysroot && ln -sr /sysroot/ostree /ostree \ + && rm /tmp -rf && ln -sr /sysroot/tmp /tmp \ +&& rm -rf /run/*