mirror of
https://github.com/phusion/baseimage-docker.git
synced 2026-03-26 04:18:46 +00:00
Merge branch 'master' into syslog-shutdown
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# A minimal Ubuntu base image modified for Docker-friendliness
|
||||
|
||||
[](https://imagelayers.io/?images=phusion/baseimage:latest 'Get your own badge on imagelayers.io')
|
||||
[](https://imagelayers.io/?images=phusion/baseimage:latest 'Get your own badge on imagelayers.io')
|
||||
[](https://travis-ci.org/phusion/baseimage-docker)
|
||||
|
||||
_Baseimage-docker only consumes 6 MB RAM and is much powerful than Busybox or Alpine. See why below._
|
||||
_Baseimage-docker only consumes 6 MB RAM and is much more powerful than Busybox or Alpine. See why below._
|
||||
|
||||
Baseimage-docker is a special [Docker](https://www.docker.com) image that is configured for correct use within Docker containers. It is Ubuntu, plus:
|
||||
|
||||
@@ -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. |
|
||||
| [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`. |
|
||||
| `install_clean` | A tool for installing `apt` packages that automatically cleans up after itself. All arguments are passed to `apt-get -y install --no-install-recommends` and after installation the apt caches are cleared. To include recommended packages, add `--install-recommends`. |
|
||||
|
||||
Baseimage-docker is very lightweight: it only consumes 6 MB of memory.
|
||||
|
||||
@@ -485,7 +486,7 @@ Edit your Dockerfile to install the insecure key permanently:
|
||||
|
||||
RUN /usr/sbin/enable_insecure_key
|
||||
|
||||
Instructions for logging in the container is the same as in section [Using the insecure key for one container only](#using_the_insecure_key_for_one_container_only).
|
||||
Instructions for logging into the container is the same as in section [Using the insecure key for one container only](#using_the_insecure_key_for_one_container_only).
|
||||
|
||||
<a name="using_your_own_key"></a>
|
||||
#### Using your own key
|
||||
|
||||
17
image/bin/install_clean
Executable file
17
image/bin/install_clean
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash -e
|
||||
# Apt installer helper for Docker images
|
||||
|
||||
ARGS="$*"
|
||||
NO_RECOMMENDS="--no-install-recommends"
|
||||
RECOMMENDS="--install-recommends"
|
||||
if [[ $ARGS =~ "$RECOMMENDS" ]]; then
|
||||
NO_RECOMMENDS=""
|
||||
ARGS=$(sed "s/$RECOMMENDS//g" <<<"$ARGS")
|
||||
fi
|
||||
|
||||
echo "Installing $ARGS"
|
||||
|
||||
apt-get -q update && apt-get -qy install $NO_RECOMMENDS $ARGS \
|
||||
&& apt-get -qy autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -r /var/lib/apt/lists/*
|
||||
@@ -8,7 +8,6 @@
|
||||
compress
|
||||
postrotate
|
||||
sv reload syslog-ng > /dev/null
|
||||
sv restart syslog-forwarder > /dev/null
|
||||
endscript
|
||||
}
|
||||
|
||||
@@ -34,6 +33,5 @@
|
||||
sharedscripts
|
||||
postrotate
|
||||
sv reload syslog-ng > /dev/null
|
||||
sv restart syslog-forwarder > /dev/null
|
||||
endscript
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
exec tail -F -n 0 /var/log/syslog
|
||||
@@ -74,6 +74,9 @@ destination d_xconsole { pipe("/dev/xconsole"); };
|
||||
# Debian only
|
||||
destination d_ppp { file("/var/log/ppp.log"); };
|
||||
|
||||
# stdout for docker
|
||||
destination d_stdout { pipe("/dev/stdout"); };
|
||||
|
||||
########################
|
||||
# Filters
|
||||
########################
|
||||
@@ -119,7 +122,7 @@ log { source(s_src); filter(f_cron); destination(d_cron); };
|
||||
log { source(s_src); filter(f_daemon); destination(d_daemon); };
|
||||
log { source(s_src); filter(f_kern); destination(d_kern); };
|
||||
log { source(s_src); filter(f_lpr); destination(d_lpr); };
|
||||
log { source(s_src); filter(f_syslog3); destination(d_syslog); };
|
||||
log { source(s_src); filter(f_syslog3); destination(d_syslog); destination(d_stdout); };
|
||||
log { source(s_src); filter(f_user); destination(d_user); };
|
||||
log { source(s_src); filter(f_uucp); destination(d_uucp); };
|
||||
|
||||
|
||||
@@ -15,10 +15,6 @@ touch /var/log/syslog
|
||||
chmod u=rw,g=r,o= /var/log/syslog
|
||||
cp $SYSLOG_NG_BUILD_PATH/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
|
||||
|
||||
## Install syslog to "docker logs" forwarder.
|
||||
mkdir /etc/service/syslog-forwarder
|
||||
cp $SYSLOG_NG_BUILD_PATH/syslog-forwarder.runit /etc/service/syslog-forwarder/run
|
||||
|
||||
## Install logrotate.
|
||||
$minimal_apt_get_install logrotate
|
||||
cp $SYSLOG_NG_BUILD_PATH/logrotate.conf /etc/logrotate.conf
|
||||
|
||||
@@ -9,3 +9,6 @@ ln -s /usr/bin/vim.tiny /usr/bin/vim
|
||||
|
||||
## This tool runs a command as another user and sets $HOME.
|
||||
cp /bd_build/bin/setuser /sbin/setuser
|
||||
|
||||
## This tool allows installation of apt packages with automatic cache cleanup.
|
||||
cp /bd_build/bin/install_clean /sbin/install_clean
|
||||
|
||||
Reference in New Issue
Block a user