brauner / docker-melt Goto Github PK
View Code? Open in Web Editor NEWMinimalistic tool to melt all layers of a Docker image into a single layer
Minimalistic tool to melt all layers of a Docker image into a single layer
This is a bit hard to show given #1, but if it did work, you'll end up with the following:
% docker run -it tumbleweed:squashed sh
sh-4.3# useradd user
sh-4.3# su user
bash-4.3$ ping -c1 127.0.0.1
ping: icmp open socket: Operation not permitted
If you check the ping
binary with getcap
you find that it doesn't have any extended attributes (which it should on an opensuse
image).
If I have a Dockerfile
like this:
FROM opensuse/amd64:tumbleweed
RUN truncate --size 200M /somefile
RUN unlink /somefile
The resultant image is 200M larger than is necessary. When using melt
the resultant rootfs doesn't appear to realise that the file can be removed. Docker does appear to prioritise removal of files over their creation, which means that this doesn't cause effects like files sticking around even though they were removed.
You might want to look at how "whiteout" files are implemented.
If I generate a new image using melt
:
% docker save opensuse/amd64:tumbleweed > tumbleweed.tar
% ./melt -i tumbleweed.tar -o tumbleweed-squashed.tar -t tmp
% docker import tumbleweed-squashed.tar tumbleweed:squashed
% docker run -it tumbleweed:squashed sh
sh-4.3# useradd user
sh-4.3# su user
su: failed to execute /bin/bash: Permission denied
Which doesn't look right.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.