From 0ab7b6952a092eec2690967b2ab36e0e604150a4 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 7 Mar 2014 15:38:10 -0800 Subject: [PATCH 1/3] Bump to version 0.9.0 Docker-DCO-1.1-Signed-off-by: Michael Crosby (github: crosbymichael) --- CHANGELOG.md | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ VERSION | 2 +- 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6a93dc97d..40ba3d32ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,83 @@ # Changelog +## 0.9.0 (2014-03-10) + +#### Builder +- Avoid extra mount/unmount during build. This fixes mount/unmount related errors during build. +- Add error to docker build --rm. This adds missing error handling. +- Forbid chained onbuild, `onbuild from` and `onbuild maintainer` triggers. +- Make `--rm` the default for `docker build`. + +#### Documentation +- Download the docker client binary for Mac over https. +- Update the titles of the install instructions & descriptions. +* Add instructions for upgrading boot2docker. +* Add port forwarding example in OS X install docs. +- Attempt to disentangle repository and registry. +- Update docs to explain more about `docker ps`. +- Update sshd example to use a Dockerfile. +- Rework some examples, including the Python examples. +- Update docs to include instructions for a container's lifecycle. +- Update docs documentation to discuss the docs branch. +- Don't skip cert check for an example & use HTTPS. +- Bring back the memory and swap accounting section which was lost when the kernel page was removed. +- Explain DNS warnings and how to fix them on systems running and using a local nameserver. + +#### Contrib +- Add Tanglu support for mkimage-debootstrap. +- Add SteamOS support for mkimage-debootstrap. + +#### Hack +- Get package coverage when running integration tests. +- Remove the Vagrantfile. This is being replaced with boot2docker. +- Fix tests on systems where aufs isn't available. +- Update packaging instructions and remove the dependency on lxc. + +#### Remote API +* Move code specific to the API to the api package. +- Fix header content type for the API. Makes all endpoints use proper content type. +- Fix registry auth & remove ping calls from CmdPush and CmdPull. +- Add newlines to the JSON stream functions. + +#### Runtime +* Do not ping the registry from the CLI. All requests to registres flow through the daemon. +- Check for nil information return in the lxc driver. This fixes panics with older lxc versions. +- Devicemapper: cleanups and fix for unmount. Fixes two problems which were causing unmount to fail intermittently. +- Devicemapper: remove directory when removing device. Directories don't get left behind when removing the device. +* Devicemapper: enable skip_block_zeroing. Improves performance by not zeroing blocks. +- Devicemapper: fix shutdown warnings. Fixes shutdown warnings concerning pool device removal. +- Ensure docker cp stream is closed properly. Fixes problems with files not being copied by `docker cp`. +- Stop making `tcp://` default to `127.0.0.1:4243` and remove the default port for tcp. +- Fix `--run` in `docker commit`. This makes `docker commit --run` work again. +- Fix custom bridge related options. This makes custom bridges work again. ++ Mount-bind the PTY as container console. This allows tmux/screen to run. ++ Add the pure Go libcontainer library to make it possible to run containers using only features of the Linux kernel. ++ Add native exec driver which uses libcontainer and make it the default exec driver. +- Add support for handling extended attributes in archives. +* Set the container MTU to be the same as the host MTU. ++ Add simple sha256 checksums for layers to speed up `docker push`. +* Improve kernel version parsing. +* Allow flag grouping (`docker run -it`). +- Remove chroot exec driver. +- Fix divide by zero to fix panic. +- Rewrite `docker rmi`. +- Fix docker info with lxc 1.0.0. +- Fix fedora tty with apparmor. +* Don't always append env vars, replace defaults with vars from config. +* Fix a goroutine leak. +* Switch to Go 1.2.1. +- Fix unique constraint error checks. +* Handle symlinks for Docker's data directory and for TMPDIR. +- Add deprecation warnings for flags (-flag is deprecated in favor of --flag) +- Add apparmor profile for the native execution driver. +* Move system specific code from archive to pkg/system. +- Fix duplicate signal for `docker run -i -t` (issue #3336). +- Return correct process pid for lxc. +- Add a -G option to specify the group which unix sockets belong to. ++ Add `-f` flag to `docker rm` to force removal of running containers. ++ Kill ghost containers and restart all ghost containers when the docker daemon restarts. ++ Add `DOCKER_RAMDISK` environment variable to make Docker work when the root is on a ramdisk. + ## 0.8.1 (2014-02-18) #### Builder diff --git a/VERSION b/VERSION index d182dc9160..ac39a106c4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.1-dev +0.9.0 From 2b3fdf2344fee3affc44c93a034ce894af4d6193 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Sun, 9 Mar 2014 23:16:42 -0600 Subject: [PATCH 2/3] Fix a few packaging bugs, including and especially a temporary patch to our upstart script to mount cgroups properly Docker-DCO-1.1-Signed-off-by: Andrew Page (github: tianon) Docker-DCO-1.1-Signed-off-by: Tianon Gravi (github: crosbymichael) --- .../init/{sysvinit => sysvinit-debian}/docker | 42 ++++-- contrib/init/sysvinit-debian/docker.default | 13 ++ contrib/init/upstart/docker.conf | 13 +- hack/make/ubuntu | 131 +++++++++--------- 4 files changed, 123 insertions(+), 76 deletions(-) rename contrib/init/{sysvinit => sysvinit-debian}/docker (61%) create mode 100644 contrib/init/sysvinit-debian/docker.default diff --git a/contrib/init/sysvinit/docker b/contrib/init/sysvinit-debian/docker similarity index 61% rename from contrib/init/sysvinit/docker rename to contrib/init/sysvinit-debian/docker index 2d79c4d4c0..510683a459 100755 --- a/contrib/init/sysvinit/docker +++ b/contrib/init/sysvinit-debian/docker @@ -14,13 +14,15 @@ # VMs, bare metal, OpenStack clusters, public clouds and more. ### END INIT INFO +export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin + BASE=$(basename $0) +# modify these in /etc/default/$BASE (/etc/default/docker) DOCKER=/usr/bin/$BASE DOCKER_PIDFILE=/var/run/$BASE.pid DOCKER_OPTS= - -PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin +DOCKER_DESC="Docker" # Get lsb functions . /lib/lsb/init-functions @@ -30,8 +32,8 @@ if [ -f /etc/default/$BASE ]; then fi # see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it) -if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then - log_failure_msg "Docker is managed via upstart, try using service $BASE $1" +if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; then + log_failure_msg "$DOCKER_DESC is managed via upstart, try using service $BASE $1" exit 1 fi @@ -43,7 +45,7 @@ fi fail_unless_root() { if [ "$(id -u)" != '0' ]; then - log_failure_msg "Docker must be run as root" + log_failure_msg "$DOCKER_DESC must be run as root" exit 1 fi } @@ -51,21 +53,37 @@ fail_unless_root() { case "$1" in start) fail_unless_root - log_begin_msg "Starting Docker: $BASE" - mount | grep cgroup >/dev/null || mount -t cgroup none /sys/fs/cgroup 2>/dev/null + + if ! grep -q cgroup /proc/mounts; then + # rough approximation of cgroupfs-mount + mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup + for sys in $(cut -d' ' -f1 /proc/cgroups); do + mkdir -p /sys/fs/cgroup/$sys + if ! mount -n -t cgroup -o $sys cgroup /sys/fs/cgroup/$sys 2>/dev/null; then + rmdir /sys/fs/cgroup/$sys 2>/dev/null || true + fi + done + fi + + touch /var/log/docker.log + chgrp docker /var/log/docker.log + + log_begin_msg "Starting $DOCKER_DESC: $BASE" start-stop-daemon --start --background \ + --no-close \ --exec "$DOCKER" \ --pidfile "$DOCKER_PIDFILE" \ - -- -d -p "$DOCKER_PIDFILE" \ - $DOCKER_OPTS + -- \ + -d -p "$DOCKER_PIDFILE" \ + $DOCKER_OPTS \ + > /var/log/docker.log 2>&1 log_end_msg $? ;; stop) fail_unless_root - log_begin_msg "Stopping Docker: $BASE" - start-stop-daemon --stop \ - --pidfile "$DOCKER_PIDFILE" + log_begin_msg "Stopping $DOCKER_DESC: $BASE" + start-stop-daemon --stop --pidfile "$DOCKER_PIDFILE" log_end_msg $? ;; diff --git a/contrib/init/sysvinit-debian/docker.default b/contrib/init/sysvinit-debian/docker.default new file mode 100644 index 0000000000..d5110b5e2f --- /dev/null +++ b/contrib/init/sysvinit-debian/docker.default @@ -0,0 +1,13 @@ +# Docker Upstart and SysVinit configuration file + +# Customize location of Docker binary (especially for development testing). +#DOCKER="/usr/local/bin/docker" + +# Use DOCKER_OPTS to modify the daemon startup options. +#DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4" + +# If you need Docker to use an HTTP proxy, it can also be specified here. +#export http_proxy="http://127.0.0.1:3128/" + +# This is also a handy place to tweak where Docker's temporary files go. +#export TMPDIR="/mnt/bigdrive/docker-tmp" diff --git a/contrib/init/upstart/docker.conf b/contrib/init/upstart/docker.conf index ee8a447c27..e2cc4536e1 100644 --- a/contrib/init/upstart/docker.conf +++ b/contrib/init/upstart/docker.conf @@ -1,15 +1,26 @@ description "Docker daemon" -start on filesystem and started lxc-net +start on filesystem stop on runlevel [!2345] respawn script + # modify these in /etc/default/$UPSTART_JOB (/etc/default/docker) DOCKER=/usr/bin/$UPSTART_JOB DOCKER_OPTS= if [ -f /etc/default/$UPSTART_JOB ]; then . /etc/default/$UPSTART_JOB fi + if ! grep -q cgroup /proc/mounts; then + # rough approximation of cgroupfs-mount + mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup + for sys in $(cut -d' ' -f1 /proc/cgroups); do + mkdir -p /sys/fs/cgroup/$sys + if ! mount -n -t cgroup -o $sys cgroup /sys/fs/cgroup/$sys 2>/dev/null; then + rmdir /sys/fs/cgroup/$sys 2>/dev/null || true + fi + done + fi "$DOCKER" -d $DOCKER_OPTS end script diff --git a/hack/make/ubuntu b/hack/make/ubuntu index 602d4ac1ad..ebc12f27ec 100644 --- a/hack/make/ubuntu +++ b/hack/make/ubuntu @@ -29,42 +29,36 @@ bundle_ubuntu() { cp contrib/udev/80-docker.rules $DIR/etc/udev/rules.d/ # Include our init scripts - mkdir -p $DIR/etc - cp -R contrib/init/upstart $DIR/etc/init - cp -R contrib/init/sysvinit $DIR/etc/init.d - mkdir -p $DIR/lib/systemd - cp -R contrib/init/systemd $DIR/lib/systemd/system - + mkdir -p $DIR/etc/init + cp contrib/init/upstart/docker.conf $DIR/etc/init/ + mkdir -p $DIR/etc/init.d + cp contrib/init/sysvinit-debian/docker $DIR/etc/init.d/ mkdir -p $DIR/etc/default - cat > $DIR/etc/default/docker <<'EOF' -# Docker Upstart and SysVinit configuration file - -# Customize location of Docker binary (especially for development testing). -#DOCKER="/usr/local/bin/docker" - -# Use DOCKER_OPTS to modify the daemon startup options. -#DOCKER_OPTS="-dns 8.8.8.8" - -# If you need Docker to use an HTTP proxy, it can also be specified here. -#export http_proxy=http://127.0.0.1:3128/ -EOF + cp contrib/init/sysvinit-debian/docker.default $DIR/etc/default/docker + mkdir -p $DIR/lib/systemd/system + cp contrib/init/systemd/docker.service $DIR/lib/systemd/system/ # Copy the binary # This will fail if the binary bundle hasn't been built mkdir -p $DIR/usr/bin - # Copy the binary - # This will fail if the binary bundle hasn't been built cp $DEST/../binary/docker-$VERSION $DIR/usr/bin/docker # Generate postinst/prerm/postrm scripts - cat > /tmp/postinst <<'EOF' + cat > $DEST/postinst <<'EOF' #!/bin/sh set -e set -u -getent group docker > /dev/null || groupadd --system docker || true +if [ "$1" = 'configure' ] && [ -z "$2" ]; then + if ! getent group docker > /dev/null; then + groupadd --system docker + fi +fi -update-rc.d docker defaults > /dev/null || true +if ! { [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; }; then + # we only need to do this if upstart isn't in charge + update-rc.d docker defaults > /dev/null || true +fi if [ -n "$2" ]; then _dh_action=restart else @@ -74,7 +68,7 @@ service docker $_dh_action 2>/dev/null || true #DEBHELPER# EOF - cat > /tmp/prerm <<'EOF' + cat > $DEST/prerm <<'EOF' #!/bin/sh set -e set -u @@ -83,7 +77,7 @@ service docker stop 2>/dev/null || true #DEBHELPER# EOF - cat > /tmp/postrm <<'EOF' + cat > $DEST/postrm <<'EOF' #!/bin/sh set -e set -u @@ -101,50 +95,61 @@ fi #DEBHELPER# EOF # TODO swaths of these were borrowed from debhelper's auto-inserted stuff, because we're still using fpm - we need to use debhelper instead, and somehow reconcile Ubuntu that way - chmod +x /tmp/postinst /tmp/prerm + chmod +x $DEST/postinst $DEST/prerm $DEST/postrm ( + # switch directories so we create *.deb in the right folder cd $DEST + + # create lxc-docker-VERSION package fpm -s dir -C $DIR \ - --name lxc-docker-$VERSION --version $PKGVERSION \ - --after-install /tmp/postinst \ - --before-remove /tmp/prerm \ - --after-remove /tmp/postrm \ - --architecture "$PACKAGE_ARCHITECTURE" \ - --prefix / \ - --depends iptables \ - --deb-recommends aufs-tools \ - --deb-recommends ca-certificates \ - --deb-recommends git \ - --deb-recommends xz-utils \ - --description "$PACKAGE_DESCRIPTION" \ - --maintainer "$PACKAGE_MAINTAINER" \ - --conflicts docker \ - --conflicts docker.io \ - --conflicts lxc-docker-virtual-package \ - --provides lxc-docker \ - --provides lxc-docker-virtual-package \ - --replaces lxc-docker \ - --replaces lxc-docker-virtual-package \ - --url "$PACKAGE_URL" \ - --license "$PACKAGE_LICENSE" \ - --config-files /etc/udev/rules.d/80-docker.rules \ - --config-files /etc/init/docker.conf \ - --config-files /etc/init.d/docker \ - --config-files /etc/default/docker \ - --deb-compression gz \ - -t deb . + --name lxc-docker-$VERSION --version $PKGVERSION \ + --after-install $DEST/postinst \ + --before-remove $DEST/prerm \ + --after-remove $DEST/postrm \ + --architecture "$PACKAGE_ARCHITECTURE" \ + --prefix / \ + --depends iptables \ + --deb-recommends aufs-tools \ + --deb-recommends ca-certificates \ + --deb-recommends git \ + --deb-recommends xz-utils \ + --deb-suggests cgroup-lite \ + --description "$PACKAGE_DESCRIPTION" \ + --maintainer "$PACKAGE_MAINTAINER" \ + --conflicts docker \ + --conflicts docker.io \ + --conflicts lxc-docker-virtual-package \ + --provides lxc-docker \ + --provides lxc-docker-virtual-package \ + --replaces lxc-docker \ + --replaces lxc-docker-virtual-package \ + --url "$PACKAGE_URL" \ + --license "$PACKAGE_LICENSE" \ + --config-files /etc/udev/rules.d/80-docker.rules \ + --config-files /etc/init/docker.conf \ + --config-files /etc/init.d/docker \ + --config-files /etc/default/docker \ + --deb-compression gz \ + -t deb . + # TODO replace "Suggests: cgroup-lite" with "Recommends: cgroupfs-mount | cgroup-lite" once cgroupfs-mount is available + + # create empty lxc-docker wrapper package fpm -s empty \ - --name lxc-docker --version $PKGVERSION \ - --architecture "$PACKAGE_ARCHITECTURE" \ - --depends lxc-docker-$VERSION \ - --description "$PACKAGE_DESCRIPTION" \ - --maintainer "$PACKAGE_MAINTAINER" \ - --url "$PACKAGE_URL" \ - --license "$PACKAGE_LICENSE" \ - --deb-compression gz \ - -t deb + --name lxc-docker --version $PKGVERSION \ + --architecture "$PACKAGE_ARCHITECTURE" \ + --depends lxc-docker-$VERSION \ + --description "$PACKAGE_DESCRIPTION" \ + --maintainer "$PACKAGE_MAINTAINER" \ + --url "$PACKAGE_URL" \ + --license "$PACKAGE_LICENSE" \ + --deb-compression gz \ + -t deb ) + + # clean up after ourselves so we have a clean output directory + rm $DEST/postinst $DEST/prerm $DEST/postrm + rm -r $DIR } bundle_ubuntu From d7646f934a268bf071a16439880ba2bba608426e Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 10 Mar 2014 14:08:26 -0700 Subject: [PATCH 3/3] Change version to v0.9.0 Docker-DCO-1.1-Signed-off-by: Michael Crosby (github: crosbymichael) --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ac39a106c4..c70836ca5c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.0 +0.9.0-dev