The stdcopy package is used to produce and read multiplexed streams for
"attach" and "logs". It is used both by the API server (to produce), and
the client (to read / de-multiplex).
Move it to the api package, so that it can be included in the api module.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This test was failing frequently on Windows, waiting for the state
of the container to be "running" after restarting, however, this
would race because the command of the container was very short-lived;
=== Failed
=== FAIL: github.com/docker/docker/integration-cli TestDockerCLIRestartSuite/TestRestartStoppedContainer (37.00s)
docker_cli_restart_test.go:42: assertion failed: error is not nil: condition ""true" == "false"" not true in time (20s)
Ironically, that check was added in 48ccdd46ae
to make the test less flaky.
This patch takes the approach from TestRestartRunningContainer, which had
similar issues on Windows that were addressed in bae22d167c
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This test was testing a non-gracceful kill od the daemon, after which it
started it again, however `d.Stop()` would log that the daemon wasn't running,
which is expected, so let's reduce noise;
docker_cli_network_unix_test.go:1143: [dadd2ae3b638b] daemon is not started
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The OCI types should be able to unmarshal the image manifest (regardless
if it was created from the legacy distribution types or otherwise), so
we can drop the use of the legacy distribution types here.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The OCI types should be able to unmarshal the image manifest (regardless
if it was created from the legacy distribution types or otherwise), so
we can drop the use of the legacy distribution types here.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This test is verifying that push/pull works; current versions of the registry
used should support both the legacy (docker distribution) and OCI media-types,
so let's use the OCI types.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Trying to reduce the places where we depend on the legacy distribution
dependency. For this test, we used it to generate the JSON for a manifest-list,
which we can do with the OCI types as well.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This removes the tarexporter.legacyLoadImage method and related helpers.
This functionality was added in 01ba0a935b
(docker v1.10), which introduced the new content-addressable image
format; this code provided backward-compatibility with older archives
which contained v0/v1 images.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Seeing some test-failures, which could be due to changes on Docker Hub
=== Failed
=== FAIL: github.com/docker/docker/integration-cli TestDockerCLIPushSuite/TestPushToCentralRegistryUnauthorized (51.08s)
docker_cli_push_test.go:229: assertion failed: strings.Contains(out, "Retrying") is true
=== FAIL: github.com/docker/docker/integration-cli TestDockerCLIPushSuite (101.49s)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
It checked for "Bind for 0.0.0.0:80 failed: port is already
allocated". But, since commit d662091 ("portallocator: always
check for ports allocated for 0.0.0.0/::"), the message is
sometimes about ":::80".
Signed-off-by: Rob Murray <rob.murray@docker.com>
commit 4dc961d0e9 removed deprecated
fields from the image inspect response for API v1.50 and up. As
part of that change, it changed the type used for the Config field
to use the docker image spect structs, which embeds the OCI image
spec structs.
While the OCI image spect struct contains the same fields as we
used before, those fields also have "omitempty" set, which means
they are now omitted when empty.
We should probably consider deprecating that behavior in the API,
and call out that these fields are omitted if not set, but in the
meantime, we can add them back with their default (zero) value.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.
Remove these imports in preparation of migrating our code to become an
actual go module.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
commit af0cdc36c7 marked these fields as
deprecated and to be removed in API v1.47 (which was targeted for v28.0).
We shipped v1.47 with the v27.2 release, but did not yet remove the erroneous
fields, so the version to deprecate was updated to v1.48 through
3df03d8e66
This patch removes fields that are not part of the image by replacing the
type with the Config struct from the docker image-spec.
curl -s --unix-socket /var/run/docker.sock http://localhost/v1.50/images/alpine/json | jq .Config
{
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/sh"
]
}
curl -s --unix-socket /var/run/docker.sock http://localhost/v1.49/images/alpine/json | jq .Config
{
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/sh"
],
"Image": "",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": null
}
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>