docker-slim build --http-probe=false --include-path=/usr/local/bin/docker-php-source php:7.3-alpine
--exclude-patternflag supports the Glob/Match syntax ( https://golang.org/pkg/path/filepath/#Match ) in Go plus the ** pattern
s6-mkfifo: fatal: unable to mkfifo /var/run/s6/services/s6-fdholderd/supervise/control: No such file or directory
Hi guys, is there any guidance on how to figure out base image and add that to xray?
@yashbhutwala great to see that you looked at the code :-) there’s actually quite a bit of information related to the base image information when you run the xray command. For example, here’s what I got running
docker-slim xray dslimexamples/server-node-hapi-alpine (server-node-haps-alpine is one of the sample app, so you can try it yourself):
Dockerfile for the image starts with:
The console output from the xray command has this line:
docker-slim[xray]: info=image.stack index=0 name='node:6.11.0-alpine' id='sha256:b7535c8c7bee13ca6c082141f5416f2f5d9b8bf68a61cb9e6ce82d42773aa40d' instructions=8 message='see report file for details’
Note how the
name field value is
node:6.11.0-alpine, which matches the FROM instruction value.
The slim.report.json file (that gets generated when the command is done) includes
6.11.0-alpine in one of the
And the auto-generated Dockerfile.fat file has line:
# end of image: node:6.11.0-alpine (id: tags: node:6.11.0-alpine)
level=fatal msg="docker-slim: failure" error="source is not a regular file"
--include-pathworks with directories too, so no need to include each file individually
./docker-slim build --http-probe fogf.18.04.tar:latest)
—include-*parameters you can use too:
—include-binis a more intelligent version of
include-pathwhen it comes to keeping additional binary files in your optimized image. It will include the file you specify and it will also include any other files that binary references, so if you
—include-bina shared object (aka dynamic library)
docker-slimwill include that shared object and it will also include the shared libraries that shared object imports.
—include-shellincludes enough executables to give you a basic read-only shell experience
-vdocker run param) when you run your optimized container. Would it be possible to do? There’s a couple of extra capabilities I can add to docker-slim to streamline this use case. One is an ability to copy files within the container image when docker-slim is running it. This would make it possible to mount your clean config as a new file and then it would replace the modified config file. Another option is a capability to add extra files to the optimized image during the build step, so you’d be able to replace the modified config file with a fresh copy.
--preserve-path. Set its value to your entrypoint’s file path something like this:
docker-slim build --preserve-path /path/to/your/entrypoint.sh your-container-image-name
-preserve-pathflag and lots of other enhancements. Give it a try (linux: