cloudymax / pxeless

An automated system install and image customization tool for when PXE is not an option, or is not an option yet.
MIT License
108 stars 16 forks source link

stat /data/image-create.sh: no such file or directory: unknown. #38

Closed lmunch closed 1 year ago

lmunch commented 1 year ago

v0.0.7 and v0.0.8 is broken: $ docker run --rm --volume "$(pwd):/data" --user $(id -u):$(id -g) deserializeme/pxeless:v0.0.7 -a -u user-data.basic -n jammy -r Digest: sha256:7a1862ac4d38c493a9cebed3dc31a57f7cf1e843bdd0a04e42ad05b09f193826 Status: Downloaded newer image for deserializeme/pxeless:v0.0.7 docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/data/image-create.sh": stat /data/image-create.sh: no such file or directory: unknown.

v0.0.6 is works: $ docker run --rm --volume "$(pwd):/data" --user $(id -u):$(id -g) deserializeme/pxeless:v0.0.6 -a -u user-data.basic -n jammy -r Digest: sha256:0df39c1aeabdc9cb4518a648b99aa682444cd3fe8d69536ab187ae2b146c0e85 Status: Downloaded newer image for deserializeme/pxeless:v0.0.6 [2023-05-18 20:12:39] πŸ“ Created temporary working directory /tmp/tmp.hAZYqs7Mux ....

I assume this issue has been missed as it (probably) works if you have image-create.sh in $(pwd)

meraj-kashi commented 1 year ago

Hi! I think this issue is because of this change: in Dockerfile, the image-create is copied to /data directory:

COPY image-create.sh /data  

ENTRYPOINT [ "/data/image-create.sh" ]

Also, the docker run command, attaches volume of the current directory to /data. It means that it overwrites the content of the /data, and then the image-create.sh will be deleted/overwrited.

now, ref to changes in V0.0.7, the script did not work locally (out of Docker) due to dependency to /data directory.

I believe that this is not an issue, because based on the documentation, the user should clone the repo to run the docker run command. So, the image-create.sh will always be there. By the way, it is fixable, by modifying this part: https://github.com/cloudymax/pxeless/blob/develop/image-create.sh#LL530C37-L530C48

But let's @cloudymax check and put comment :)

lmunch commented 1 year ago

I would prefer not having to clone the repo to use the pxeless container image, that is why I did that feature in https://github.com/cloudymax/pxeless/pull/16 (which is now unfortunately broken)

lmunch commented 1 year ago

Please check #39 which I believe fixes the issues

meraj-kashi commented 1 year ago

Thanks @lmunch , I can confirm that your change is working fine within local run (out of Docker container)!

cloudymax commented 1 year ago

@meraj-kashi regarding the documentation, cloning the repo was just meant to provide an easy way to eliminated "works on my machine" issues for new users by giving them a known working cloud-init file and /extras/, but for users who already have a cloud-init configuration and don't need that level of hand-holding then it shouldn't be required - in my opinion.

I'll update the documentation to better reflect that shortly

@lmunch thanks for the PR, I'm testing it now πŸ‘

cloudymax commented 1 year ago

Merged #39 after testing in docker and from command line. πŸ₯³