Sfoglia il codice sorgente

Merge branch 'master' into fs

shin- 12 anni fa
parent
commit
ffbb9c8e4a
8 ha cambiato i file con 21 aggiunte e 13 eliminazioni
  1. 2 0
      .gitignore
  2. 2 0
      NOTICE
  3. 9 7
      README.md
  4. 1 1
      client/client.go
  5. 3 1
      client/term.go
  6. 1 1
      docker.go
  7. 3 0
      image/image.go
  8. 0 3
      server/server.go

+ 2 - 0
.gitignore

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

+ 2 - 0
NOTICE

@@ -2,3 +2,5 @@ Docker
 Copyright 2012-2013 dotCloud, inc.
 Copyright 2012-2013 dotCloud, inc.
 
 
 This product includes software developed at dotCloud, inc. (http://www.dotcloud.com).
 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.

+ 9 - 7
README.md

@@ -138,14 +138,16 @@ Standard Container Specification
 Setup instructions
 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)
 * 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
 Step by step host setup
 -----------------------
 -----------------------
@@ -156,11 +158,11 @@ Step by step host setup
 
 
         apt-get update
         apt-get update
         apt-get install lxc wget
         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`
 5. Extract the contents of the tar file `tar -xf docker.tar.gz`
 6. Launch the docker daemon `./dockerd`
 6. Launch the docker daemon `./dockerd`
+7. Download a base image by running 'docker pull -j base'
 
 
 
 
 Client installation
 Client installation

+ 1 - 1
client/client.go

@@ -112,7 +112,7 @@ func InteractiveMode(scripts ...string) error {
 		return err
 		return err
 	}
 	}
 	io.WriteString(rcfile, "enable -n help\n")
 	io.WriteString(rcfile, "enable -n help\n")
-	os.Setenv("PATH", tmp)
+	os.Setenv("PATH", tmp + ":" + os.Getenv("PATH"))
 	os.Setenv("PS1", "\\h docker> ")
 	os.Setenv("PS1", "\\h docker> ")
 	shell := exec.Command("/bin/bash", append([]string{"--rcfile", rcfile.Name()}, scripts...)...)
 	shell := exec.Command("/bin/bash", append([]string{"--rcfile", rcfile.Name()}, scripts...)...)
 	shell.Stdin = os.Stdin
 	shell.Stdin = os.Stdin

+ 3 - 1
client/term.go

@@ -125,7 +125,9 @@ func MakeRaw(fd int) (*State, error) {
         }
         }
 
 
         newState := oldState.termios
         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
         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 {
         if _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), uintptr(setTermios), uintptr(unsafe.Pointer(&newState)), 0, 0, 0); err != 0 {
                 return nil, err
                 return nil, err

+ 1 - 1
docker.go

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

+ 3 - 0
image/image.go

@@ -27,6 +27,9 @@ func New(root string) (*Store, error) {
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err
 	}
 	}
+	if err := os.MkdirAll(abspath, 0700); err != nil && !os.IsExist(err) {
+		return nil, err
+	}
 	layers, err := NewLayerStore(path.Join(root, "layers"))
 	layers, err := NewLayerStore(path.Join(root, "layers"))
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err

+ 0 - 3
server/server.go

@@ -11,7 +11,6 @@ import (
 	"github.com/dotcloud/docker/image"
 	"github.com/dotcloud/docker/image"
 	"github.com/dotcloud/docker/rcli"
 	"github.com/dotcloud/docker/rcli"
 	"io"
 	"io"
-	"log"
 	"net/http"
 	"net/http"
 	"net/url"
 	"net/url"
 	"os"
 	"os"
@@ -774,9 +773,7 @@ func (srv *Server) CmdRun(stdin io.ReadCloser, stdout io.Writer, args ...string)
 		}
 		}
 		if *fl_attach {
 		if *fl_attach {
 			future.Go(func() error {
 			future.Go(func() error {
-				log.Printf("CmdRun(): start receiving stdin\n")
 				_, err := io.Copy(cmd_stdin, stdin)
 				_, err := io.Copy(cmd_stdin, stdin)
-				log.Printf("CmdRun(): done receiving stdin\n")
 				cmd_stdin.Close()
 				cmd_stdin.Close()
 				return err
 				return err
 			})
 			})