slimtoolkit / slim

Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
Apache License 2.0
19.56k stars 735 forks source link

in the carbon example, /node_modules/next/dist needs to be explicitly included #211

Open yuuuxt opened 3 years ago

yuuuxt commented 3 years ago

Expected Behavior

the carbon example isn't working as expected.

according to this comment, I thought I don't need to explicitly include (part of) node_modules.


Actual Behavior

I need to have /node_modules/next/dist to be explicitly included.


Steps to Reproduce the Problem

  1. docker pull yuuuxt/carbon:4.8.1 (docker hub, Dockerfile)
  2. (not working) docker-slim build --copy-meta-artifacts . --include-path=/app/carbon/.next --include-path=/app/carbon/public yuuuxt/carbon:4.8.1
  3. (working) docker-slim build --copy-meta-artifacts . --include-path=/app/carbon/.next --include-path=/app/carbon/public --include-path=/app/carbon/node_modules/next/dist yuuuxt/carbon:4.8.1

Specifications

kcq commented 3 years ago

Thanks for opening the issue @yuuuxt ! Curious if you customized your carbon app image (yuuuxt/carbon:4.8.1) in anyway or did you just build it with the Dockerfile from the carbon repo?

yuuuxt commented 3 years ago

Hi @kcq , thanks for the project and your reply! The Dockerfile is here (also updated in the issue above), I just used git clone instead of copying from context, I think they are alike?

rqi14 commented 4 months ago

I have a similar issue slimming perplexica docker images

kcq commented 4 months ago

@rqi14 just double checking... this project, right: https://github.com/ItzCrazyKns/Perplexica/tree/master

rqi14 commented 4 months ago

@rqi14 just double checking... this project, right: https://github.com/ItzCrazyKns/Perplexica/tree/master

Yes. I have a demo of building and slimming images here https://github.com/rqi14/Perplexica-docker

I have to specify several include paths