From f6963cea130133086f739173b55d1af74a680fef Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Thu, 10 Mar 2022 12:51:47 -0500 Subject: Cirrus: Build multi-arch images + manifests Github-actions for large/complex tasks is hard to read and maintain. Reimplement the multi-arch image build workflow into a set of bash scripts that use all native contrainer-org tooling. This requires a special VM image setup with emulation to build foreign architectures. It also requires renaming the `helloimage` directory, because the build script uses the directory name in the image FQIN. Signed-off-by: Chris Evich --- contrib/hello/Containerfile | 11 +++++ contrib/hello/README.md | 77 +++++++++++++++++++++++++++++++++ contrib/hello/podman_hello_world.c | 26 +++++++++++ contrib/helloimage/Containerfile | 11 ----- contrib/helloimage/README.md | 77 --------------------------------- contrib/helloimage/podman_hello_world.c | 26 ----------- 6 files changed, 114 insertions(+), 114 deletions(-) create mode 100644 contrib/hello/Containerfile create mode 100644 contrib/hello/README.md create mode 100644 contrib/hello/podman_hello_world.c delete mode 100644 contrib/helloimage/Containerfile delete mode 100644 contrib/helloimage/README.md delete mode 100644 contrib/helloimage/podman_hello_world.c (limited to 'contrib') diff --git a/contrib/hello/Containerfile b/contrib/hello/Containerfile new file mode 100644 index 000000000..0cbf6d9a0 --- /dev/null +++ b/contrib/hello/Containerfile @@ -0,0 +1,11 @@ +FROM docker.io/alpine as builder +RUN apk add gcc libc-dev +ADD podman_hello_world.c . +RUN gcc -O2 -static -o podman_hello_world podman_hello_world.c + +FROM scratch +LABEL maintainer="Podman Maintainers" +LABEL artist="Máirín Ní Ḋuḃṫaiġ, Twitter:@mairin" +USER 1000 +COPY --from=builder podman_hello_world /usr/local/bin/podman_hello_world +CMD ["/usr/local/bin/podman_hello_world"] diff --git a/contrib/hello/README.md b/contrib/hello/README.md new file mode 100644 index 000000000..528466f7b --- /dev/null +++ b/contrib/hello/README.md @@ -0,0 +1,77 @@ +![PODMAN logo](../../logo/podman-logo-source.svg) + +# Podman Hello World image + +## Overview + +This directory contains the Containerfile and bash script necessary to create the +"hello" podman image housed on quay.io under the Podman account in a public +repository. The image is public and can be pulled without credentials. + +Using this image is helpful to: + + * Prove that basic Podman operations are working on the host. + * Shows that the image was pulled from the quay.io container registry. + * Container creation was successfully accomplished. (`podman ps -a`) + * The created container was able to stream output to your terminal. + +## Directory Contents + +The contents of this directory contain: + * ./Containerfile + * ./podman_hello_world.c + +## Sample Usage + +To simply run the image: + +``` +podman run quay.io/podman/hello + +!... Hello Podman World ...! + + .--"--. + / - - \ + / (O) (O) \ + ~~~| -=(,Y,)=- | + .---. /` \ |~~ + ~/ o o \~~~~.----. ~~ + | =(X)= |~ / (O (O) \ + ~~~~~~~ ~| =(Y_)=- | + ~~~~ ~~~| U |~~ + +Project: https://github.com/containers/podman +Website: https://podman.io +Documents: https://docs.podman.io +Twitter: @Podman_io +``` +To build the image yourself, copy the files from this directory into +a local directory and issue these commands: + +``` +podman build -t myhello . +podman run myhello +``` + +## Potential Issues: + +The image runs as a rootless user with the UID set to `1000`. +If the /etc/subuid and /etch/subgid values are not set appropriately to run as a +rootless user on the host, an error like this might be raised: + +``` +Copying blob acab339ca1e8 done +ERRO[0002] Error while applying layer: ApplyLayer exit status 1 stdout: stderr: potentially insufficient UIDs or GIDs available in user namespace (requested 0:12 for /var/spool/mail): Check /etc/subuid and /etc/subgid: lchown /var/spool/mail: invalid argument +Error: writing blob: adding layer with blob "sha256:ee0cde9de8a68f171a8c03b0e9954abf18576947e2f3187e84d8c31ccd8f6a09": ApplyLayer exit status 1 stdout: stderr: potentially insufficient UIDs or GIDs available in user namespace (requested 0:12 for /var/spool/mail): Check /etc/subuid and /etc/subgid: lchown /var/spool/mail: invalid argument +``` + +Please refer to this [blog post](https://www.redhat.com/sysadmin/rootless-podman) for further configuration information. + +## THANKS! + +Many Thanks to @afbjorklund for a great discussion during the +first revision of this container image that resulted in moving +from using bash to using C, and the ensuing changes to the +Containerfile. + +Also many thanks to @mairin for the awesome ASCII art! diff --git a/contrib/hello/podman_hello_world.c b/contrib/hello/podman_hello_world.c new file mode 100644 index 000000000..ee574130d --- /dev/null +++ b/contrib/hello/podman_hello_world.c @@ -0,0 +1,26 @@ +//### +// ASCII art by the incomparable Máirín Duffy, +// duffy@redhat.com, Twitter: @mairin +// January 2022 +//### + +#include +int main() { + puts("\ +!... Hello Podman World ...!\n\ +\n\ + .--\"--. \n\ + / - - \\ \n\ + / (O) (O) \\ \n\ + ~~~| -=(,Y,)=- | \n\ + .---. /` \\ |~~ \n\ + ~/ o o \\~~~~.----. ~~ \n\ + | =(X)= |~ / (O (O) \\ \n\ + ~~~~~~~ ~| =(Y_)=- | \n\ + ~~~~ ~~~| U |~~ \n\ +\n\ +Project: https://github.com/containers/podman\n\ +Website: https://podman.io\n\ +Documents: https://docs.podman.io\n\ +Twitter: @Podman_io"); +} diff --git a/contrib/helloimage/Containerfile b/contrib/helloimage/Containerfile deleted file mode 100644 index 0cbf6d9a0..000000000 --- a/contrib/helloimage/Containerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM docker.io/alpine as builder -RUN apk add gcc libc-dev -ADD podman_hello_world.c . -RUN gcc -O2 -static -o podman_hello_world podman_hello_world.c - -FROM scratch -LABEL maintainer="Podman Maintainers" -LABEL artist="Máirín Ní Ḋuḃṫaiġ, Twitter:@mairin" -USER 1000 -COPY --from=builder podman_hello_world /usr/local/bin/podman_hello_world -CMD ["/usr/local/bin/podman_hello_world"] diff --git a/contrib/helloimage/README.md b/contrib/helloimage/README.md deleted file mode 100644 index 528466f7b..000000000 --- a/contrib/helloimage/README.md +++ /dev/null @@ -1,77 +0,0 @@ -![PODMAN logo](../../logo/podman-logo-source.svg) - -# Podman Hello World image - -## Overview - -This directory contains the Containerfile and bash script necessary to create the -"hello" podman image housed on quay.io under the Podman account in a public -repository. The image is public and can be pulled without credentials. - -Using this image is helpful to: - - * Prove that basic Podman operations are working on the host. - * Shows that the image was pulled from the quay.io container registry. - * Container creation was successfully accomplished. (`podman ps -a`) - * The created container was able to stream output to your terminal. - -## Directory Contents - -The contents of this directory contain: - * ./Containerfile - * ./podman_hello_world.c - -## Sample Usage - -To simply run the image: - -``` -podman run quay.io/podman/hello - -!... Hello Podman World ...! - - .--"--. - / - - \ - / (O) (O) \ - ~~~| -=(,Y,)=- | - .---. /` \ |~~ - ~/ o o \~~~~.----. ~~ - | =(X)= |~ / (O (O) \ - ~~~~~~~ ~| =(Y_)=- | - ~~~~ ~~~| U |~~ - -Project: https://github.com/containers/podman -Website: https://podman.io -Documents: https://docs.podman.io -Twitter: @Podman_io -``` -To build the image yourself, copy the files from this directory into -a local directory and issue these commands: - -``` -podman build -t myhello . -podman run myhello -``` - -## Potential Issues: - -The image runs as a rootless user with the UID set to `1000`. -If the /etc/subuid and /etch/subgid values are not set appropriately to run as a -rootless user on the host, an error like this might be raised: - -``` -Copying blob acab339ca1e8 done -ERRO[0002] Error while applying layer: ApplyLayer exit status 1 stdout: stderr: potentially insufficient UIDs or GIDs available in user namespace (requested 0:12 for /var/spool/mail): Check /etc/subuid and /etc/subgid: lchown /var/spool/mail: invalid argument -Error: writing blob: adding layer with blob "sha256:ee0cde9de8a68f171a8c03b0e9954abf18576947e2f3187e84d8c31ccd8f6a09": ApplyLayer exit status 1 stdout: stderr: potentially insufficient UIDs or GIDs available in user namespace (requested 0:12 for /var/spool/mail): Check /etc/subuid and /etc/subgid: lchown /var/spool/mail: invalid argument -``` - -Please refer to this [blog post](https://www.redhat.com/sysadmin/rootless-podman) for further configuration information. - -## THANKS! - -Many Thanks to @afbjorklund for a great discussion during the -first revision of this container image that resulted in moving -from using bash to using C, and the ensuing changes to the -Containerfile. - -Also many thanks to @mairin for the awesome ASCII art! diff --git a/contrib/helloimage/podman_hello_world.c b/contrib/helloimage/podman_hello_world.c deleted file mode 100644 index ee574130d..000000000 --- a/contrib/helloimage/podman_hello_world.c +++ /dev/null @@ -1,26 +0,0 @@ -//### -// ASCII art by the incomparable Máirín Duffy, -// duffy@redhat.com, Twitter: @mairin -// January 2022 -//### - -#include -int main() { - puts("\ -!... Hello Podman World ...!\n\ -\n\ - .--\"--. \n\ - / - - \\ \n\ - / (O) (O) \\ \n\ - ~~~| -=(,Y,)=- | \n\ - .---. /` \\ |~~ \n\ - ~/ o o \\~~~~.----. ~~ \n\ - | =(X)= |~ / (O (O) \\ \n\ - ~~~~~~~ ~| =(Y_)=- | \n\ - ~~~~ ~~~| U |~~ \n\ -\n\ -Project: https://github.com/containers/podman\n\ -Website: https://podman.io\n\ -Documents: https://docs.podman.io\n\ -Twitter: @Podman_io"); -} -- cgit v1.2.3-54-g00ecf