-
-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage? #44
Comments
Thank you for the report and thank you for the sample Dockerfile! Where exactly did you get stuck? Did the 'docker-slim build' command fail? What do you see when you run 'docker images'? I tried to repro your use case and here's what I got (using the Dockerfile you provided): $ docker build -t q/ds-issue-44 . <note: this command created the initial Docker image> $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE Now it's time to slim the image (note: skipped most of the command output)... $ docker-slim build --show-clogs=true q/ds-issue-44 $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE The output shows that docker-slim created a minified version of the original alpine image (that was 257MB) and this minified version is 1.39MB. Now let's run the minified image: $ docker run --rm -it q/ds-issue-44.slim P.S. |
I'm not sure how your image was 257MB(maybe you're building something else) mine is only 4.15MB after creation but then once running docker slim it becomes 0MB. ` docker-slim: [build] image=test1 http-probe=false remove-file-artifacts=false image-overrides=map[] entrypoint=[] (false) cmd=[] (false) workdir='' env=[] expose=map[] <!!! I PUSHED ENTER HERE !!!> INFO[0003] docker-slim: waiting for the container to finish its work... $ docker images $ docker run --rm -it test1.slim |
The alpine image was that big because i used the Go alpine image instead of the vanilla alpine image :-) I'll try it with a vanilla alpine too. The "WARNING - no data artifacts" message means that something happened with the target container during the inspection phase it didn't produce any artifacts. Are you running it on Linux or Mac OS X? |
Tried it with the latest release (1.19) and a vanilla alpine image: $ docker images $ docker run --rm -it q/ds-issue-44.slim |
running on a Mac
…On Feb 4, 2018 12:45, "Kyle Quest" ***@***.***> wrote:
The alpine image was that big because i used the Go alpine image instead
of the vanilla alpine image :-) I'll try it with a vanilla alpine too.
The "WARNING - no data artifacts" message means that something happened
with the target container during the inspection phase it didn't produce any
artifacts.
Are you running it on Linux or Mac OS X?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#44 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADBkKapoXBXuTgFMNNPvBgJ9D2K7_Vwnks5tRfrEgaJpZM4R3U_8>
.
|
Very interesting :) Sorry for the headaches! What's the Docker version you are using? Can you also try running docker-slim with more debugging information like this: |
No problem. Mac Edge version 18.02.0-ce-rc2-mac51 (22446) `./docker-slim --debug build --show-clogs=true test1 IMAGE HISTORY => DEBU[0000] IMAGE INSTRUCTIONS: DEBU[0014] sendCmd(&{}) |
@kcq any updates? |
Thank you for the debug output! It's definitely helpful! Can you list the files and directories here: /Users/gcollins/Desktop/dockerslim/.images/132df7fc1b65dcd6adc2389ba8a90ca7da481c2adcdbf77e0c28da672493c9f4/artifacts . Is there anything there? Is there a directory called 'files'? There should be a message saying that the master app created that 'artifacts' directory, but I don't see it in your debug messages. I also don't see any debug messages from the sensor app showing that it tried to prepare and copy any artifacts, which indicates that the sensor didn't even try to copy the artifacts. This is a good lead. Thank you! We'll probably need an update release with more debugging information around directory and file I/O operations to surface permission related problems. |
Np, yw These are the files dockerslim/.images/132df7fc1b65dcd6adc2389ba8a90ca7da481c2adcdbf77e0c28da672493c9f4/artifacts/ Latest Docker Version |
Thanks for confirming that there's no 'files' directory there! There'll be a new version to try tomorrow. I greatly appreciate your help tracking this down! |
@gcstang Would you be able to try the latest release ( https://github.com/docker-slim/docker-slim/releases/tag/1.24 ) to see if you still see the problem you experienced or if it's gone now? Thanks again for your report! |
This worked! |
Great to hear! |
Maybe I'm confused on how this works but I'm trying to run this on an alpine image with a simple command 'echo "hello world"'. Should this work and make this smaller or is there more required to use your tool?
Simple image from a Dockerfile
`FROM alpine
ENTRYPOINT ["echo","hello world"]`
docker build -t mine .
./docker-slim build mine
The text was updated successfully, but these errors were encountered: