-
Notifications
You must be signed in to change notification settings - Fork 2k
Use debian:*-slim image as base for node:*-slim #618
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
Comments
It's mostly because we use curl to download the Node.js and yarn binaries. |
Thank you for the reply :-) The slim debian image variants differ in more than just curl - they also exclude a number of superfluous files: As such manually installing curl into the debian:*-slim images would still have a net size win - plus curl could always be treated as a build-time only dependency and uninstalled afterwards (like other official images do). |
That seems pretty compelling, especially the file-size reduction. If we do switch to |
I looked into this a little bit more. The |
The ghost image would love to adapt to such a change, but I can't speak for
any other image maintainers. 😇
|
Would having |
It didn’t really seem like it when I tried it, but I don’t recall what the size difference was. |
I think maybe we just err on the side of making the image smaller (with curl and the ca certs installed as |
Just did a test of diff --git a/10/slim/Dockerfile b/10/slim/Dockerfile
index ccd8ece..db9ca55 100644
--- a/10/slim/Dockerfile
+++ b/10/slim/Dockerfile
@@ -1,4 +1,6 @@
-FROM buildpack-deps:jessie-curl
+FROM debian:jessie-slim
+
+RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl wget && rm -rf /var/lib/apt/lists/*
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node Before: ~233MB |
Nice! |
150MB if we put ca-certificates and curl in |
I'm going to do a PR for switching to |
Hi!
The slim image variants (for example:
node:9.4.0-slim
) currently usebuildpack-deps:jessie-curl
as the image base (which is 72MB).I was wondering if there was a reason why
debian:jessie-slim
ordebian:stretch-slim
(which are 30MB and 22MB respectively) aren't used instead? As a datapoint the official Python images recently made a similar switch (docker-library/python#233).If this is something people would be open to, I'm happy to create a PR :-)
The text was updated successfully, but these errors were encountered: