-
-
Notifications
You must be signed in to change notification settings - Fork 718
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
Lost files in the slimmed image for nginx fat image #45
Comments
Thank you for reporting the issue! I really appreciate it. I'd like to reproduce the problem. Can you tell me more about the Docker image. Where is it from? What's in it? What ports is it supposed to expose? |
Sure, thanks for your reply! This docker image is come from our private repo, so I don't know where is it from, but I guess the official nginx image in docker hub could probably reproduce this issue.
|
Thanks for the additional context! Are your web assets packaged in that nginx Docker image? Is it a stand-alone container or is it supposed to be used with other containers (e.g., a data container)? Can you give examples of how you normally use this Docker images? What are the command line parameters to 'docker run'? Do you need to mount any volumes or is it always like the example you provided in the original report? Thanks again! |
After debug, I found this problem happens in below codes:
These codes traverse the container root filesystem, but I found filepath.Walk() doesn't walk some files or directories(I print every walked files or directories). |
I also tried findSymlinksLegacy() API which use "find" tool instead of findSymlinks(filepath.Walk()),looks like it doesn't have the same problem, but findSymlinksLegacy() has one other problem: it can't detect the symbolic link, and this makes the slimmed images much bigger. Moreover, this problem is not limited to nginx container, the apache httpd container shares the same problem, and I think much more. |
@kcq The fix can be like this:
|
@isula-xufeng The new 1.24 release includes a number of symlink related enhancements address this issue ( https://github.com/docker-slim/docker-slim/releases/tag/1.24 ). Can you try the new version to see if it works for you? Thanks a lot for providing the code snippets! |
Closing it for now... Please reopen if you still see the same problem. |
Hi,
I run docker-slim to generated a slimmed nginx images:
And the command generated a 6.4MB image successfully, however, I can't run this slimmed image due to missed file:
I checked artifacts reports, and find nginx.conf file is recorded in creport.json:
"/etc/nginx/nginx.conf": {
"event_count": 2,
"first_eid": 0,
"reads": 1
},
But check "files" directory in artifacts, I can't find nginx.conf:
I don't know what's wrong with docker-slim tool.
The text was updated successfully, but these errors were encountered: