Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to deploy when running podman create as part of container image build #102

Closed
cdrage opened this issue Jan 10, 2024 · 5 comments
Closed

Comments

@cdrage
Copy link
Contributor

cdrage commented Jan 10, 2024

Using the default bootc-image-builder command, I'm unable to create something like this in a Containerfile:

FROM quay.io/centos-bootc/fedora-bootc:eln

RUN echo "root:root" | chpasswd
RUN podman create --name hello --restart=always -p 8080:8080 cdrage/helloworld

I'm getting the error:

ostree container image deploy --imgref=ostree-unverified-image:dir:/tmp/tmpo2itqhqp/image --stateroot=default --target-imgref=ostree-remote-registry::quay.io/podai/test --karg=rw --karg=console=tty0 --karg=console=ttyS0 --karg=root=LABEL=root --sysroot=/run/osbuild/tree
error: Performing deployment: Importing: Parsing layer blob sha256:fddea510d1419a5023604a90d8b1a832d777a836e4344590dfd0b999355233b7: error: ostree-tar: Processing deferred hardlink var/lib/containers/storage/overlay/4f2c33229347e298a539cd86ec91e881b6e445b45f0bc46448e86e4bd0103e7e/diff/usr/bin/perl: Failed to find object: No such file or directory: var: Processing tar via ostree: Failed to commit tar: ExitStatus(unix_wait_status(256))
Traceback (most recent call last):
  File "/run/osbuild/bin/org.osbuild.ostree.deploy.container", line 140, in <module>
    r = main(stage_args["tree"],
        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/osbuild/bin/org.osbuild.ostree.deploy.container", line 135, in main
    ostree_container_deploy(tree, inputs, osname, target_imgref, kopts)
  File "/run/osbuild/bin/org.osbuild.ostree.deploy.container", line 109, in ostree_container_deploy
    ostree.cli("container", "image", "deploy",
  File "/run/osbuild/lib/osbuild/util/ostree.py", line 202, in cli
    return subprocess.run(["ostree"] + args,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ostree', 'container', 'image', 'deploy', '--imgref=ostree-unverified-image:dir:/tmp/tmpo2itqhqp/image', '--stateroot=default', '--target-imgref=ostree-remote-registry::quay.io/podai/test', '--karg=rw', '--karg=console=tty0', '--karg=console=ttyS0', '--karg=root=LABEL=root', '--sysroot=/run/osbuild/tree']' returned non-zero exit status 1.

⏱  Duration: 23s

Even after adding RUN ostree container commit to the Containerfile, it does not make a difference.

@cgwalters
Copy link
Contributor

This issue is unrelated to b-i-b (whose job is to transform container images into disk images) - it's more an issue for https://github.com/centos/centos-bootc today (which is the operating-system-as-container base image).

@cgwalters
Copy link
Contributor

The (slightly) longer answer here today is that you need to do https://centos.github.io/centos-bootc/builds/#embedding-application-containers - in theory we could perhaps try to translate build-time podman create invocations into quadlets...

@cdrage
Copy link
Contributor Author

cdrage commented Jan 10, 2024

Ah, thank you. I for some reason expected it to be near 100% exact like a normal operating system so something like adding a RUN command to start on boot would have it boot up. Thank you for the documentation, I'll go through https://centos.github.io/centos-bootc/builds/#embedding-application-containers

@cgwalters
Copy link
Contributor

Although I see why you filed it here, because we failed at deployment time and not build time which is a bit surprising...hmm

@cgwalters cgwalters changed the title Weird issue with layering fails to deploy when running podman create as part of container image build Jan 11, 2024
@cdrage
Copy link
Contributor Author

cdrage commented Jun 3, 2024

Closing as this is resolved with upstream fedora bootc documentation now.

@cdrage cdrage closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants