Merge component 'engine' from git@github.com:moby/moby master

This commit is contained in:
GordonTheTurtle
2018-01-15 17:03:57 +00:00
13 changed files with 48 additions and 36 deletions

View File

@ -167,11 +167,12 @@ RUN echo "source $PWD/hack/make/.integration-test-helpers" >> /etc/bash.bashrc
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
# TODO: when issue #35963 fixed, we can upgrade the busybox to multi-arch
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
buildpack-deps:jessie@sha256:85b379ec16065e4fe4127eb1c5fb1bcc03c559bd36dbb2e22ff496de55925fa6 \
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
busybox:latest@sha256:32f093055929dbc23dec4d03e09dfe971f5973a9ca5cf059cbfb644c206aa83f \
debian:jessie@sha256:72f784399fd2719b4cb4e16ef8e369a39dc67f53d978cd3e2e7bf4e502c7b793 \
hello-world:latest@sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
# See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
# Install tomlv, vndr, runc, containerd, tini, docker-proxy dockercli

View File

@ -131,10 +131,10 @@ RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
armhf/buildpack-deps:jessie@sha256:eb2dad77ef53e88d94c3c83862d315c806ea1ca49b6e74f4db362381365ce489 \
armhf/busybox:latest@sha256:016a1e149d2acc2a3789a160dfa60ce870794eea27ad5e96f7a101970e5e1689 \
armhf/debian:jessie@sha256:ac59fa18b28d0ef751eabb5ba4c4b5a9063f99398bae2f70495aa8ed6139b577 \
armhf/hello-world:latest@sha256:9701edc932223a66e49dd6c894a11db8c2cf4eccd1414f1ec105a623bf16b426
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
# See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
# Install tomlv, vndr, runc, containerd, tini, docker-proxy

View File

@ -16,10 +16,10 @@ WORKDIR /go/src/github.com/docker/docker/
# Generate frozen images
COPY contrib/download-frozen-image-v2.sh contrib/download-frozen-image-v2.sh
RUN contrib/download-frozen-image-v2.sh /output/docker-frozen-images \
buildpack-deps:jessie@sha256:85b379ec16065e4fe4127eb1c5fb1bcc03c559bd36dbb2e22ff496de55925fa6 \
busybox:latest@sha256:32f093055929dbc23dec4d03e09dfe971f5973a9ca5cf059cbfb644c206aa83f \
debian:jessie@sha256:72f784399fd2719b4cb4e16ef8e369a39dc67f53d978cd3e2e7bf4e502c7b793 \
hello-world:latest@sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
# Download Docker CLI binary
COPY hack/dockerfile hack/dockerfile

View File

@ -129,10 +129,10 @@ RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
ppc64le/buildpack-deps:jessie@sha256:1a2f2d2cc8738f14b336aeffc3503b5c9dedf9e1f26c7313cb4999534ad4716f \
ppc64le/busybox:latest@sha256:54f34c83adfab20cf0e630d879e210f07b0062cd6caaf16346a61396d50e7584 \
ppc64le/debian:jessie@sha256:ea8c5b105e3790f075145b40e4be1e4488c9f33f55e6cc45182047b80a68f892 \
ppc64le/hello-world:latest@sha256:7d57adf137665f748956c86089320710b66d08584db3500ed98f4bb3da637c2d
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
# See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
# Install tomlv, vndr, runc, containerd, tini, docker-proxy

View File

@ -123,10 +123,10 @@ RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
s390x/buildpack-deps:jessie@sha256:552dec28146e4d2591fc0309aebdbac9e4fb1f335d90c70a14bbf72fb8bb1be5 \
s390x/busybox:latest@sha256:e32f40c39ca596a4317392bd32809bb188c4ae5864ea827c3219c75c50069964 \
s390x/debian:jessie@sha256:6994e3ffa5a1dabea09d536f350b3ed2715292cb469417c42a82b70fcbff7d32 \
s390x/hello-world:latest@sha256:602db500fee63934292260e65c0c528128ad1c1c7c6497f95bbbac7d4d5312f1
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
# See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
# Install tomlv, vndr, runc, containerd, tini, docker-proxy

View File

@ -53,7 +53,6 @@ esac
export PACKAGE_ARCH
DOCKERFILE='Dockerfile'
TEST_IMAGE_NAMESPACE=
case "$PACKAGE_ARCH" in
amd64)
case "${DOCKER_ENGINE_GOOS:-$DOCKER_CLIENT_GOOS}" in
@ -64,9 +63,6 @@ case "$PACKAGE_ARCH" in
;;
*)
DOCKERFILE="Dockerfile.$PACKAGE_ARCH"
if [ "$PACKAGE_ARCH" != "aarch64" ]; then
TEST_IMAGE_NAMESPACE="$PACKAGE_ARCH"
fi
;;
esac
export DOCKERFILE TEST_IMAGE_NAMESPACE
export DOCKERFILE

View File

@ -99,7 +99,6 @@ test_env() {
HOME="$ABS_DEST/fake-HOME" \
PATH="$PATH" \
TEMP="$TEMP" \
TEST_IMAGE_NAMESPACE="$TEST_IMAGE_NAMESPACE" \
TEST_CLIENT_BINARY="$TEST_CLIENT_BINARY" \
"$@"
)

View File

@ -400,20 +400,27 @@ func (s *DockerSuite) TestBuildLastModified(c *check.C) {
defer server.Close()
var out, out2 string
var args []string
// Temopray workaround for #35963. Will remove this when that issue fixed
if runtime.GOARCH == "amd64" {
args = []string{"run", name, "ls", "-le", "/file"}
} else {
args = []string{"run", name, "ls", "-l", "--full-time", "/file"}
}
dFmt := `FROM busybox
ADD %s/file /`
dockerfile := fmt.Sprintf(dFmt, server.URL())
cli.BuildCmd(c, name, build.WithoutCache, build.WithDockerfile(dockerfile))
out = cli.DockerCmd(c, "run", name, "ls", "-le", "/file").Combined()
out = cli.DockerCmd(c, args...).Combined()
// Build it again and make sure the mtime of the file didn't change.
// Wait a few seconds to make sure the time changed enough to notice
time.Sleep(2 * time.Second)
cli.BuildCmd(c, name, build.WithoutCache, build.WithDockerfile(dockerfile))
out2 = cli.DockerCmd(c, "run", name, "ls", "-le", "/file").Combined()
out2 = cli.DockerCmd(c, args...).Combined()
if out != out2 {
c.Fatalf("MTime changed:\nOrigin:%s\nNew:%s", out, out2)
@ -428,7 +435,7 @@ ADD %s/file /`
dockerfile = fmt.Sprintf(dFmt, server.URL())
cli.BuildCmd(c, name, build.WithoutCache, build.WithDockerfile(dockerfile))
out2 = cli.DockerCmd(c, "run", name, "ls", "-le", "/file").Combined()
out2 = cli.DockerCmd(c, args...).Combined()
if out == out2 {
c.Fatalf("MTime didn't change:\nOrigin:%s\nNew:%s", out, out2)

View File

@ -2239,7 +2239,16 @@ func (s *DockerSuite) TestRunSlowStdoutConsumer(c *check.C) {
// TODO Windows: This should be able to run on Windows if can find an
// alternate to /dev/zero and /dev/stdout.
testRequires(c, DaemonIsLinux)
cont := exec.Command(dockerBinary, "run", "--rm", "busybox", "/bin/sh", "-c", "dd if=/dev/zero of=/dev/stdout bs=1024 count=2000 | catv")
// TODO will remove this if issue #35963 fixed
var args []string
if runtime.GOARCH == "amd64" {
args = []string{"run", "--rm", "busybox", "/bin/sh", "-c", "dd if=/dev/zero of=/dev/stdout bs=1024 count=2000 | catv"}
} else {
args = []string{"run", "--rm", "busybox", "/bin/sh", "-c", "dd if=/dev/zero of=/dev/stdout bs=1024 count=2000 | cat -v"}
}
cont := exec.Command(dockerBinary, args...)
stdout, err := cont.StdoutPipe()
if err != nil {

View File

@ -26,7 +26,6 @@ const frozenImgDir = "/docker-frozen-images"
// images were passed in. If the images need to be downloaded, then it will respect
// the passed in images
func FrozenImagesLinux(client client.APIClient, images ...string) error {
imgNS := os.Getenv("TEST_IMAGE_NAMESPACE")
var loadImages []struct{ srcName, destName string }
for _, img := range images {
if !imageExists(client, img) {
@ -38,9 +37,6 @@ func FrozenImagesLinux(client client.APIClient, images ...string) error {
if img == "hello-world:frozen" {
srcName = "hello-world:latest"
}
if imgNS != "" {
srcName = imgNS + "/" + srcName
}
loadImages = append(loadImages, struct{ srcName, destName string }{
srcName: srcName,
destName: img,

View File

@ -2,7 +2,6 @@ package volume
import (
"errors"
"fmt"
"path"
"github.com/docker/docker/api/types/mount"
@ -10,7 +9,7 @@ import (
var lcowSpecificValidators mountValidator = func(m *mount.Mount) error {
if path.Clean(m.Target) == "/" {
return fmt.Errorf("invalid specification: destination can't be '/'")
return ErrVolumeTargetIsRoot
}
if m.Type == mount.TypeNamedPipe {
return errors.New("Linux containers on Windows do not support named pipe mounts")

View File

@ -29,7 +29,7 @@ func linuxSplitRawSpec(raw string) ([]string, error) {
func linuxValidateNotRoot(p string) error {
p = path.Clean(strings.Replace(p, `\`, `/`, -1))
if p == "/" {
return fmt.Errorf("invalid specification: destination can't be '/'")
return ErrVolumeTargetIsRoot
}
return nil
}

View File

@ -1,6 +1,7 @@
package volume
import (
"errors"
"runtime"
"github.com/docker/docker/api/types/mount"
@ -13,6 +14,10 @@ const (
OSWindows = "windows"
)
// ErrVolumeTargetIsRoot is returned when the target destination is root.
// It's used by both LCOW and Linux parsers.
var ErrVolumeTargetIsRoot = errors.New("invalid specification: destination can't be '/'")
// Parser represents a platform specific parser for mount expressions
type Parser interface {
ParseMountRaw(raw, volumeDriver string) (*MountPoint, error)