Building in a wrong folder results in weird errors about unrelated programs
Expected Behavior
When doing a build while specifying a wrong relative path to a Dockerfile, the error output should say something about that file not being found instead of a totally unrelated program.
This is the command that I used:
sudo docker-slim build --http-probe=false --dockerfile containers/base/Dockerfile --tag lalalala.dkr.ecr.us-east-2.amazonaws.com/smalltest --mount /var/run/docker.sock:/var/run/docker.sock --mount /usr/bin/docker:/usr/bin/docker --show-clogs --entrypoint "entrypoint_dockerslim" .
Actual Behavior
During build, this error popped up and stops the build:
cmd=build info=build.error status=standard.image.build.error value='cannot open "/home/thesheeep/.config/copyq/.copyq_s" for reading: open /home/thesheeep/.config/copyq/.copyq_s: no such device or address'
The error that I got was so weird and confusing ("wtf does CopyQ have to do with anything?!") that it took me quite a while to figure out what was actually the problem.
The actual problem here was that I ran the command above in my home folder (I was just silly and forgot to cd to the correct folder beforehand), so obviously there is no <home>/containers/base/Dockerfile.
If docker-slim had just flat out told me "The Dockerfile you specified could not be found" or something similar, I could have done my facepalm much earlier.
Maybe a sanity check of all the arguments passed would be in order just to improve error output for sleepyheads like myself a bit :rofl:
Specifications
- Version: docker-slim version linux|Transformer|1.34.0-16-gdc85082|dc85082121a8abf5c3984668b8a0c87d3fd7a51a|2021-02-16_07:58:23AM
- Platform: Manjaro Linux
@TheSHEEEP great idea! This will go well with the other build related enhancements... It'll be there in the next release.