From 8d7f3abd2d6384f18ba4da569cdd70463ad1439f Mon Sep 17 00:00:00 2001 From: "Dotan J. Nahum" Date: Thu, 5 Oct 2017 20:51:41 +0300 Subject: [PATCH 1/7] Reflect 'latest' in imagelayers.io image. (#435) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 200b715..753f2bf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # A minimal Ubuntu base image modified for Docker-friendliness -[![](https://badge.imagelayers.io/phusion/baseimage:0.9.17.svg)](https://imagelayers.io/?images=phusion/baseimage:latest 'Get your own badge on imagelayers.io') +[![](https://badge.imagelayers.io/phusion/baseimage:latest.svg)](https://imagelayers.io/?images=phusion/baseimage:latest 'Get your own badge on imagelayers.io') [![Travis](https://img.shields.io/travis/phusion/baseimage-docker.svg)](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._ From 2bb9d89325edd91b08397e3643cd589143fa1cde Mon Sep 17 00:00:00 2001 From: David Hiendl Date: Thu, 5 Oct 2017 21:13:01 +0200 Subject: [PATCH 2/7] configured syslog-ng to log to stdout directly instead of using tail (#438) --- image/services/syslog-ng/logrotate_syslogng | 2 -- image/services/syslog-ng/syslog-forwarder.runit | 2 -- image/services/syslog-ng/syslog-ng.conf | 5 ++++- image/services/syslog-ng/syslog-ng.sh | 4 ---- 4 files changed, 4 insertions(+), 9 deletions(-) delete mode 100755 image/services/syslog-ng/syslog-forwarder.runit diff --git a/image/services/syslog-ng/logrotate_syslogng b/image/services/syslog-ng/logrotate_syslogng index 114cb09..38ad512 100644 --- a/image/services/syslog-ng/logrotate_syslogng +++ b/image/services/syslog-ng/logrotate_syslogng @@ -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 } diff --git a/image/services/syslog-ng/syslog-forwarder.runit b/image/services/syslog-ng/syslog-forwarder.runit deleted file mode 100755 index 5bd832f..0000000 --- a/image/services/syslog-ng/syslog-forwarder.runit +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec tail -F -n 0 /var/log/syslog diff --git a/image/services/syslog-ng/syslog-ng.conf b/image/services/syslog-ng/syslog-ng.conf index 9dc76a3..11f6b41 100644 --- a/image/services/syslog-ng/syslog-ng.conf +++ b/image/services/syslog-ng/syslog-ng.conf @@ -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); }; diff --git a/image/services/syslog-ng/syslog-ng.sh b/image/services/syslog-ng/syslog-ng.sh index 2b0be4a..5c25e9d 100755 --- a/image/services/syslog-ng/syslog-ng.sh +++ b/image/services/syslog-ng/syslog-ng.sh @@ -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 From 2be1e6f407b63b811b4186d2eb739ca3e9619c4b Mon Sep 17 00:00:00 2001 From: Morten Abildgaard Date: Sun, 8 Oct 2017 11:42:53 +0200 Subject: [PATCH 3/7] Adding "more" to the first sentence. I think this is what it's supposed to say. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 753f2bf..7c946a5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![](https://badge.imagelayers.io/phusion/baseimage:latest.svg)](https://imagelayers.io/?images=phusion/baseimage:latest 'Get your own badge on imagelayers.io') [![Travis](https://img.shields.io/travis/phusion/baseimage-docker.svg)](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: From 6a774f2f48c4b19372051a15bd41ae77f9e4e026 Mon Sep 17 00:00:00 2001 From: Steven Conaway Date: Mon, 23 Oct 2017 18:53:46 -0700 Subject: [PATCH 4/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c946a5..6864072 100644 --- a/README.md +++ b/README.md @@ -485,7 +485,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). #### Using your own key From fcc1283c855f67d5e2cc56a719a2b0b5ce63c9ee Mon Sep 17 00:00:00 2001 From: Steve Kamerman Date: Mon, 16 Oct 2017 23:31:26 -0400 Subject: [PATCH 5/7] Added install_clean.sh utility --- README.md | 1 + image/bin/install_clean.sh | 10 ++++++++++ image/utilities.sh | 3 +++ 3 files changed, 14 insertions(+) create mode 100755 image/bin/install_clean.sh diff --git a/README.md b/README.md index 6864072..b123b60 100644 --- a/README.md +++ b/README.md @@ -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.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. diff --git a/image/bin/install_clean.sh b/image/bin/install_clean.sh new file mode 100755 index 0000000..2a5310b --- /dev/null +++ b/image/bin/install_clean.sh @@ -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/* diff --git a/image/utilities.sh b/image/utilities.sh index 9f0c1a9..8b452db 100755 --- a/image/utilities.sh +++ b/image/utilities.sh @@ -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.sh /sbin/install_clean.sh From c41f837f82b4d8780f78fed1770c4b9bfd5af181 Mon Sep 17 00:00:00 2001 From: Steve Kamerman Date: Tue, 17 Oct 2017 16:39:19 -0400 Subject: [PATCH 6/7] Added `--no-install-recommends` by default --- README.md | 2 +- image/bin/install_clean.sh | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b123b60..691439c 100644 --- a/README.md +++ b/README.md @@ -95,7 +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.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. | +| `install_clean.sh` | 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. diff --git a/image/bin/install_clean.sh b/image/bin/install_clean.sh index 2a5310b..3f829bc 100755 --- a/image/bin/install_clean.sh +++ b/image/bin/install_clean.sh @@ -1,10 +1,17 @@ -#!/bin/sh +#!/bin/bash -e # Apt installer helper for Docker images -set -e +ARGS="$*" +NO_RECOMMENDS="--no-install-recommends" +RECOMMENDS="--install-recommends" +if [[ $ARGS =~ "$RECOMMENDS" ]]; then + NO_RECOMMENDS="" + ARGS=$(sed "s/$RECOMMENDS//g" <<<"$ARGS") +fi -echo "Installing $*" -apt-get -q update && apt-get -qy install $* \ +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/* From 421ca4ea059800b35ef7fbf78cdfdd41f3c3a9b2 Mon Sep 17 00:00:00 2001 From: Steve Kamerman Date: Wed, 18 Oct 2017 02:02:27 -0400 Subject: [PATCH 7/7] Renamed install_clean --- README.md | 2 +- image/bin/{install_clean.sh => install_clean} | 0 image/utilities.sh | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename image/bin/{install_clean.sh => install_clean} (100%) diff --git a/README.md b/README.md index 691439c..7993e3c 100644 --- a/README.md +++ b/README.md @@ -95,7 +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.sh` | 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`. | +| `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. diff --git a/image/bin/install_clean.sh b/image/bin/install_clean similarity index 100% rename from image/bin/install_clean.sh rename to image/bin/install_clean diff --git a/image/utilities.sh b/image/utilities.sh index 8b452db..d1aa273 100755 --- a/image/utilities.sh +++ b/image/utilities.sh @@ -11,4 +11,4 @@ ln -s /usr/bin/vim.tiny /usr/bin/vim 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 +cp /bd_build/bin/install_clean /sbin/install_clean