Comments (3)
The base image is 1.04gb.
- Removing docker & docker-compose saves 466mb
- Removing C/C++ toolchain (autoconf, build-essential, pkg-config, software-properties-common) saves 234mb
- Adding
--no-install-recommends
to mainapt-get install
saves 10mb - Replacing
vim
withvim-tiny
saves 53mb - Removing dockerize saves 10mb
- Removing maria/pg libs saves 55mb
Final size is 212mb.
Packages you might want to re-add:
- python3-minimal is 25mb (+10%)
- maria/pg libs are +55mb (+25%)
from cimg-base.
Hi Alex,
Thank for opening this issue and all of the thought you put into it. I agree with your sentiment however I do want to explain that our philosophy on CI focused Docker images differs a bit from a production Docker image. We run over 35 million builds a month with customers doing everything in the world you could image. There's a balance we need to strike with the size of the image vs pre-installing tools that will help a majority of users. With Docker layer caching, it's often that although the image is larger, it's ultimately faster for the majority of users using Convenience Images.
For example, "Removing C/C++ toolchain", a lot of other Convenience Images need these tools for compiling what's in their image. Docker, Docker Compose, and dockerize are all frequently used tools on CircleCI. Especially Docker itself. It's ingrained in our documentation, some sample projects, and many tools. Removing them is just not currently an option.
There are good points you've made. For example, using --no-install-recommends
will save us space in the image and is something we're going to do. We have an existing Issue for that already (#86). It's not completed yet because of backwards compatibility issues. This change will remove a number of packages that we need to properly communicate to customers before we make the change. It is on the list though.
vim-tiny
- This is also a good suggestion. I opened a PR for it today (#99). Good catch.
Thank you for the suggestions. I'm going to close this Issue but we'll be paying attention to the size of images.
from cimg-base.
Thankyou for the response! Sorry for my slow reply.
You pointed out that it's impossible to make major changes (like removing Docker/build-essential) to such a widely used image. That is very true, and I should have realised it.
But I think you can remove these things from an image variant. For example, cimg/base:stable-slim
is the same image without Docker or the build-essential. The existing image cimg/base:stable
would be unchanged.
I think most cimg/base users would move to -slim variants happily for faster CI builds. You have the stats, maybe cimg/base is used by 95% C++ CI projects. I don't think so though :)
For example, "Removing C/C++ toolchain", a lot of other Convenience Images need these tools for compiling what's in their image.
If the toolchain is used to build other sub-images, it doesn't have to remain in the image for everyone to download. I am sure you are familiar with multi-stage build process:
FROM debian:stable as builder
RUN apt install build-essential
RUN wget redis.org/stable.tar.gz && ...
FROM cimg/base:stable as builder
COPY --from=builder /usr/local/redis /usr/local/redis
I actually couldn't see any cimg images that rely on C/C++ compilation, so I couldn't give you a real world example here. But I will happily write one if you point me at a use-case.
from cimg-base.
Related Issues (20)
- Where is SSH_CONFIG_DIR set? HOT 1
- The sample won't pass as cowsay is not in the system path HOT 1
- Checkout step of build fails after release on 19 May 2022 HOT 5
- Nana123
- Basic Checkout of build fails on 22.04, works on 20.04 HOT 7
- Ubuntu 22.04 becomes default starting with July edge and September current HOT 1
- libncurses5-dev in stable-20.4 5 days ago, now is not present HOT 1
- Install git-lfs
- Docker Compose 2.10.1 HOT 1
- Upgrade `yq` to `v4.26.1` for CVE fix HOT 1
- Update Dockerize
- Might need alternative git source HOT 1
- Can you create this image please? HOT 1
- Add Retry Command HOT 2
- Docker image 20.04 and 18.04 no more pushed on Docker Hub HOT 3
- Missing file package HOT 1
- BUG: linking errors with cimg/python:3.11.0 and glibc HOT 2
- Last Ubuntu 18.04 Release will be for March 2023
- Test issue
- Incorrect version of yq for arm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cimg-base.