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

STEP "COPY ./images.json /etc/buildpacks/images.json": checking on sources under "/var/tmp/ #62

Open
cmoulliard opened this issue Sep 5, 2024 · 4 comments
Labels
bug Something isn't working test::stack tool::jam

Comments

@cmoulliard
Copy link
Contributor

Issue

The command to build the stack image fails for some flavors as: nodejs-20, nodejs-18, etc

jam create-stack "--config ./stack-nodejs-20/stack.toml --build-output ./stack-nodejs-20/build-nodejs-20/build.oci --run-output ./stack-nodejs-20/build-nodejs-20/run.oci"
Building io.buildpacks.stacks.ubi8
  Building on linux/amd64
    Building base images
Error: build failed:

building at STEP "COPY ./images.json /etc/buildpacks/images.json": checking on sources under "/var/tmp/libpod_builder2686246012/build": copier: stat: "/images.json": no such file or directory

This problem is due to the fact that the build is not able to get the images.json from the root parent folder

@cmoulliard cmoulliard added bug Something isn't working tool::jam test::stack labels Sep 5, 2024
@pacostas
Copy link

pacostas commented Sep 5, 2024

Yes, it also fails on our CI, we are working on it https://github.com/paketo-community/ubi-base-stack/actions/runs/10720404763/job/29726625024. Thank you for opening an issue for easier tracking.

@cmoulliard
Copy link
Contributor Author

cmoulliard commented Sep 5, 2024

Solution is to move to the parent directory and to change the build.dockerfile

[cloud-user@rhel-9 ubi-base-stack]$ cat stack/build.Dockerfile
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
USER root
WORKDIR /etc/buildpacks
COPY images.json images.json
RUN chmod 744 images.json

and 

[cloud-user@rhel-9 ubi-base-stack]$ podman build -f stack/build.Dockerfile .
STEP 1/5: FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
STEP 2/5: USER root
--> Using cache 929b0659d19047209291698e1e0dfebd2bad716bb6723f6d1a547c1fb6e48edc
--> 929b0659d190
STEP 3/5: WORKDIR /etc/buildpacks
--> Using cache a939d50670d2f45ba5e78aa7a47cd1586eaaf4dd90b56129a775c373eb29da8f
--> a939d50670d2
STEP 4/5: COPY images.json images.json
--> a7e21bf73202
STEP 5/5: RUN chmod 744 images.json
COMMIT
--> b414737c7082
b414737c70825f5549f79b2360c9910c1c894013913ebd1a0e845edd2e3df257

Unfortunately that will fail with Jam

[cloud-user@rhel-9 ubi-base-stack]$ jam create-stack --config ./stack/stack.toml --build-output ./stack/build/build.oci --run-output ./stack/build/run.oci
Building io.buildpacks.stacks.ubi8
  Building on linux/amd64
    Building base images
Error: build failed:

building at STEP "COPY images.json images.json": checking on sources under "/var/tmp/libpod_builder1201396470/build": copier: stat: "/images.json": no such file or directory

Usage:
  jam create-stack [flags]

Flags:
      --build-output string   path to output the build image OCI archive (required)
      --build-ref string      reference that specifies where to publish the build image (required)
      --config string         path to a stack descriptor file (required)
  -h, --help                  help for create-stack
      --label strings         additional image label to be added to build and run image
      --publish               publish to a registry
      --run-output string     path to output the run image OCI archive (required)
      --run-ref string        reference that specifies where to publish the run image (required)
      --secret strings        secret to be passed to your Dockerfile
      --unbuffered            do not buffer image contents into memory for fast access

failed to execute: build failed:

building at STEP "COPY images.json images.json": checking on sources under "/var/tmp/libpod_builder1201396470/build": copier: stat: "/images.json": no such file or directory

@pacostas

@cmoulliard
Copy link
Contributor Author

cmoulliard commented Sep 9, 2024

Yes, it also fails on our CI, we are working on it https://github.com/paketo-community/ubi-base-stack/actions/runs/10720404763/job/29726625024. Thank you for opening an issue for easier tracking.

The bash script of the PR 's merged copy the images.json file within the target stack folder to be build

@pacostas

@pacostas
Copy link

@cmoulliard The PR has been merged, it should successfully create the .cnb files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test::stack tool::jam
Projects
None yet
Development

No branches or pull requests

2 participants