diff --git a/Dockerfile.ppc64le b/Dockerfile.ppc64le new file mode 100644 index 0000000000..74303ece34 --- /dev/null +++ b/Dockerfile.ppc64le @@ -0,0 +1,88 @@ +# This file describes the standard way to build Docker, using docker +# +# Usage: +# +# # Assemble the full dev environment. This is slow the first time. +# docker build -t docker -f Dockerfile.ppc64le . +# + +FROM ppc64le/gcc:5.2 + +# Packaged dependencies +RUN apt-get update && apt-get install -y \ + apparmor \ + aufs-tools \ + btrfs-tools \ + build-essential \ + curl \ + git \ + iptables \ + net-tools \ + libapparmor-dev \ + libcap-dev \ + libsqlite3-dev \ + mercurial \ + parallel \ + python-mock \ + python-pip \ + python-websocket \ + --no-install-recommends + +RUN rm -rf /usr/local/lvm2 +RUN git clone --no-checkout git://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 && cd /usr/local/lvm2 && git checkout -q v2_02_103 +RUN curl -o /usr/local/lvm2/autoconf/config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' +RUN curl -o /usr/local/lvm2/autoconf/config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' + +# Compile and install lvm2 +RUN cd /usr/local/lvm2 \ + && ./configure --enable-static_link \ + && make device-mapper \ + && make install_device-mapper + +ENV GOPATH /go:/go/src/github.com/docker/docker/vendor + +ENV REGISTRY_COMMIT ec87e9b6971d831f0eff752ddb54fb64693e51cd +RUN set -x \ + && export GOPATH="$(mktemp -d)" \ + && git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \ + && (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \ + && GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \ + go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \ + && rm -rf "$GOPATH" + +# Install notary server +ENV NOTARY_COMMIT 8e8122eb5528f621afcd4e2854c47302f17392f7 +RUN set -x \ + && export GOPATH="$(mktemp -d)" \ + && git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \ + && (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_COMMIT") \ + && GOPATH="$GOPATH/src/github.com/docker/notary/Godeps/_workspace:$GOPATH" \ + go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \ + && rm -rf "$GOPATH" + +# Get the "docker-py" source so we can run their integration tests +ENV DOCKER_PY_COMMIT 47ab89ec2bd3bddf1221b856ffbaff333edeabb4 +RUN git clone https://github.com/docker/docker-py.git /docker-py \ + && cd /docker-py \ + && git checkout -q $DOCKER_PY_COMMIT \ + && pip install -r test-requirements.txt + +# Add an unprivileged user to be used for tests which need it +RUN groupadd -r docker +RUN useradd --create-home --gid docker unprivilegeduser + +VOLUME /var/lib/docker +WORKDIR /go/src/github.com/docker/docker +ENV DOCKER_BUILDTAGS apparmor selinux + +ENV IMAGEREPO ppc64le +COPY contrib/download-frozen-image.sh /go/src/github.com/docker/docker/contrib/ +RUN ./contrib/download-frozen-image.sh /docker-frozen-images \ + $IMAGEREPO/busybox:latest \ + $IMAGEREPO/hello-world:frozen + +# Wrap all commands in the "docker-in-docker" script to allow nested containers +ENTRYPOINT ["hack/dind"] + +# Upload docker source +COPY . /go/src/github.com/docker/docker diff --git a/Dockerfile.s390x b/Dockerfile.s390x new file mode 100644 index 0000000000..5f63bfc546 --- /dev/null +++ b/Dockerfile.s390x @@ -0,0 +1,87 @@ +# This file describes the standard way to build Docker, using docker +# +# Usage: +# +# # Assemble the full dev environment. This is slow the first time. +# docker build -t docker -f Dockerfile.s390x . +# + +FROM s390x/gcc:5.2 + +# Packaged dependencies +RUN apt-get update && apt-get install -y \ + apparmor \ + aufs-tools \ + btrfs-tools \ + build-essential \ + curl \ + git \ + iptables \ + net-tools \ + libapparmor-dev \ + libcap-dev \ + libsqlite3-dev \ + mercurial \ + parallel \ + python-mock \ + python-pip \ + python-websocket \ + --no-install-recommends + +# Get lvm2 source for compiling statically +RUN git clone -b v2_02_103 https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 +# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags + +# Compile and install lvm2 +RUN cd /usr/local/lvm2 \ + && ./configure --enable-static_link \ + && make device-mapper \ + && make install_device-mapper + +ENV GOPATH /go:/go/src/github.com/docker/docker/vendor + +ENV REGISTRY_COMMIT ec87e9b6971d831f0eff752ddb54fb64693e51cd +RUN set -x \ + && export GOPATH="$(mktemp -d)" \ + && git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \ + && (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \ + && GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \ + go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \ + && rm -rf "$GOPATH" + +# Install notary server +ENV NOTARY_COMMIT 8e8122eb5528f621afcd4e2854c47302f17392f7 +RUN set -x \ + && export GOPATH="$(mktemp -d)" \ + && git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \ + && (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_COMMIT") \ + && GOPATH="$GOPATH/src/github.com/docker/notary/Godeps/_workspace:$GOPATH" \ + go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \ + && rm -rf "$GOPATH" + +# Get the "docker-py" source so we can run their integration tests +ENV DOCKER_PY_COMMIT 47ab89ec2bd3bddf1221b856ffbaff333edeabb4 +RUN git clone https://github.com/docker/docker-py.git /docker-py \ + && cd /docker-py \ + && git checkout -q $DOCKER_PY_COMMIT \ + && pip install -r test-requirements.txt + +# Add an unprivileged user to be used for tests which need it +RUN groupadd -r docker +RUN useradd --create-home --gid docker unprivilegeduser + +VOLUME /var/lib/docker +WORKDIR /go/src/github.com/docker/docker +ENV DOCKER_BUILDTAGS apparmor selinux + +ENV IMAGEREPO s390x +COPY contrib/download-frozen-image.sh /go/src/github.com/docker/docker/contrib/ +RUN ./contrib/download-frozen-image.sh /docker-frozen-images \ + $IMAGEREPO/busybox:latest \ + $IMAGEREPO/hello-world:frozen + +# Wrap all commands in the "docker-in-docker" script to allow nested containers +ENTRYPOINT ["hack/dind"] + +# Upload docker source +COPY . /go/src/github.com/docker/docker diff --git a/hack/make.sh b/hack/make.sh index 52ad07e22b..a37eb13361 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -140,7 +140,7 @@ ORIG_BUILDFLAGS=( -a -tags "autogen netgo static_build sqlite_omit_load_extensio # see https://github.com/golang/go/issues/9369#issuecomment-69864440 for why -installsuffix is necessary here BUILDFLAGS=( $BUILDFLAGS "${ORIG_BUILDFLAGS[@]}" ) # Test timeout. -: ${TIMEOUT:=60m} +: ${TIMEOUT:=120m} TESTFLAGS+=" -test.timeout=${TIMEOUT}" LDFLAGS_STATIC_DOCKER=" diff --git a/hack/make/.ensure-images b/hack/make/.ensure-images new file mode 100644 index 0000000000..bd44d8e432 --- /dev/null +++ b/hack/make/.ensure-images @@ -0,0 +1,9 @@ +for image in `docker images | awk '{print $1}'`; do +if ( [ -z "${image##$IMAGEREPO/busybox}" ] ); then + docker tag $image busybox:latest + docker rmi $image +elif ( [ -z "${image##$IMAGEREPO/hello-world}" ] ); then + docker tag $image:frozen hello-world:frozen + docker rmi $image:frozen +fi +done diff --git a/hack/make/.integration-daemon-setup b/hack/make/.integration-daemon-setup index ab9d45c32c..a299c39056 100644 --- a/hack/make/.integration-daemon-setup +++ b/hack/make/.integration-daemon-setup @@ -2,4 +2,5 @@ bundle .ensure-emptyfs bundle .ensure-frozen-images +bundle .ensure-images bundle .ensure-httpserver diff --git a/hack/make/gccgo b/hack/make/gccgo index 10b1152ab6..878c814bab 100644 --- a/hack/make/gccgo +++ b/hack/make/gccgo @@ -10,6 +10,7 @@ source "${MAKEDIR}/.go-autogen" if [[ "${BUILDFLAGS[@]}" =~ 'netgo ' ]]; then EXTLDFLAGS_STATIC+=' -lnetgo' fi +# gccgo require explicit flag -pthread to allow goroutines to work. go build -compiler=gccgo \ -o "$DEST/$BINARY_FULLNAME" \ "${BUILDFLAGS[@]}" \ @@ -18,6 +19,7 @@ go build -compiler=gccgo \ $EXTLDFLAGS_STATIC -Wl,--no-export-dynamic -ldl + -pthread " \ ./docker diff --git a/integration-cli/docker_cli_events_test.go b/integration-cli/docker_cli_events_test.go index f33f8434bb..f7fb4341e8 100644 --- a/integration-cli/docker_cli_events_test.go +++ b/integration-cli/docker_cli_events_test.go @@ -53,7 +53,7 @@ func (s *DockerSuite) TestEventsUntag(c *check.C) { dockerCmd(c, "rmi", "utest:tag1") dockerCmd(c, "rmi", "utest:tag2") eventsCmd := exec.Command(dockerBinary, "events", "--since=1") - out, exitCode, _, err := runCommandWithOutputForDuration(eventsCmd, time.Duration(time.Millisecond*200)) + out, exitCode, _, err := runCommandWithOutputForDuration(eventsCmd, time.Duration(time.Millisecond*500)) c.Assert(err, checker.IsNil) c.Assert(exitCode, checker.Equals, 0, check.Commentf("Failed to get events")) events := strings.Split(out, "\n") diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index e338589abb..8ec54e5a2b 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -2868,7 +2868,7 @@ func (s *DockerSuite) TestRunUnshareProc(c *check.C) { /* Ensure still fails if running privileged with the default policy */ name = "crashoverride" - if out, _, err := dockerCmdWithError("run", "--privileged", "--security-opt", "apparmor:docker-default", "--name", name, "jess/unshare", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc"); err == nil || !strings.Contains(out, "Permission denied") { + if out, _, err := dockerCmdWithError("run", "--privileged", "--security-opt", "apparmor:docker-default", "--name", name, "jess/unshare", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc"); err == nil || !(strings.Contains(out, "Permission denied") || strings.Contains(out, "Operation not permitted")) { c.Fatalf("unshare should have failed with permission denied, got: %s, %v", out, err) } } diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index c1fafd110a..035c2ddf86 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -233,7 +233,7 @@ func (s *DockerSuite) TestRunOOMExitCode(c *check.C) { select { case err := <-errChan: c.Assert(err, check.IsNil) - case <-time.After(30 * time.Second): + case <-time.After(600 * time.Second): c.Fatal("Timeout waiting for container to die on OOM") } } @@ -255,7 +255,7 @@ func (s *DockerSuite) TestRunWithoutMemoryswapLimit(c *check.C) { testRequires(c, DaemonIsLinux) testRequires(c, memoryLimitSupport) testRequires(c, swapMemorySupport) - dockerCmd(c, "run", "-m", "16m", "--memory-swap", "-1", "busybox", "true") + dockerCmd(c, "run", "-m", "32m", "--memory-swap", "-1", "busybox", "true") } func (s *DockerSuite) TestRunWithSwappiness(c *check.C) { diff --git a/integration-cli/docker_cli_save_load_test.go b/integration-cli/docker_cli_save_load_test.go index fff0a2891f..673d3a94a8 100644 --- a/integration-cli/docker_cli_save_load_test.go +++ b/integration-cli/docker_cli_save_load_test.go @@ -131,8 +131,11 @@ func (s *DockerSuite) TestSaveImageId(c *check.C) { c.Assert(tarCmd.Start(), checker.IsNil, check.Commentf("tar failed with error: %v", err)) c.Assert(saveCmd.Start(), checker.IsNil, check.Commentf("docker save failed with error: %v", err)) - defer saveCmd.Wait() - defer tarCmd.Wait() + defer func() { + saveCmd.Wait() + tarCmd.Wait() + dockerCmd(c, "rmi", repoName) + }() out, _, err = runCommandWithOutput(grepCmd) diff --git a/integration-cli/docker_cli_version_test.go b/integration-cli/docker_cli_version_test.go index 48b52f3187..7672beb732 100644 --- a/integration-cli/docker_cli_version_test.go +++ b/integration-cli/docker_cli_version_test.go @@ -35,7 +35,7 @@ func (s *DockerSuite) TestVersionPlatform_w(c *check.C) { // ensure the Linux daemon return the correct platform string func (s *DockerSuite) TestVersionPlatform_l(c *check.C) { testRequires(c, DaemonIsLinux) - testVersionPlatform(c, "linux/amd64") + testVersionPlatform(c, "linux") } func testVersionPlatform(c *check.C, platform string) { diff --git a/pkg/integration/dockerCmd_utils_test.go b/pkg/integration/dockerCmd_utils_test.go index fd492709e3..50caaf2611 100644 --- a/pkg/integration/dockerCmd_utils_test.go +++ b/pkg/integration/dockerCmd_utils_test.go @@ -171,7 +171,7 @@ func (s *DockerCmdSuite) TestDockerCmdWithTimeout(c *check.C) { { "doesnotexists", []string{}, - 100 * time.Millisecond, + 200 * time.Millisecond, `Command doesnotexists not found.`, 1, fmt.Errorf(`"" failed with errors: exit status 1 : "Command doesnotexists not found."`), @@ -179,7 +179,7 @@ func (s *DockerCmdSuite) TestDockerCmdWithTimeout(c *check.C) { { dockerBinary, []string{"an", "error"}, - 100 * time.Millisecond, + 200 * time.Millisecond, `an error has occurred`, 1, fmt.Errorf(`"an error" failed with errors: exit status 1 : "an error has occurred"`), @@ -195,7 +195,7 @@ func (s *DockerCmdSuite) TestDockerCmdWithTimeout(c *check.C) { { dockerBinary, []string{"run", "-ti", "ubuntu", "echo", "hello"}, - 100 * time.Millisecond, + 200 * time.Millisecond, "hello", 0, nil, @@ -282,7 +282,7 @@ func (s *DockerCmdSuite) TestDockerCmdInDirWithTimeout(c *check.C) { { "doesnotexists", []string{}, - 100 * time.Millisecond, + 200 * time.Millisecond, `Command doesnotexists not found.`, 1, fmt.Errorf(`"dir:%s" failed with errors: exit status 1 : "Command doesnotexists not found."`, tempFolder), @@ -290,7 +290,7 @@ func (s *DockerCmdSuite) TestDockerCmdInDirWithTimeout(c *check.C) { { dockerBinary, []string{"an", "error"}, - 100 * time.Millisecond, + 200 * time.Millisecond, `an error has occurred`, 1, fmt.Errorf(`"dir:%s an error" failed with errors: exit status 1 : "an error has occurred"`, tempFolder), @@ -306,7 +306,7 @@ func (s *DockerCmdSuite) TestDockerCmdInDirWithTimeout(c *check.C) { { dockerBinary, []string{"run", "-ti", "ubuntu", "echo", "hello"}, - 100 * time.Millisecond, + 200 * time.Millisecond, "hello", 0, nil,