From 00034a9965a3e802b79d15cc6417945f7afe7b4f Mon Sep 17 00:00:00 2001 From: Kingdon Barrett Date: Tue, 21 Mar 2017 09:26:00 -0400 Subject: [PATCH 01/12] Fix grammar Looks like a proofreading error --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b2de46..7aa1cb4 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Baseimage-docker gets everything right. The "Contents" section describes all the You can configure the stock `ubuntu` image yourself from your Dockerfile, so why bother using baseimage-docker? * Configuring the base system for Docker-friendliness is no easy task. As stated before, there are many corner cases. By the time that you've gotten all that right, you've reinvented baseimage-docker. Using baseimage-docker will save you from this effort. - * It reduces the time needed to write a correct Dockerfile. You won't have to worry about the base system and focusing you on the stack and the app. + * It reduces the time needed to write a correct Dockerfile. You won't have to worry about the base system and you can focus on the stack and the app. * It reduces the time needed to run `docker build`, allowing you to iterate your Dockerfile more quickly. * It reduces download time during redeploys. Docker only needs to download the base image once: during the first deploy. On every subsequent deploys, only the changes you make on top of the base image are downloaded. From 59677e23c32521ab0a474af774481cc3f4440642 Mon Sep 17 00:00:00 2001 From: Enderson Maia Date: Tue, 21 Mar 2017 15:46:37 -0300 Subject: [PATCH 02/12] Preserve /bd_build/{cleanup.sh,buildconfig} files. See #188 Signed-off-by: Enderson Maia --- image/cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image/cleanup.sh b/image/cleanup.sh index 1dd3ad0..bd53c72 100755 --- a/image/cleanup.sh +++ b/image/cleanup.sh @@ -4,7 +4,7 @@ source /bd_build/buildconfig set -x apt-get clean -ls -d -1 /bd_build/**/* | grep -v "cleanup.sh" | grep -v "buildconfig" | grep -v "services/" | xargs rm -f +find /bd_build/ -not \( -name 'bd_build' -or -name 'buildconfig' -or -name 'cleanup.sh' \) -delete rm -rf /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* From 45facca75e38eb5fba03add71d0bad1aeeac2a57 Mon Sep 17 00:00:00 2001 From: Luca Favatella Date: Thu, 23 Mar 2017 17:16:38 +0000 Subject: [PATCH 03/12] Correct translation of syslog-ng driver `system()` on Docker According to [the stock Ubuntu 16.04 config](https://github.com/hyperknot/baseimage16/blob/1.0.1/image/services/syslog-ng/syslog-ng.conf.original#L21), the default source driver is `system()`, that is documented in [the syslog-ng 3.5 official documentation](https://www.balabit.com/documents/syslog-ng-ose-3.5-guides/en/syslog-ng-ose-guide-admin/html-single/index.html#configuring-source-system) on Linux as `unix-dgram("/dev/log");` with some `/proc/kmsg` involvement if kernel "is version 3.5 or newer". `/proc/kmsg` causes trouble on Docker hence using syslog-ng 3.5 on Docker `unix-dgram("/dev/log")` shall be used (not `unix-stream("/dev/log");`). If using syslog-ng [3.6](https://www.balabit.com/documents/syslog-ng-ose-3.6-guides/en/syslog-ng-ose-guide-admin/html-single/index.html#configuring-source-system) or [newer](https://www.balabit.com/documents/syslog-ng-ose-3.9-guides/en/syslog-ng-ose-guide-admin/html-single/index.html#configuring-source-system) on Docker, `system()` shall be able to be used. But [Ubuntu 16.04 is at syslog-ng 3.5](http://packages.ubuntu.com/xenial/syslog-ng-core) so `system()` cannot be used. See also https://github.com/phusion/baseimage-docker/issues/277 --- image/services/syslog-ng/syslog-ng.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image/services/syslog-ng/syslog-ng.conf b/image/services/syslog-ng/syslog-ng.conf index 832e67a..9dc76a3 100644 --- a/image/services/syslog-ng/syslog-ng.conf +++ b/image/services/syslog-ng/syslog-ng.conf @@ -18,7 +18,7 @@ options { chain_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); # Logs may come from unix stream, but not from another machine. # source s_src { - unix-stream("/dev/log"); + unix-dgram("/dev/log"); internal(); }; From 3c0e09426d1c396bfd5308713549c186c4a6d616 Mon Sep 17 00:00:00 2001 From: shooter Date: Fri, 31 Mar 2017 17:19:28 +0800 Subject: [PATCH 04/12] typo chinese translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit '负责' means 'responsible' '复杂' means 'complex', metaphorical meaning 'too noisy' --- README_ZH_cn_.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README_ZH_cn_.md b/README_ZH_cn_.md index 60e2c54..4aa0ea1 100644 --- a/README_ZH_cn_.md +++ b/README_ZH_cn_.md @@ -10,10 +10,10 @@ Baseimage-docker是一个特殊的[Docker](http://www.docker.io)镜像,在Dock 可以把它作为自己的基础Docker镜像。 Baseimage-docker项目可以直接从Docker的[registry](https://index.docker.io/u/phusion/baseimage/)获取! - + ### 原生的Ubuntu基础镜像有什么问题呢? - + 原生Ubuntu不是为了在Docker内运行而设计的。它的初始化系统Upstart,假定运行的环境要么是真实的硬件,要么是虚拟的硬件,而不是在Docker容器内。但是在一个Docker的容器内,并不需要一个完整的系统,你需要的只是一个很小的系统。但是如果你不是非常熟悉Unix的系统模型,想要在Docker容器内裁减出最小的系统,会碰到很多难以正确解决的陌生的技术坑。这些坑会引起很多莫名其妙的问题。 Baseimage-docker让这一切完美。在"内容"部分描述了所有这些修改。 @@ -22,7 +22,7 @@ Baseimage-docker让这一切完美。在"内容"部分描述了所有这些修 ### 为什么使用baseimage-docker? 你自己可以从Dockerfile配置一个原生`ubuntu`镜像,为什么还要多此一举的使用baseimage-docker呢? - + * 配置一个Docker友好的基础系统并不是一个简单的任务。如前所述,过程中会碰到很多坑。当你搞定这些坑之后,只不过是又重新发明了一个baseimage-docker而已。使用baseimage-docker可以免去你这方面需要做的努力。 * 减少需要正确编写Dockerfile文件的时间。你不用再担心基础系统,可以专注于你自己的技术栈和你的项目。 * 减少需要运行`docker build`的时间,让你更快的迭代Dockerfile。 @@ -123,18 +123,18 @@ Baseimage-docker *鼓励* 通过runit来运行多进程. # 使用phusion/baseimage作为基础镜像,去构建你自己的镜像,需要下载一个明确的版本,千万不要使用`latest`. # 查看https://github.com/phusion/baseimage-docker/blob/master/Changelog.md,可用看到版本的列表. FROM phusion/baseimage: - + # 设置正确的环境变量. ENV HOME /root - + # 生成SSH keys,baseimage-docker不包含任何的key,所以需要你自己生成.你也可以注释掉这句命令,系统在启动过程中,会生成一个. RUN /etc/my_init.d/00_regen_ssh_host_keys.sh - + # 初始化baseimage-docker系统 CMD ["/sbin/my_init"] - + # 这里可以放置你自己需要构建的命令 - + # 当完成后,清除APT. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -152,7 +152,7 @@ Baseimage-docker *鼓励* 通过runit来运行多进程. #!/bin/sh # `/sbin/setuser memcache` 指定一个`memcache`用户来运行命令.如果你忽略了这部分,就会使用root用户执行. exec /sbin/setuser memcache /usr/bin/memcached >>/var/log/memcached.log 2>&1 - + ### 在Dockerfile中: RUN mkdir /etc/service/memcached COPY memcached.sh /etc/service/memcached/run @@ -188,7 +188,7 @@ baseimage-docker的初始化脚本 `/sbin/my_init`,在启动的时候进程运 * 在Unix系统中,环境变量都会被子进程给继承.这就意味着,子进程不可能修改环境变量或者修改其他进程的环境变量. * 由于上面提到的一点,这里没有一个可以为所有应用和服务集中定义环境的地方.Debian提供了一个`/etc/environment` 文件,解决一些问题. * 某些服务更改环境变量是为了给子进程使用.Nginx有这样的一个例子:它移除了所有的环境变量,除非你通过`env`进行了配置,明确了某些是保留的.如果你部署了任何应用在Nginx镜像(例如:使用[passenger-docker](https://github.com/phusion/passenger-docker)镜像或者使用Phusion Passenger作为你的镜像.),那么你通过Docker,你不会看到任何环境变量. - + `my_init`提供了一个办法来解决这些问题. @@ -338,7 +338,7 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, *** Shutting down runit daemon (PID 80)... *** Killing all processes... -你会发现默认的启动的流程太负责.或者你不希望执行启动文件.你可以自定义所有通过给`my_init`增加参数.调用`docker run YOUR_IMAGE /sbin/my_init --help`可以看到帮助信息. +你会发现默认的启动流程太复杂或者你不希望执行启动文件.你可以自定义所有通过给`my_init`增加参数.调用`docker run YOUR_IMAGE /sbin/my_init --help`可以看到帮助信息. 例如上面运行`ls`命令,同时要求不运行启动脚本,减少信息打印,运行runit所有命令. From 8b99273eb60a202e837f9a18236fe25aebc8f1d7 Mon Sep 17 00:00:00 2001 From: shooter Date: Fri, 31 Mar 2017 18:35:21 +0800 Subject: [PATCH 05/12] typo Make the sentence more smooth --- README_ZH_cn_.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/README_ZH_cn_.md b/README_ZH_cn_.md index 4aa0ea1..0bd7052 100644 --- a/README_ZH_cn_.md +++ b/README_ZH_cn_.md @@ -289,7 +289,7 @@ baseimage-docker的初始化脚本 `/sbin/my_init`,在启动的时候进程运 ### 禁用SSH -Baseimage-docker默认是支持SSH的,所以可以[使用SSH](#login_ssh)来[管理你的容器](#container_administration).万一你不想支持SSH,你可以只要禁用它: +Baseimage-docker默认是支持SSH的,所以可以[使用SSH](#login_ssh)来[管理你的容器](#container_administration).万一你不想支持SSH,你只要禁用它就可以: RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh @@ -338,7 +338,7 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, *** Shutting down runit daemon (PID 80)... *** Killing all processes... -你会发现默认的启动流程太复杂或者你不希望执行启动文件.你可以自定义所有通过给`my_init`增加参数.调用`docker run YOUR_IMAGE /sbin/my_init --help`可以看到帮助信息. +你会发现默认的启动流程太复杂或者你不希望执行启动文件, 你可以自定义这些参数传递给 `my_init`. 调用`docker run YOUR_IMAGE /sbin/my_init --help`可以看到帮助信息. 例如上面运行`ls`命令,同时要求不运行启动脚本,减少信息打印,运行runit所有命令. @@ -348,12 +348,12 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, ### 在一个已经运行的容器中,运行一条命令 -这里有两种办法去在一个已经运行的容器中运行命令. +这里有两种办法, 在一个已经运行的容器内执行命令. - * 通过`nseneter`工具.这个工具用于Linux内核调用在内嵌容器中运行命令.可以查看[通过`nsenter`,登录容器或者在容器内执行命令](#login_nsenter). - * 通过SSH.这种办法需要在容器中运行ssh服务,而且需要你创建自己的sshkey.可以查看[通过`ssh`,登录容器或者在容器内执行命令](#login_ssh). + * 通过`nseneter`工具. 这个工具用于Linux内核调用在内嵌容器中运行命令. 可以查看[通过`nsenter`,登录容器或者在容器内执行命令](#login_nsenter). + * 通过SSH.这种办法需要在容器中运行ssh服务,而且需要你创建自己的sshkey. 可以查看[通过`ssh`,登录容器或者在容器内执行命令](#login_ssh). -两种方法都是他们各自的优点和确定,你可以学习他们各自的章节来了他们. +两种方法都是他们各自的优点和确定, 你可以学习他们各自的章节来了解他们. ### 通过`nsenter`,登录容器或者在容器内执行命令 @@ -387,11 +387,11 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, docker ps -一旦拥有容器的id,找到运行容器的主要进程额`PID`. +一旦得到容器的id,找到运行容器的主要进程`PID`. docker inspect -f "{{ .State.Pid }}" -现在你有的容器的主进程的PID,就可以使用`nsenter`来登录容器,或者在容器里面执行命令: +现在你已得到容器的主进程PID, 就可以使用`nsenter`来登录容器, 或者在容器中执行命令: # 登录容器 nsenter --target
--mount --uts --ipc --net --pid bash -l @@ -401,8 +401,9 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, #### `docker-bash`工具 +目前(2017-03-31), 英文文档没有发现这个命令 -查找一个容器的主要进程的PID和输入这么长的nsenter命令很快会变得乏味无论.幸运的是,我们提供了一个`docker-bash` 工具,它可以自动完成只要的工具.这个工具是运行在*docker主机*上面,不是在docker容器中. +查找一个容器的主要进程的PID和输入这么长的nsenter命令很快会变得乏味无比.幸运的是,我们提供了一个`docker-bash` 工具,它可以自动完成只要的工具.这个工具是运行在*docker主机*上面,不是在docker容器中. 该工具还附带了一个预编译的二进制`nsenter`,这样你不需要自己安装`nsenter`了.`docker-bash`是很简单的使用的. @@ -435,7 +436,7 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, * 不需要docker主机提供root权限. * 运行你让用户登录到容器,而不需要登录到docker主机.然而,默认这是不启用的,因为baseimage-docker默认不是开放ssh服务的. * 缺点 - * 需要设置ssh key.然而,baseimage-docker会提供一中办法,会让key的生成会很容易.阅读更多信息. + * 需要设置ssh key.然而,baseimage-docker会提供一种方法,会让key的生成变得很容易.阅读更多信息. 第一件事情,就是你需要确定你在容器中已经安装设置了ssh key. 默认是不安装任何key的,所以任何人都无法登录.为了方便的原因,我们提供了一个[已经生成的key](https://github.com/phusion/baseimage-docker/blob/master/image/services/sshd/keys/insecure_key) [(PuTTY format)](https://github.com/phusion/baseimage-docker/blob/master/image/services/sshd/keys/insecure_key.ppk),为了让你使用方便.然后,请注意这个key仅仅是为方便.他没有任何安全性,因为它的key是在网络上提供的.**在生产环境,你必须使用你自己的key.** @@ -453,11 +454,13 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, docker ps -一旦你拥有容器的ID,就能找到容器使用的IP地址: +一旦你得到容器的ID,就能找到容器使用的IP地址: docker inspect -f "{{ .NetworkSettings.IPAddress }}" -现在你有得了IP地址,你就看通过SSH来登录容器,或者在容器中执行命令了: +译者注: 类似 `"{{ .NetworkSettings.IPAddress }}"` 是用到了 [Go的模板语法](https://gohugo.io/templates/go-templates/). + +现在你得到了IP地址, 你就可以通过SSH来登录容器,或者在容器中执行命令了: # 下载key curl -o insecure_key -fSL https://github.com/phusion/baseimage-docker/raw/master/image/services/sshd/keys/insecure_key @@ -501,7 +504,7 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, docker inspect -f "{{ .NetworkSettings.IPAddress }}" -现在你有得了IP地址,你就看通过SSH来登录容器,或者在容器中执行命令了: +现在你有得了IP地址,你就可以通过SSH来登录容器,或者在容器中执行命令了: # 登录容器 ssh -i /path-to/your_key root@ @@ -540,7 +543,7 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, git clone https://github.com/phusion/baseimage-docker.git cd baseimage-docker -创建一个包含docker在的虚拟机.你可以使用我们提供的Vagrantfile. +创建一个包含docker在内的虚拟机.你可以使用我们提供的Vagrantfile. vagrant up vagrant ssh @@ -550,7 +553,7 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, make build -如果你想把创建的镜像名字,叫其他名字,通过`NAME`变量可以设置: +如果你想修改镜像的名字,通过`NAME`变量可以设置: make build NAME=joe/baseimage From 079464dc4359a3ee642d7fbc33da9fb670cb193a Mon Sep 17 00:00:00 2001 From: shooter Date: Fri, 31 Mar 2017 21:24:15 +0800 Subject: [PATCH 06/12] typo --- README_ZH_cn_.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_ZH_cn_.md b/README_ZH_cn_.md index 0bd7052..8f7555f 100644 --- a/README_ZH_cn_.md +++ b/README_ZH_cn_.md @@ -387,7 +387,7 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, docker ps -一旦得到容器的id,找到运行容器的主要进程`PID`. +一旦得到容器的id, 找到运行容器的主进程`PID`. docker inspect -f "{{ .State.Pid }}" @@ -553,7 +553,7 @@ Baseimage-docker提供了一个灵活的方式运行只要一闪而过的命令, make build -如果你想修改镜像的名字,通过`NAME`变量可以设置: +如果你想修改镜像的名称, 通过`NAME`变量可以设置: make build NAME=joe/baseimage From a5469e5572f2fc494004d7ab1e39ae4260743301 Mon Sep 17 00:00:00 2001 From: James Ravn Date: Fri, 7 Apr 2017 11:36:31 +0100 Subject: [PATCH 07/12] Cast KILL*TIMEOUTS to int As int is required by signal.alarm. --- image/bin/my_init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/image/bin/my_init b/image/bin/my_init index 354b362..8fabe6b 100755 --- a/image/bin/my_init +++ b/image/bin/my_init @@ -1,8 +1,8 @@ #!/usr/bin/python3 -u import os, os.path, sys, stat, signal, errno, argparse, time, json, re -KILL_PROCESS_TIMEOUT = os.environ.get('KILL_PROCESS_TIMEOUT', 5) -KILL_ALL_PROCESSES_TIMEOUT = os.environ.get('KILL_ALL_PROCESSES_TIMEOUT', 5) +KILL_PROCESS_TIMEOUT = int(os.environ.get('KILL_PROCESS_TIMEOUT', 5)) +KILL_ALL_PROCESSES_TIMEOUT = int(os.environ.get('KILL_ALL_PROCESSES_TIMEOUT', 5)) LOG_LEVEL_ERROR = 1 LOG_LEVEL_WARN = 1 From f706ea8d920a4ec1f66563d5f12dba979593f946 Mon Sep 17 00:00:00 2001 From: James Ravn Date: Fri, 7 Apr 2017 11:44:20 +0100 Subject: [PATCH 08/12] Add shutdown details to README --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 7aa1cb4..b8b4be2 100644 --- a/README.md +++ b/README.md @@ -201,6 +201,22 @@ In `Dockerfile`: RUN chmod +x /etc/my_init.d/logtime.sh + +#### Shutting down your process + +`/sbin/my_init` handles termination of children processes at shutdown. When it receives a SIGTERM +it will pass the signal onto the child process for correct shutdown. If your process is started with +a shell script, make sure you `exec` the actual process, otherwise the shell will receive the signal +and not your process. + +`/sbin/my_init` will terminate processes after a 5 second timeout. This can be adjusted by setting +environment variables: + + # Give children processes 5 minutes to timeout + ENV KILL_PROCESS_TIMEOUT=300 + # Give all other processes (such as those which have been forked) 5 minutes to timeout + ENV KILL_ALL_PROCESSES_TIMEOUT=300 + ### Environment variables If you use `/sbin/my_init` as the main container command, then any environment variables set with `docker run --env` or with the `ENV` command in the Dockerfile, will be picked up by `my_init`. These variables will also be passed to all child processes, including `/etc/my_init.d` startup scripts, Runit and Runit-managed services. There are however a few caveats you should be aware of: From 93477b34cce62104c8e8d8f0ff6d1383b40c9c09 Mon Sep 17 00:00:00 2001 From: James Ravn Date: Fri, 7 Apr 2017 11:45:55 +0100 Subject: [PATCH 09/12] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b8b4be2..200b715 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ In `Dockerfile`: #### Shutting down your process `/sbin/my_init` handles termination of children processes at shutdown. When it receives a SIGTERM -it will pass the signal onto the child process for correct shutdown. If your process is started with +it will pass the signal onto the child processes for correct shutdown. If your process is started with a shell script, make sure you `exec` the actual process, otherwise the shell will receive the signal and not your process. @@ -214,8 +214,8 @@ environment variables: # Give children processes 5 minutes to timeout ENV KILL_PROCESS_TIMEOUT=300 - # Give all other processes (such as those which have been forked) 5 minutes to timeout - ENV KILL_ALL_PROCESSES_TIMEOUT=300 + # Give all other processes (such as those which have been forked) 5 minutes to timeout + ENV KILL_ALL_PROCESSES_TIMEOUT=300 ### Environment variables From a7b8b36359a29fae65af9adec2230b5726939fa9 Mon Sep 17 00:00:00 2001 From: Travis Rowland Date: Sat, 8 Apr 2017 00:18:10 -0700 Subject: [PATCH 10/12] Update Changelog.md Removing CHANGELOG.md --- Changelog.md | 150 +-------------------------------------------------- 1 file changed, 1 insertion(+), 149 deletions(-) diff --git a/Changelog.md b/Changelog.md index 622ef11..5f2c831 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,149 +1 @@ -## 0.9.19 (release date: 2016-07-08) - - * Upgraded to Ubuntu 16.04. Thanks to Pierre Jacomet for submitting this patch. - * During shutdown, repeatedly tell Runit to shutdown services in order to workaround a potential race condition in Runit itself. Closes GH-315. Thanks to Chris Kite for submitting this patch. - * Fixed a problem in PAM which may cause chpasswd and related tools to fail. This is caused by Docker bug 6345 which is already closed, but for some reason the problem still persists. Closes GH-181. Thanks to Michael Zedeler for submitting the patch. - * Fixed the syslog-ng logrotate script to correctly restart the syslog-to-Docker-logs forwarder. Closes GH-292. Thanks to Ernestas Lukoševičius for submitting the patch. - - -## 0.9.18 (release date: 2015-12-08) - - * The latest OpenSSL updates have been pulled in. This fixes [CVE-2015-3193](https://www.openssl.org/news/secadv/20151203.txt) and a few others. Upgrading is strongly recommended. - * Fixes disabling all services. Thanks to Enderson Maia. - - -## 0.9.17 (release date: 2015-07-15) - - * The latest OpenSSL updates have been pulled in. This fixes [CVE-2015-1793](http://openssl.org/news/secadv_20150709.txt). Upgrading is strongly recommended. - * Removed nano and replaced vim with vim-tiny. This reduces Baseimage-docker's virtual size by 42 MB. - * Fixed an issue in `my_init` which could cause it to hang during shutdown. Thanks to Joe "SAPikachu" Hu for contributing the fix. Closes GH-151. - * When `my_init` generates `/etc/container_environment.sh`, it now ensures that environment variable names do not include any characters unsupported by Bash. Unsupported characters are now replaced with underscores. This fixes compatibility issues with Docker Compose. Closes GH-230. - * `my_init` no longer reads from and writes to `/etc/container_environment` if that directory does not exist. Previously it would abort with an error. This change makes it easier to reuse `my_init` in other (non-Baseimage-docker-based) projects without having to modify it. - * Baseimage-docker no longer sets the HOME environment variable by default. We used to set HOME by default to work around [Docker issue 2968](https://github.com/docker/docker/issues/2968) where HOME defaults to /, but this issue is now fixed. Furthermore, the fact that we set HOME interfered with the USER stanza: USER would no longer set HOME. So we got rid of our HOME variable. Closes GH-231. - * Some unnecessary Ubuntu cron jobs have been removed. Closes GH-205. - * Syslog-ng no longer forwards messages to /dev/tty10. Closes GH-222. - * It is now possible to build your own Baseimage-docker variant that has cron, syslog or sshd disabled. Thanks to Enderson Tadeu S. Maia. Closes GH-182. - -## 0.9.16 (release date: 2015-01-20) - - * `docker exec` is now the default and recommended mechanism for running commands in the container. SSH is now disabled by default, but is still supported for those cases where "docker exec" is not appropriate. Closes GH-168. - * All syslog output is now forwarded to `docker logs`. Closes GH-123. - * The workaround for Docker bug 2267 (the inability to modify /etc/hosts) has been removed, because it has been fixed upstream. Closes GH-155. - * Logrotate now reloads syslog-ng properly. Closes GH-167. - * Fixed some locale issues. Closes GH-178. Thanks to David J. M. Karlsen. - * Fixed problems with cron. Closes GH-115. - * Contribution by Bryan Bishop. - -## 0.9.15 (release date: 2014-10-03) - - * Fixed the setuid bit on /usr/bin/sudo. This problem was caused by Docker bug #6828. - -## 0.9.14 (release date: 2014-10-01) - - * Installed all the latest Ubuntu security updates. This patches Shellshock, among other things. - * Some documentation updates by andreamtp. - -## 0.9.13 (release date: 2014-08-22) - - * Fixed `my_init` not properly exiting with a non-zero exit status when Ctrl-C is pressed. - * The GID of the `docker_env` group has been changed from 1000 to 8377, in order to avoid GID conflicts with any groups that you might want to introduce inside the container. - * The syslog-ng socket is now deleted before starting the syslog-ng daemon, to avoid the daemon from failing to start due to garbage on the filesystem. Thanks to Kingdon Barrett. Closes GH-129. - * Typo fixes by Arkadi Shishlov. - -## 0.9.12 (release date: 2014-07-24) - - * We now officially support `nsenter` as an alternative way to login to the container. With official support, we mean that we've provided extensive documentation on how to use `nsenter`, as well as related convenience tools. However, because `nsenter` has various issues, and for backward compatibility reasons, we still support SSH. Please refer to the README for details about `nsenter`, and what the pros and cons are compared to SSH. - * The `docker-bash` tool has been modified to use `nsenter` instead of SSH. - * What was previously the `docker-bash` tool, has now been renamed to `docker-ssh`. It now also works on a regular sh shell too, instead of bash specifically. - * Added a workaround for Docker's inability to modify /etc/hosts in the container ([Docker bug 2267](https://github.com/dotcloud/docker/issues/2267)). Please refer to the README for details. - * Fixed an issue with SSH X11 forwarding. Thanks to Anatoly Bubenkov. Closes GH-105. - * The init system now prints its own log messages to stderr. Thanks to mephi42. Closes GH-106. - -## 0.9.11 (release date: 2014-06-24) - - * Introduced the `docker-bash` tool. This is a shortcut tool for logging into a container using SSH. Usage: `docker-bash `. See the README for details. - * Fixed various process waiting issues in `my_init`. Closes GH-27, GH-82 and GH-83. Thanks to André Luiz dos Santos and Paul Annesley. - * The `ca-certificates` package is now installed by default. This is because we include `apt-transport-https`, but Ubuntu 14.04 no longer installs `ca-certificates` by default anymore. Closes GH-73. - * Output print by Runit services are now redirected to the Docker logs instead of to proctitle. Thanks to Paul Annesley. - * Container environment variables are now made available to SSH root shells. If you login with SSH through a non-root account, then container environment variables are only made available if that user is a member of the `docker_env` group. Thanks to Bernard Potocki. - * `add-apt-repository` is now installed by default. Closes GH-74. - * Various minor fixes and contributions thanks to yebyen, John Eckhart, Christoffer Sawicki and Brant Fitzsimmons. - -## 0.9.10 (release date: 2014-05-12) - - * Upgraded to Ubuntu 14.04 (Trusty). We will no longer release images based on 12.04. - Thanks to contributions by mpeterson, Paul Jimenez, Santiago M. Mola and Kingdon Barrett. - * Fixed a problem with my_init not correctly passing child processes' exit status. Fixes GH-45. - * When reading environment variables from /etc/container_environment, the trailing newline (if any) is ignored. This makes commands like this work, without unintentially adding a newline to the environment variable value: - - echo my_value > /etc/container_environment/FOO - - If you intended on adding a newline to the value, ensure you have *two* trailing newlines: - - echo -e "my_value\n" > /etc/container_environment/FOO - * It was not possible to use `docker run -e` to override environment variables defined in /etc/container_environment. This has been fixed (GH-52). Thanks to Stuart Campbell for reporting this bug. - -## 0.9.9 (release date: 2014-03-25) - - * Fixed a problem with rssh. (Slawomir Chodnicki) - * The `INITRD` environment variable is now set in the container by default. This prevents updates to the `initramfs` from running grub or lilo. - * The `ischroot` tool in Ubuntu has been modified to always return true. This prevents updates to the `initscripts` package from breaking /dev/shm. - * Various minor bug fixes, improvements and typo corrections. (Felix Hummel, Laurent Sarrazin, Dung Quang, Amir Gur) - -## 0.9.8 (release date: 2014-02-26) - - * Fixed a regression in `my_init` which causes it to delete environment variables passed from Docker. - * Fixed `my_init` not properly forcing Runit to shut down if Runit appears to refuse to respond to SIGTERM. - -## 0.9.7 (release date: 2014-02-25) - - * Improved and fixed bugs in `my_init` (Thomas LÉVEIL): - * It is now possible to enable the insecure key by passing `--enable-insecure-key` to `my_init`. This allows users to easily enable the insecure key for convenience reasons, without having the insecure key enabled permanently in the image. - * `my_init` now exports environment variables to the directory `/etc/container_environment` and to the files `/etc/container_environment.sh`, `/etc/container_environment.json`. This allows all applications to query what the original environment variables were. It is also possible to change the environment variables in `my_init` by modifying `/etc/container_environment`. More information can be found in the README, section "Environment variables". - * Fixed a bug that causes it not to print messages to stdout when there is no pseudo terminal. This is because Python buffers stdout by default. - * Fixed an incorrectly printed message. - * The insecure key is now also available in PuTTY format. (Thomas LÉVEIL) - * Fixed `enable_insecure_key` removing already installed SSH keys. (Thomas LÉVEIL) - * The baseimage-docker image no longer EXPOSEs any ports by default. The EXPOSE entries were originally there to enable some default guest-to-host port forwarding entries, but in recent Docker versions they changed the meaning of EXPOSE, and now EXPOSE is used for linking containers. As such, we no longer have a reason to EXPOSE any ports by default. Fixes GH-15. - * Fixed syslog-ng not being able to start because of a missing afsql module. Fixes the issue described in [pull request 7](https://github.com/phusion/baseimage-docker/pull/7). - * Removed some default Ubuntu cron jobs which are not useful in Docker containers. - * Added the logrotate service. Fixes GH-22. - * Fixed some warnings in `/etc/my_init.d/00_regen_ssh_host_keys.sh`. - * Fixed some typos in the documentation. (Dr Nic Williams, Tomer Cohen) - -## 0.9.6 (release date: 2014-02-17) - - * Fixed a bug in `my_init`: child processes that have been adopted during execution of init scripts are now properly reaped. - * Much improved `my_init`: - * It is now possible to run and watch a custom command, possibly in addition to running runit. See "Running a one-shot command in the container" in the README. - * It is now possible to skip running startup files such as /etc/rc.local. - * Shutdown is now much faster. It previously took a few seconds, but it is now almost instantaneous. - * It ensures that all processes in the container are properly shut down with SIGTERM, even those that are not direct child processes of `my_init`. - * `setuser` now also sets auxilliary groups, as well as more environment variables such as `USER` and `UID`. - -## 0.9.5 (release date: 2014-02-06) - - * Environment variables are now no longer reset by runit. This is achieved by running `runsvdir` directly instead of through Debian's `runsvdir-start`. - * The insecure SSH key is now disabled by default. You have to explicitly opt-in to use it. - -## 0.9.4 (release date: 2014-02-03) - - * Fixed syslog-ng startup problem. - -## 0.9.3 (release date: 2014-01-31) - - * It looks like Docker changed their Ubuntu 12.04 base image, thereby breaking our Dockerfile. This has been fixed. - * The init system (`/sbin/my_init`) now supports running scripts during startup. You can put startup scripts `/etc/my_init.d`. `/etc/rc.local` is also run during startup. - * To improve security, the base image no longer contains pregenerated SSH host keys. Instead, users of the base image are encouraged to regenerate one in their Dockerfile. If the user does not do that, then random SSH host keys are generated during container boot. - -## 0.9.2 (release date: 2013-12-11) - - * Fixed SFTP support. Thanks Joris van de Donk! - -## 0.9.1 (release date: 2013-11-12) - - * Improved init process script (`/sbin/my_init`): it now handles shutdown correctly. Previously, `docker stop` would not have any effect on `my_init`, causing the whole container to be killed with SIGKILL. The new init process script gracefully shuts down all runit services, then exits. - -## 0.9.0 (release date: 2013-11-12) - - * Initial release +For the Changelog, please see [Releases](https://github.com/phusion/baseimage-docker/releases) on GitHub From ac382d47b8139570b23906b6c4810c8bb55feb54 Mon Sep 17 00:00:00 2001 From: Anshul Sharma Date: Tue, 11 Apr 2017 08:07:32 +0530 Subject: [PATCH 11/12] down wait for 7 secs this will fix it. --- image/bin/my_init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image/bin/my_init b/image/bin/my_init index 8fabe6b..1d6fa0c 100755 --- a/image/bin/my_init +++ b/image/bin/my_init @@ -247,7 +247,7 @@ def wait_for_runit_or_interrupt(pid): def shutdown_runit_services(quiet = False): if not quiet: debug("Begin shutting down runit services...") - os.system("/usr/bin/sv down /etc/service/*") + os.system("/usr/bin/sv -w %d down /etc/service/*", KILL_PROCESS_TIMEOUT) def wait_for_runit_services(): debug("Waiting for runit services to exit...") From 10d2364014672a56ff9b5451d9081604f8810c69 Mon Sep 17 00:00:00 2001 From: Travis Rowland Date: Tue, 11 Apr 2017 01:08:24 -0700 Subject: [PATCH 12/12] Update Makefile Incrementing version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9ddfe1a..536a4a3 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME = phusion/baseimage -VERSION = 0.9.20 +VERSION = 0.9.21 .PHONY: all build test tag_latest release ssh