Skip to content
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

Optimize node images removing the content in /tmp folder #1326

Open
navarroaxel opened this issue Sep 15, 2020 · 3 comments
Open

Optimize node images removing the content in /tmp folder #1326

navarroaxel opened this issue Sep 15, 2020 · 3 comments

Comments

@navarroaxel
Copy link

Analyzing the docker layers of node:latest, node:slim and node:alpine images using dive

I found that the Yarn installation adds a /tmp/v8-compile-cache-0 with a size 2.2MiB in all these images and this is not needed for the users of theses images.

node:alpine
Screenshot_20200915_080820
node:slim
Screenshot_20200915_081850
node:latest
Screenshot_20200915_081412

Also, the /var/cache and /var/log folders sounds useless.

Let me know if I can help submitting a PR with

rm -rf /tmp/*
@nschonni
Copy link
Member

There is an open PR for some of this over here #1283

@MichaelLeeHobbs
Copy link

Not to be rude but why has this not been addressed? To be clear there is nothing the downstream users can do within the standard docker framework to clear tmp of the previous layers even with squash which is still considered experimental.

RUN npm install --omit=dev \
    && npm cache clean --force \
    && rm -rf /tmp/* \
    && rm -rf node_modules/@aws-sdk/client-ec2/dist-types \
    && rm -rf node_modules/@aws-sdk/client-ec2/dist-es \
    && rm -rf node_modules/@types \
    && ls -al /tmp # empty as expected
docker build -t jaspermanager-server . --squash --progress=plain

Inspecting the image still shows /tmp/v8-compile-cache-0

In many ways, this relates to other issues like #777. When you are dealing with slow networks every byte counts.

@rockdrilla rockdrilla mentioned this issue Apr 10, 2023
12 tasks
@PeterDaveHello
Copy link
Member

This issue is now addressed by #2049

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@nschonni @navarroaxel @PeterDaveHello @MichaelLeeHobbs and others