You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Docker image. There is some path in it (let's call it /usr/bin/foo), but I'm not sure which command in the Dockerfile added that path.
I found a way of doing that, by combining this tool with a one-line Perl script:
docker image save $IMAGE |
dlayer -n 999999 |
perl -ne 'chomp;$query=quotemeta("usr/bin/foo");$cmd=$_ if $_ =~ m/ [\$] /;print "$cmd\n\t$_\n" if m/ $query/;'
Now, while this works, it would be even better if dlayer had some kind of search function, so the Perl script was unnecessary. For example, maybe dlayer -p /usr/bin/foo would just print the layer containing /usr/bin/foo, if any.
That's the basic idea. Some possible elaborations:
support patterns (glob, maybe even regex), as opposed to just an exact match
distinguish in the command exit code between match found, no match found, and error (like grep for example does)
The text was updated successfully, but these errors were encountered:
skissane
changed the title
Would be great if there was a search function
Proposed enhancement: search function
Oct 17, 2022
skissane
pushed a commit
to skissane/dlayer
that referenced
this issue
Oct 17, 2022
I have a Docker image. There is some path in it (let's call it
/usr/bin/foo
), but I'm not sure which command in the Dockerfile added that path.I found a way of doing that, by combining this tool with a one-line Perl script:
Now, while this works, it would be even better if dlayer had some kind of search function, so the Perl script was unnecessary. For example, maybe
dlayer -p /usr/bin/foo
would just print the layer containing/usr/bin/foo
, if any.That's the basic idea. Some possible elaborations:
grep
for example does)The text was updated successfully, but these errors were encountered: