tzickel / docker-trim

Create trimmed docker image that contains only parts of the original file system of an existing docker image while still working.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

standard_init_linux.go:211: exec user process caused "no such file or directory"

TotalLag opened this issue · comments

First, just want to say this is a pretty cool project!

I am trying to test this out on the following docker image: ianwalter/puppeteer:3.0.0

I ran the following first to get a first run:

./oneshot_trim.sh ianwalter/puppeteer:3.0.0

I am curious if /bin/bash would work so I did that next:

./oneshot_trim.sh ianwalter/puppeteer:3.0.0 /bin/bash

Finally, following the instructions after renaming the files, I do:

python docker_trim.py ianwalter/puppeteer:3.0.0 ianwalter_puppeteer\:3.0.0.first_run ianwalter_puppeteer\:3.0.0.final_tmp_file

This resulted in a new images (and i retagged) , but when I try to run:

docker run --rm -it ianwalter/puppeteer-trim:1.0.0 /bin/bash

That's when I get the error: standard_init_linux.go:211: exec user process caused "no such file or directory" -- Am I missing something or are there some images it won't work on such as node?

Thanks for this (first!) report.

The fix is simple. Delete the file instrumentation.tar.gz from the script directory, and run:

docker build --no-cache - < Dockerfile.get_instrumentation

There is a big (?) lesson to be learnt about docker image reproducible from a Dockerfile, and long term support release of operating systems distributions.

To make a long story short, sometime long ago (a year?) a bug was introduced to one of the utilities this script uses (file) in Ubuntu 16.04 (and 18.04) where it produced wrong output.

Because docker build uses cached results, it didn't pick up a new version for me of that utility (thus I didn't see the bug).

After you reported this, I reproduced it easily on another machine, understood the issue and reported it to the Ubuntu developers which fixed the file utility after a long time it produced invalid results for my use case.

You might ask why take it from a specific distribution, the answer is that I needed it from somewhere, and I tried to target an old distribution which is LTS, supported, and stable.

wow that's awesome. i haven't tried it yet, but great explanation!