Open sureshkachwa opened 1 year ago
@sureshkachwa looks like there's potentially a number of different issues there. First of all, including the root directory (with --include-path /
) is not supported at this point in time. When the main app sees /
as an include it ignores it (there should be a console message saying that the /
include is ignored). The error snippet you shared show IPC errors, which might happen if the temporary container isn't running anymore. It's possible it crashed. Looking at the temporary container logs might provide additional clues.
It's also not quite clear what you are trying to accomplish. Do you mind sharing a bit of context for your setup? Why are you using slim
if you don't need to slim
the image?
@kcq to be more specific
The standard dockerfile uses tomcat as the base image with few RUN,COPY,ARGS and one CMD instruction as well.
The COPY instruction does copy our application war file to /usr/local/tomcat and docker-slim is removing it. I am trying to slim the image without losing the image purpose.
I also see that the docker-slim is removing the standard ls
,cat
commands as well.
I also tried docker-slim build --target kk:10.1 --tag kk:10.1 --include-path /usr/local/tomcat --http-probe=false
But still docker-slim is removing the webapps folder under /usr/local/tomcat and I see go libraries in this location
@kcq to be more specific
The standard dockerfile uses tomcat as the base image with few RUN,COPY,ARGS and one CMD instruction as well.
The COPY instruction does copy our application war file to /usr/local/tomcat and docker-slim is removing it. I am trying to slim the image without losing the image purpose.
I also see that the docker-slim is removing the standard ls
,cat
commands as well.
I also tried docker-slim build --target kk:10.1 --tag kk:10.1 --include-path /usr/local/tomcat --http-probe=false
But still docker-slim is removing the webapps folder under /usr/local/tomcat and I see go libraries in this location
Thank you for the additional context @sureshkachwa ! It's great that you have a CMD instruction. What does it look like? Can you also share an example of your docker run
command when you run your tomcat app image?
'ls', 'cat' and many other shell related components get removed by default. You can use the --include-shell
command that will allow you to keep the basic parts of your shell. You can also use the --include-exe
and --include-bin
to make sure you keep other image apps.
@kcq sure, I'll give it a try and share the command as well
@sureshkachwa Hey, do you have updates by any chance?
I haven't worked on it yet, Let me try and update here.
The actual command to build the docker image is
docker build --network=host -t moon:${VERSION}
The command executed to slim the image isdocker-slim build --target moon:${VERSION} --tag moon:${VERSION} --http-probe=false --include-path /
can target and tag have the same value?The expected behavior is to slim the image while not replacing any file or folder from the actual image
Steps to Reproduce the Problem
Below is the error: ```message='YOU CAN USE THESE PORTS TO INTERACT WITH THE CONTAINER' cmd=build info=continue.after mode='enter' message='provide the expected input to allow the container inspector to continue its execution' cmd=build prompt='USER INPUT REQUIRED, PRESS