Add new ubuntu-oci project

This is a copy of the ubuntu-base project.
Currently ubuntu-base is used as a base for the docker/OCI container
images. The rootfs tarball that is created with ubuntu-base is
published under [0]. That tarball is used in the FROM statement of the
Dockerfile as base and then a couple of modifications are done inside
of the Dockerfile[1].
The ubuntu-oci project will include the changes that are currently
done in the Dockerfile. With that:

1) a Dockerfile using that tarball will be just a 2 line thing:

   FROM scratch
   ADD ubuntu-hirsute-core-cloudimg-amd64-root.tar.gz /
   CMD ["/bin/bash"]

2) Ubuntu has the full control about the build process of the
docker/OCI container. No external sources (like [1]) need to be
modified anymore.
3) Ubuntu can publish containers without depending on the official
dockerhub containers[2]. Currently the containers for the AWS ECR
registry[3] use as a base[4] the official dockerhub containers. That's
no longer needed because a container just needs a Dockerfile described
in 1)

When the ubuntu-oci project has the modifications from [1] included,
we'll also update [1] to use the ubuntu-oci rootfs tarball as a base
and drop the modifications done at [1].

Note: Creating a new ubuntu-oci project instead of using ubuntu-base
will make sure that we don't break users who are currently using
ubuntu-base rootfs tarballs for doing their own thing.

[0] https://partner-images.canonical.com/core/
[1]
https://github.com/tianon/docker-brew-ubuntu-core/blob/master/update.sh
[2] https://hub.docker.com/_/ubuntu
[3] https://gallery.ecr.aws/ubuntu/ubuntu
[4]
https://launchpad.net/~ubuntu-docker-images/ubuntu-docker-images/+oci/ubuntu/+recipe/ubuntu-20.04

(cherry picked from commit ac4a95b931)
sil2100/riscv-unmatched-unleashed
Thomas Bechtold 4 years ago
parent 3a78492327
commit 9e15d88f4c
No known key found for this signature in database
GPG Key ID: 42EE72DAC27319AD

@ -245,7 +245,7 @@ if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then
fi fi
EOF EOF
if [ "$PROJECT" != "ubuntu-base" ]; then if [ "$PROJECT" != "ubuntu-base" ] && [ "$PROJECT" != "ubuntu-oci" ]; then
# ubuntu-minimal is too much for a docker container (it contains # ubuntu-minimal is too much for a docker container (it contains
# systemd and other things) # systemd and other things)
cat >> chroot/usr/local/sbin/unminimize <<'EOF' cat >> chroot/usr/local/sbin/unminimize <<'EOF'

@ -506,7 +506,7 @@ if [ "$PREINSTALLED" = "true" ]; then
ubuntu-server) ubuntu-server)
add_package live oem-config-debconf ubiquity-frontend-debconf add_package live oem-config-debconf ubiquity-frontend-debconf
;; ;;
ubuntu-core|ubuntu-base|base|ubuntu-cpc) ubuntu-core|ubuntu-base|ubuntu-oci|base|ubuntu-cpc)
;; ;;
ubuntu) ubuntu)
add_package live oem-config-gtk ubiquity-frontend-gtk add_package live oem-config-gtk ubiquity-frontend-gtk
@ -785,6 +785,10 @@ case $PROJECT in
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;; ;;
ubuntu-oci)
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;;
ubuntu-cpc) ubuntu-cpc)
KERNEL_FLAVOURS=virtual KERNEL_FLAVOURS=virtual
@ -951,7 +955,7 @@ case $ARCH in
esac esac
case $PROJECT:${SUBPROJECT:-} in case $PROJECT:${SUBPROJECT:-} in
ubuntu-server:*|ubuntu-base:*) ubuntu-server:*|ubuntu-base:*|ubuntu-oci:*)
OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
KERNEL_FLAVOURS=none KERNEL_FLAVOURS=none
BINARY_REMOVE_LINUX=false BINARY_REMOVE_LINUX=false
@ -1018,7 +1022,7 @@ echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/binary
echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary
case $PROJECT in case $PROJECT in
ubuntu-cpc|ubuntu-core|ubuntu-base|base) ubuntu-cpc|ubuntu-core|ubuntu-base|ubuntu-oci|base)
# ubuntu-cpc gets this added in 025-create-groups.chroot, and we do # ubuntu-cpc gets this added in 025-create-groups.chroot, and we do
# not want this group in projects that are effectively just chroots # not want this group in projects that are effectively just chroots
;; ;;

@ -802,7 +802,7 @@ clean_debian_chroot() {
rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old rm -f chroot/var/cache/debconf/*-old chroot/var/lib/dpkg/*-old
Chroot chroot apt clean Chroot chroot apt clean
# For the docker images we remove even more stuff. # For the docker images we remove even more stuff.
if [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-base:minimized" ]; then if [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-base:minimized" ] || [ "${PROJECT}:${SUBPROJECT:-}" = "ubuntu-oci:minimized" ]; then
# Remove apt lists (that are currently removed downstream # Remove apt lists (that are currently removed downstream
# anyway) # anyway)
rm -rf chroot/var/lib/apt/lists/* rm -rf chroot/var/lib/apt/lists/*

Loading…
Cancel
Save