r/sre•
bitcycle

docker hacking: find without find

Background

I recently had to start using a new docker base image at work. I then realized that it didn't have things that I expected to be there.

Cool Thing

Have you ever found yourself in a new docker image that uses a base image you’re unfamiliar with?

Use find without actually using find (and without using another programming language like python, perl, or ruby), because someone decided not to include it in the base image and you don’t want to have to update your own Dockerfile:

$ docker run --rm --entrypoint /bin/bash $DOCKER_IMAGE -c -l '(for f in /path/you/think/the/file/is/in/**/* ; do echo $f; done) | grep -i "file you are looking for"'

Posted Oct 24, 2024, 12:19 AM UTC

94

Comments aren't archived yet

This post had 4 comments on Reddit. Comments for this period haven't been loaded into the archive yet.