1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #1510 from dotcloud/bump_0.5.3

Bump to 0.5.3
This commit is contained in:
Michael Crosby 2013-08-13 10:41:57 -07:00
commit 06a092bdb5
8 changed files with 35 additions and 6 deletions

View file

@ -1,5 +1,12 @@
# Changelog
## 0.5.3 (2013-08-13)
* Runtime: Use docker group for socket permissions
- Runtime: Spawn shell within upstart script
- Builder: Make sure ENV instruction within build perform a commit each time
- Runtime: Handle ip route showing mask-less IP addresses
- Runtime: Add hostname to environment
## 0.5.2 (2013-08-08)
* Builder: Forbid certain paths within docker build ADD
- Runtime: Change network range to avoid conflict with EC2 DNS

16
api.go
View file

@ -13,6 +13,7 @@ import (
"net/http"
"os"
"os/exec"
"regexp"
"strconv"
"strings"
)
@ -974,7 +975,20 @@ func ListenAndServe(proto, addr string, srv *Server, logging bool) error {
return e
}
if proto == "unix" {
os.Chmod(addr, 0700)
os.Chmod(addr, 0660)
groups, err := ioutil.ReadFile("/etc/group")
if err != nil {
return err
}
re := regexp.MustCompile("(^|\n)docker:.*?:([0-9]+)")
if gidMatch := re.FindStringSubmatch(string(groups)); gidMatch != nil {
gid, err := strconv.Atoi(gidMatch[2])
if err != nil {
return err
}
utils.Debugf("docker group found. gid: %d", gid)
os.Chown(addr, 0, gid)
}
}
httpSrv := http.Server{Addr: addr, Handler: r}
return httpSrv.Serve(l)

View file

@ -167,9 +167,9 @@ func (b *buildFile) CmdEnv(args string) error {
if envKey >= 0 {
b.config.Env[envKey] = replacedVar
return nil
} else {
b.config.Env = append(b.config.Env, replacedVar)
}
b.config.Env = append(b.config.Env, replacedVar)
return b.commit("", b.config.Cmd, fmt.Sprintf("ENV %s", replacedVar))
}

View file

@ -27,7 +27,7 @@ import (
"unicode"
)
const VERSION = "0.5.2"
const VERSION = "0.5.3"
var (
GITCOMMIT string

View file

@ -652,6 +652,7 @@ func (container *Container) Start(hostConfig *HostConfig) error {
"-e", "HOME=/",
"-e", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"-e", "container=lxc",
"-e", "HOSTNAME="+container.Config.Hostname,
)
for _, elem := range container.Config.Env {

View file

@ -960,6 +960,7 @@ func TestEnv(t *testing.T) {
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"HOME=/",
"container=lxc",
"HOSTNAME=" + container.ShortID(),
}
sort.Strings(goodEnv)
if len(goodEnv) != len(actualEnv) {

View file

@ -104,7 +104,11 @@ func checkRouteOverlaps(dockerNetwork *net.IPNet) error {
continue
}
if _, network, err := net.ParseCIDR(strings.Split(line, " ")[0]); err != nil {
return fmt.Errorf("Unexpected ip route output: %s (%s)", err, line)
// is this a mask-less IP address?
if ip := net.ParseIP(strings.Split(line, " ")[0]); ip == nil {
// fail only if it's neither a network nor a mask-less IP address
return fmt.Errorf("Unexpected ip route output: %s (%s)", err, line)
}
} else if networkOverlaps(dockerNetwork, network) {
return fmt.Errorf("Network %s is already routed: '%s'", dockerNetwork.String(), line)
}

View file

@ -5,4 +5,6 @@ stop on runlevel [!2345]
respawn
exec /usr/bin/docker -d
script
/usr/bin/docker -d
end script