mirror of
https://github.com/wsargent/docker-cheat-sheet.git
synced 2025-12-17 07:30:13 +01:00
Update README
Adds more context and information around how to minimize image layers
This commit is contained in:
parent
a2f2e85fcf
commit
81ac229b53
1 changed files with 6 additions and 3 deletions
|
|
@ -523,10 +523,13 @@ docker images -viz | dot -Tpng -o docker.png
|
||||||
|
|
||||||
### Slimming down Docker containers [Intercity Blog](http://bit.ly/1Wwo61N)
|
### Slimming down Docker containers [Intercity Blog](http://bit.ly/1Wwo61N)
|
||||||
|
|
||||||
- Cleaning APT
|
- Cleaning APT in a RUN layer
|
||||||
|
This should be done in the same layer as other apt commands.
|
||||||
|
Otherwise, the previous layers still persist the original information and your images will still be fat.
|
||||||
```
|
```
|
||||||
RUN apt-get clean
|
RUN {apt commands} \
|
||||||
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
```
|
```
|
||||||
- Flatten an image
|
- Flatten an image
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue