Merge branch 'master' into fs

This commit is contained in:
shin- 2013-02-26 17:45:55 -08:00
commit ffbb9c8e4a
8 changed files with 21 additions and 13 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
docker
dockerd
.*.swp
a.out

2
NOTICE
View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -125,7 +125,9 @@ func MakeRaw(fd int) (*State, error) {
}
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

View File

@ -120,7 +120,7 @@ func NewFromDirectory(root string) (*Docker, error) {
Store: store,
}
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
}

View File

@ -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

View File

@ -11,7 +11,6 @@ import (
"github.com/dotcloud/docker/image"
"github.com/dotcloud/docker/rcli"
"io"
"log"
"net/http"
"net/url"
"os"
@ -774,9 +773,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
})