From 5e2f0639c64dc8a7ee5da81e0801bc4a17787407 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Tue, 19 Feb 2013 13:03:58 -0800 Subject: [PATCH 1/9] dockerd: create /var/lib/docker if it doesn't exist --- docker.go | 2 +- image/image.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker.go b/docker.go index 2b334976d7..abe2d3777d 100644 --- a/docker.go +++ b/docker.go @@ -107,7 +107,7 @@ func NewFromDirectory(root string) (*Docker, error) { containers: list.New(), } - if err := os.Mkdir(docker.repository, 0700); err != nil && !os.IsExist(err) { + if err := os.MkdirAll(docker.repository, 0700); err != nil && !os.IsExist(err) { return nil, err } diff --git a/image/image.go b/image/image.go index 7f635d1338..82c88b2a05 100644 --- a/image/image.go +++ b/image/image.go @@ -27,6 +27,9 @@ func New(root string) (*Store, error) { if err != nil { return nil, err } + if err := os.MkdirAll(abspath, 0700); err != nil && !os.IsExist(err) { + return nil, err + } layers, err := NewLayerStore(path.Join(root, "layers")) if err != nil { return nil, err From dd9bb4e0d388788781af0c36dfca0d3792f07d6c Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Tue, 19 Feb 2013 13:04:19 -0800 Subject: [PATCH 2/9] dockerd: removed debug messages --- server/server.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/server/server.go b/server/server.go index 1cf01eb688..cfee4fbcac 100644 --- a/server/server.go +++ b/server/server.go @@ -774,9 +774,7 @@ func (srv *Server) CmdRun(stdin io.ReadCloser, stdout io.Writer, args ...string) } if *fl_attach { future.Go(func() error { - log.Printf("CmdRun(): start receiving stdin\n") _, err := io.Copy(cmd_stdin, stdin) - log.Printf("CmdRun(): done receiving stdin\n") cmd_stdin.Close() return err }) From 004272e6f54c16e16f71ceddff44ae4d423da7c0 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Tue, 19 Feb 2013 13:07:25 -0800 Subject: [PATCH 3/9] docker/server: no more dependency on log --- server/server.go | 1 - 1 file changed, 1 deletion(-) diff --git a/server/server.go b/server/server.go index cfee4fbcac..8a3bb404f3 100644 --- a/server/server.go +++ b/server/server.go @@ -11,7 +11,6 @@ import ( "github.com/dotcloud/docker/image" "github.com/dotcloud/docker/rcli" "io" - "log" "net/http" "net/url" "os" From 7e5dfc51ade66d75c1429a05334b500d1cb8db20 Mon Sep 17 00:00:00 2001 From: Brian McCallister Date: Tue, 19 Feb 2013 20:49:06 -0700 Subject: [PATCH 4/9] ignore produced binaries --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 2b75f797f5..7c99eb899d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +docker +dockerd .*.swp a.out From f0183fa0690caf804301b8acbd0ac527a33d1cbd Mon Sep 17 00:00:00 2001 From: Brian McCallister Date: Tue, 19 Feb 2013 20:55:26 -0700 Subject: [PATCH 5/9] add reference to https://github.com/kr/pty in NOTICE --- NOTICE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NOTICE b/NOTICE index 1731678b47..f55cc6950a 100644 --- a/NOTICE +++ b/NOTICE @@ -2,3 +2,5 @@ Docker Copyright 2012-2013 dotCloud, inc. This product includes software developed at dotCloud, inc. (http://www.dotcloud.com). + +This product contains software (https://github.com/kr/pty) developed by Keith Rarick, licensed under the MIT License. \ No newline at end of file From 3a59336f82e73150059c93398f283b8e15fdb4e9 Mon Sep 17 00:00:00 2001 From: Jeff Lindsay Date: Wed, 20 Feb 2013 12:19:22 +0000 Subject: [PATCH 6/9] make sure the standard "replace input carriage returns with line feeds" and "replace output line feeds with carriage return and line feed" flags are set, even on raw (I dont think it should actually be raw) --- client/term.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/term.go b/client/term.go index 8b58611cd9..7606cbd42b 100644 --- a/client/term.go +++ b/client/term.go @@ -123,9 +123,11 @@ func MakeRaw(fd int) (*State, error) { if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(getTermios), uintptr(unsafe.Pointer(&oldState.termios)), 0, 0, 0); err != 0 { return nil, err } - + newState := oldState.termios - newState.Iflag &^= istrip | INLCR | ICRNL | IGNCR | IXON | IXOFF + newState.Iflag &^= ISTRIP | INLCR | IGNCR | IXON | IXOFF + newState.Iflag |= ICRNL + newState.Oflag |= ONLCR newState.Lflag &^= ECHO | ICANON | ISIG if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(setTermios), uintptr(unsafe.Pointer(&newState)), 0, 0, 0); err != 0 { return nil, err From e8d48641de6c5e866dc18708e2e260b7578c1d50 Mon Sep 17 00:00:00 2001 From: Jeff Lindsay Date: Wed, 20 Feb 2013 12:23:47 +0000 Subject: [PATCH 7/9] white space --- client/term.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/term.go b/client/term.go index 7606cbd42b..ed52be96b4 100644 --- a/client/term.go +++ b/client/term.go @@ -123,11 +123,11 @@ func MakeRaw(fd int) (*State, error) { if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(getTermios), uintptr(unsafe.Pointer(&oldState.termios)), 0, 0, 0); err != 0 { return nil, err } - + newState := oldState.termios newState.Iflag &^= ISTRIP | INLCR | IGNCR | IXON | IXOFF - newState.Iflag |= ICRNL - newState.Oflag |= ONLCR + newState.Iflag |= ICRNL + newState.Oflag |= ONLCR newState.Lflag &^= ECHO | ICANON | ISIG if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(setTermios), uintptr(unsafe.Pointer(&newState)), 0, 0, 0); err != 0 { return nil, err From db4c75f3c1cdbc654595bb3dda5455a93c1b56b4 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Wed, 20 Feb 2013 14:45:43 -0800 Subject: [PATCH 8/9] Interactive mode preserves existing PATH, to facilitate scripting --- client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index 164e1be321..5a8aac3807 100644 --- a/client/client.go +++ b/client/client.go @@ -112,7 +112,7 @@ func InteractiveMode(scripts ...string) error { return err } io.WriteString(rcfile, "enable -n help\n") - os.Setenv("PATH", tmp) + os.Setenv("PATH", tmp + ":" + os.Getenv("PATH")) os.Setenv("PS1", "\\h docker> ") shell := exec.Command("/bin/bash", append([]string{"--rcfile", rcfile.Name()}, scripts...)...) shell.Stdin = os.Stdin From dd96b6fccbe539f78c6957bacbbfaa3f048fdea1 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Thu, 21 Feb 2013 16:33:58 -0800 Subject: [PATCH 9/9] Updated install instructions and requirements --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0764c60d6a..42fd479b70 100644 --- a/README.md +++ b/README.md @@ -138,14 +138,16 @@ Standard Container Specification Setup instructions ================== -Supported hosts ---------------- +Requirements +------------ -Right now, the officially supported hosts are: +Right now, the officially supported distributions are: + +* Ubuntu 12.04 (precise LTS) * Ubuntu 12.10 (quantal) -Hosts that might work with slight kernel modifications, but are not officially supported: -* Ubuntu 12.04 (precise) +Docker probably works on other distributions featuring a recent kernel, the AUFS patch, and up-to-date lxc. However this has not been tested. + Step by step host setup ----------------------- @@ -156,11 +158,11 @@ Step by step host setup apt-get update apt-get install lxc wget - debootstrap --arch=amd64 quantal /var/lib/docker/images/ubuntu/ -4. Download the latest version of the [docker binaries](https://dl.dropbox.com/u/20637798/docker.tar.gz) (`wget https://dl.dropbox.com/u/20637798/docker.tar.gz`) +4. Download the latest version of the [docker binaries](https://dl.dropbox.com/u/20637798/docker.tar.gz) (`wget https://dl.dropbox.com/u/20637798/docker.tar.gz`) (warning: this may not be the most up-to-date build) 5. Extract the contents of the tar file `tar -xf docker.tar.gz` 6. Launch the docker daemon `./dockerd` +7. Download a base image by running 'docker pull -j base' Client installation