![]() In Listing 2, you can see the two images I pulled from Docker Hub and their disk sizes. Image, one of the most popular images in use today. Now that it is available locally, I'll pull down the nginx Status: Downloaded newer image for dslim/docker-slim:latest The super-slight DockerSlim provides lots of options, but to get started, I'll pull down one of the most popular images locally and try and minify it: $ docker pull dslim/docker-slim I would recommend, for anything other than testing, to use Docker CE, so you get the latest stable release with the latest features. I'm using Linux Mint 19 (which uses Ubuntu 18.04 LTS under the bonnet), so to install Docker I'll use the command: $ apt install docker.io The Python examples in Listing 1 from the README file are impressive, although Node.js, Ruby, Golang, Java, PHP, and other languages can be expected to achieve similar results.Īlthough you can install the binaries required to run DockerSlim directly, for obvious reasons (because you're dealing with container images), you should focus on using the dslim/docker-slim Docker image that's been made available instead. The GitHub page has some eye-watering benchmarks that you might expect to achieve with a number of languages. Trimming the Fatīefore looking at how to get DockerSlim working, I'll show you a few examples on how trim you can expect certain container images to become. In this article, I look at how to automate the slimming of your container images and how to start tweaking the security profiles of your containers, as well. There, you'll also find a useful video that runs through some command-line options to get you started. The DockerSlim docs declare: "Don't change anything in your Docker container image and minify it by up to 30x (and for compiled languages even more) making it secure too!"Īs well as clear and useful docs in the GitHub page README file, you'll also appreciate the slick introduction on a single-page website that has a simple and effective example (before pointing you back to the GitHub repository again). The clever tool also makes a welcome foray into further securing your container images. In other words, it's a really good idea to keep your container images trim.Ī sophisticated piece of open source software allows you to do just that it's called DockerSlim. So, what would you say if I told you that you could automatically reduce the size of your Docker images 30x? Why are smaller container images a good thing? When it comes to containers, less is more: Your containers start quicker, they contain fewer security threats and bugs, they take up less storage, and they take less time to download and upgrade. Although not always the first choice, Docker Engine will be used extensively as the default container runtime in Kubernetes and OpenShift on cloud-native infrastructure for some time to come.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |