forked from Docker/baseimage-docker
Added install_clean.sh utility
This commit is contained in:
committed by
Kingdon Barrett
parent
ffc1f6db05
commit
fcc1283c85
@@ -95,6 +95,7 @@ You can configure the stock `ubuntu` image yourself from your Dockerfile, so why
|
|||||||
| cron | The cron daemon must be running for cron jobs to work. |
|
| cron | The cron daemon must be running for cron jobs to work. |
|
||||||
| [runit](http://smarden.org/runit/) | Replaces Ubuntu's Upstart. Used for service supervision and management. Much easier to use than SysV init and supports restarting daemons when they crash. Much easier to use and more lightweight than Upstart. |
|
| [runit](http://smarden.org/runit/) | Replaces Ubuntu's Upstart. Used for service supervision and management. Much easier to use than SysV init and supports restarting daemons when they crash. Much easier to use and more lightweight than Upstart. |
|
||||||
| `setuser` | A tool for running a command as another user. Easier to use than `su`, has a smaller attack vector than `sudo`, and unlike `chpst` this tool sets `$HOME` correctly. Available as `/sbin/setuser`. |
|
| `setuser` | A tool for running a command as another user. Easier to use than `su`, has a smaller attack vector than `sudo`, and unlike `chpst` this tool sets `$HOME` correctly. Available as `/sbin/setuser`. |
|
||||||
|
| `install_clean.sh` | A tool for installing `apt` packages that automatically cleans up after itself. All arguments are passed to `apt-get -y install` and after installation the apt caches are cleared. |
|
||||||
|
|
||||||
Baseimage-docker is very lightweight: it only consumes 6 MB of memory.
|
Baseimage-docker is very lightweight: it only consumes 6 MB of memory.
|
||||||
|
|
||||||
|
|||||||
10
image/bin/install_clean.sh
Executable file
10
image/bin/install_clean.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Apt installer helper for Docker images
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Installing $*"
|
||||||
|
apt-get -q update && apt-get -qy install $* \
|
||||||
|
&& apt-get -qy autoremove \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -r /var/lib/apt/lists/*
|
||||||
@@ -9,3 +9,6 @@ ln -s /usr/bin/vim.tiny /usr/bin/vim
|
|||||||
|
|
||||||
## This tool runs a command as another user and sets $HOME.
|
## This tool runs a command as another user and sets $HOME.
|
||||||
cp /bd_build/bin/setuser /sbin/setuser
|
cp /bd_build/bin/setuser /sbin/setuser
|
||||||
|
|
||||||
|
## This tool allows installation of apt packages with automatic cache cleanup.
|
||||||
|
cp /bd_build/bin/install_clean.sh /sbin/install_clean.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user