How to build a base OCI image for different architectures?

Asked by Thomas Bechtold on 2021-05-20

I want to build the ubuntu base image for different architectures. The Dockerfile for that looks like:

FROM scratch
ADD ubuntu-impish-oci-amd64-root.tar.gz /
CMD ["/bin/bash"]

To use that Dockerfile, I need to add the tarball to git (ADD does not take remote files and extract them). I cloned basically the structure that is used for the dockerhub images in git which is:

- a branch per arch (eg. dist-amd64, dist-s390x, ...)
- each branch contains the Dockerfile and the arch-specific tarball

But when I try to use that schema with launchpad and try to create a OCI recipe, I get an error:

Branch does not match format 'applicationversion-ubuntuversion', eg. 'v1.0-20.04'

I have these settings set:
- repository: ubuntu-oci-base/+oci/ubuntu-base
- branch: refs/heads/dist-amd64

I think for base images the schema check doesn't make any sense. Would it be possible to relax that check?

Question information

Language:
English Edit question
Status:
Answered
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Thomas Bechtold (toabctl) said :
#1

A workaround could be, to create a OCI project per architecture and then recipies in theses projects per series.

Revision history for this message
Tom Wardill (twom) said :
#2

There is no specification for what the version number part of the format looks like, 'amd64-20.04' should be valid here, and seems to make reasonable semantic sense.

I've also come up with this in the past:
https://git.launchpad.net/~twom/+git/ubuntu-base-docker/tree/Dockerfile?h=main
Which can build a base image (assuming that a base image already exists to do the download), which means the tarballs do not need to be checked in. Admittedly, depending on the image that you're already building causes a bootstrap problem, so it's not ideal, but it is an available strategy.

Either method can be combined with the BUILD ARGS functionality to inject the various architectures into a single Dockerfile, so you could have a structure of multiple recipes building from the same branch, but with different ARGS.

Revision history for this message
Thomas Bechtold (toabctl) said :
#3

This is not solved. See linked bug for a more detailed problem description.

Can you help with this problem?

Provide an answer of your own, or ask Thomas Bechtold for more information if necessary.

To post a message you must log in.