slim icon indicating copy to clipboard operation
slim copied to clipboard

docker-slim throwing no such file or directory error.

Open Somyarani13 opened this issue 3 years ago • 1 comments

Expected Behavior

I am building a docker image(not slimmed) and then build the slim image using the non-slim image. Command used to build the slim image is docker-slim build --target slim_image --expose 5000 It generates the slim image but when trying to create a container for the given slim image, it throws no such file or directory :- usr/local/lib/python3.8/site-packages/pydicom/data/urls.json

For finding the issues, I tried creating a container for the slim image and check in the container if the given path is present or not . But there is no urls.json present inside data folder.

I also tried creating a container for the non-slim image and check in the container if the given path is present or not. And urls.json was present inside the data folder.

So I wen through the flags of build command of docker slim and found --preserve-path-file and i gave the absolute path of the urls.json. But somehow it looks as if the urls.json is looking out for this file in the machine on which this docker image and containers are working and not inside the non-slim docker image.

Command which I even tried with --preserve-path-file is sudo docker-slim build --target non_slim_image_name --expose 5000 --preserve-path-file usr/local/lib/python3.8/site-packages/pydicom/data/urls.json

sudo docker-slim build --target non_slim_image_name --expose 5000 --include-path-file usr/local/lib/python3.8/site-packages/pydicom/data/urls.json


Actual Behavior


Steps to Reproduce the Problem


Specifications

  • Version:
  • Platform:

Somyarani13 avatar Aug 23 '22 09:08 Somyarani13

@Somyarani13 thank you for opening the issue! What kind of app do you have? Server or CLI app? What do your entrypoint and cmd instructions look like?

What happens when you use the --include-path parameter? That should be the right param to use if you want to keep extra files.

kcq avatar Aug 24 '22 02:08 kcq