Minideb – A small image based on Debian designed for use in containers
github.com
github.com
A recent analysis showed that the debian:latest image is "updated roughly every month" https://anchore.com/blog/look-often-docker-images-updated/
I'm skeptical about this claim. Almost every image built from the Debian official image begins with `apt-get update` before you can actually install anything, which means you will almost always have the latest packages at the time of building.
$ sudo debootstrap stretch mydebian http://mirrors.kernel.org/debian/
$ cd mydebian
$ sudo tar -c . | docker import - mydebian
Plus you can add files to the system before taring etc...If you have significant work to do on an image a Dockerfile can often be far more complex than this method.
because i'm a baseimage maintainer (http://github.com/phusion/baseimage) and I don't think that's true...
https://github.com/phusion/baseimage-docker/blob/master/imag...
My feeling is that I don't know how long a base-image will stick around. If ca-certificates is installed in my base image it may end up trusting revoked certificates.
IMHO it is better to know you need to install/bake in ca-certs from a trusted source than to having a built in, potentially compromised CA cert installed.
Baked images, which I use to reduce instantiation time, or 'golden' images that are immutable infrastructure tend to have shorter lifespans and the CA package is carried in the application dependencies and more likely to be up to date.
It is not intended that users will download this baseimage (although it is a supported configuration, you can use FROM phusion/baseimage) but, that this will be an image definition that users can easily rebuild and build off of it.
Step one in Docker competency is "do you know exactly where your image comes from, and can you rebuild it from scratch without trusting that some rando on the internet didn't put bad stuff in there?"
Step two is "ok, do you really actually build them, though"
This image has traditionally been based on LTS ubuntu, and if you look at the CentOS derived version that hasn't been updated since 2014 (pokle/centos-baseimage), they chose not to include ca-certificates or hardly anything else.
(I'm assuming that tianon/centos:6.5 does not install ca-certificates by default...)
I'm sure many people use FROM phusion/baseimage but personally, even as a maintainer, I don't. I'd change the image source to whatever upstream of Ubuntu I'm preferring today, and probably build that from scratch too. The value in this image is not that it comes pre-built, it's that the build is tested and supported. /side tangent
A base image is an image that you're meant to build off of, it is not meant to be deployed as an application but as a base for your image. What part of what I said was disingenuous? I gave a link to some source code that I didn't write and provided a counter example, identifying myself as a contributor. What did you contribute?
What is wrong with your first comment is:
1. zenlikethat's comment obviously talks about base images in general, not about a specific base image ("...most base images...")
2. Your reply which disagrees with that is based on a very basic fallacy (there is a one base image which contains ssl so zenlikethat's claim is false!?)
3. Your example is a base image which you're a maintainer of
Considering (1) is obvious and (2) is a very basic fallacy nobody here should fall for, your comment seems like an intentional and unwarranted plug for "phusion/baseimage" instead of a valid and honest disagreement to zenlikethat's comment. (extra points for unwarranted plug of your domain expertise in immediate parent comment)
Forgive me for misunderstanding your comment, but `"base image" != "baseimage"` did not have a great deal of substance to it, nor did it provide me with any insight about the topic.
I provided an example, to facilitate the discussion. So back to my last question, what did you contribute?
Edit: https://en.1jux.net/scale_images/357695_b.jpg
Have a laugh and a beer!
(These have to be advisories actually affecting the image, not all of them)
Here's a silly example:
cde python -c "import numpy as np; print(np.random.randn(3, 3).tolist())"
pushd cde-package/cde-root/; tar cavf ../../cde-image.tar *; popd
docker import cde-image.tar $USER:python-randn33
docker run $USER:python-randn33 python -c "import numpy as np; print(np.random.randn(3, 3).tolist())"
docker run -t -i $USER:python-randn33 python
If you look at the resulting "cde-image.tar" you'll find it to be quite bare. Mines had only 387 entries (files and folders).[1]: http://www.pgbovine.net/cde.html
[2]: http://pgbovine.net/automatically-create-docker-images.htm
Have a look at the lengths that AFL uses to get even close: http://lcamtuf.coredump.cx/afl/
[tl;dr it intruments execution while using a genetic algorithm to mutate inputs optimising for code coverage]
Statically determining dependencies is a lot easier and a lot more reliable! Particularly as you only need the base image once, and any extras on top are another layer on the Docker FS.
The minideb image currently weighs in at around 50MB uncompressed. For comparison the debian library image is 123MB, the alpine image is 5MB, and the newly released amazonlinuximage is 328MB.
Anybody have experience with minideb vs. debian:stable-slim? Any pros/cons to either approach?
Worth also mentioning it is the base image for ALL the Bitnami Containers that at the same time are also automatically built, updated and tested. You can take a look at all of them in Github. There are a ton of them
Does look interesting for things that need glibc compatibility though. There are some packages to help with that in Alpine but they only go so far.
https://dzone.com/articles/minideb-a-minimalist-debian-based...
I'm not surprised that I got something a lot smaller from just running `apk add python3.6`, although as a result they are not comparing apples to apples; their minideb example does pretty much exactly the equivalent (i.e. downloading the distro-provided package, not compiling it within their image).
You don’t need to add python “to do anything interesting.”
debian 101M
alpine 4.1M
amazonlinux 160M
These were determined with the following: for image in debian:latest alpine:latest amazonlinux:latest; do
docker pull $image
size=$(docker save $image | wc -c)
echo "\n$image is $(echo $size | numfmt --to=iec)\n"
done
Please note that it's important to only do this test with either a completely clean image store OR to save an exact sha256 image digest tag.If you try to do a `docker save` on a store where you have multiple copies of an image, it's easy to mess up and save old layers too. I suspect that's what happened with your amazonlinux test above.
Anybody know how big minideb is?
Edit: zwerdids posted that it's ~50MB so a wee bit smaller than the currently commonly used Fedora container image. And an order of magnitude bigger than an Alpine image.
Edit: I would like to know where exactly this 5-6MB is saved.
$ install_packages mime-support
vs: $ apt-get update && apt-get install -y --no-install-recommends mime-support && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
That's a great win in itself, this is excellent.A little OT but how does bitnami make money? They don't seem to charge AMIs atleast. So, I guess they charge AWS/GCE for providing 1-click images? Or are they a consulting company (if so, why choose them over the original app authors)? Or both?
launcher.gcr.io/google/debian8
(besides debian version)I suppose it wouldn't hurt to have smaller image layers when updating these containers more frequently to save on bandwidth at least.
"The point [..] isn't about disk savings as much as minimizing dependencies and surface area of attacks such as for glibc, bash, and OpenSSL in the past several years."
Technically they didn't say specifically how they would minimize surface area of attacks, so my assumption that they meant only by minimizing dependencies (seeing as their comment was followed by a list of dependencies) may have been faulty. Thanks for letting me know that in such a kind way.
Removing outlying code that could be used as part of an attack can be useful for complex attacks. But they are essentially outliers - the actual code that you are actually running and is the actual target is still there, waiting to be pwnd. The time you spend trimming fat can often be better used to actually harden a system's access control or policies/procedures, perform auditing, etc.
Assuming, initial size is zero. If you install 100MB of packages in layer 1.
Then in second layer, you uninstall of those packages. Your image size will still be 100MB.
If you are optimizing for high density, a smaller size certainly helps.
Requirements:
- Quick to setup, best would be a one-liner and not something I have to google everytime
- Update and reboot times can be slightly randomized, so the entire cluster won't go down