mirror of
https://github.com/docker/cli.git
synced 2026-11-13 00:04:00 -04:00
Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
211e74b240 | ||
|
|
8beff78d85 | ||
|
|
e64914c890 | ||
|
|
c1d70d1fbb | ||
|
|
53a3f0be18 | ||
|
|
4add46d686 | ||
|
|
ccea7d8a30 | ||
|
|
4cf5afaefa | ||
|
|
6c2b06d535 | ||
|
|
1c6a8ecf2e | ||
|
|
6d1c387af2 | ||
|
|
1e6db5d24b |
@@ -64,7 +64,7 @@ jobs:
|
|||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: 1.21.9
|
go-version: 1.21.10
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ ARG BASE_VARIANT=alpine
|
|||||||
ARG ALPINE_VERSION=3.18
|
ARG ALPINE_VERSION=3.18
|
||||||
ARG BASE_DEBIAN_DISTRO=bookworm
|
ARG BASE_DEBIAN_DISTRO=bookworm
|
||||||
|
|
||||||
ARG GO_VERSION=1.21.9
|
ARG GO_VERSION=1.21.10
|
||||||
ARG XX_VERSION=1.4.0
|
ARG XX_VERSION=1.4.0
|
||||||
ARG GOVERSIONINFO_VERSION=v1.3.0
|
ARG GOVERSIONINFO_VERSION=v1.3.0
|
||||||
ARG GOTESTSUM_VERSION=v1.10.0
|
ARG GOTESTSUM_VERSION=v1.10.0
|
||||||
|
|||||||
@@ -240,8 +240,7 @@ func PluginRunCommand(dockerCli command.Cli, name string, rootcmd *cobra.Command
|
|||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
|
|
||||||
cmd.Env = os.Environ()
|
cmd.Env = append(cmd.Environ(), ReexecEnvvar+"="+os.Args[0])
|
||||||
cmd.Env = append(cmd.Env, ReexecEnvvar+"="+os.Args[0])
|
|
||||||
cmd.Env = appendPluginResourceAttributesEnvvar(cmd.Env, rootcmd, plugin)
|
cmd.Env = appendPluginResourceAttributesEnvvar(cmd.Env, rootcmd, plugin)
|
||||||
|
|
||||||
return cmd, nil
|
return cmd, nil
|
||||||
|
|||||||
@@ -186,7 +186,11 @@ func runContainer(ctx context.Context, dockerCli command.Cli, runOpts *runOption
|
|||||||
defer closeFn()
|
defer closeFn()
|
||||||
}
|
}
|
||||||
|
|
||||||
statusChan := waitExitOrRemoved(ctx, apiClient, containerID, copts.autoRemove)
|
// New context here because we don't to cancel waiting on container exit/remove
|
||||||
|
// when we cancel attach, etc.
|
||||||
|
statusCtx, cancelStatusCtx := context.WithCancel(context.WithoutCancel(ctx))
|
||||||
|
defer cancelStatusCtx()
|
||||||
|
statusChan := waitExitOrRemoved(statusCtx, apiClient, containerID, copts.autoRemove)
|
||||||
|
|
||||||
// start the container
|
// start the container
|
||||||
if err := apiClient.ContainerStart(ctx, containerID, container.StartOptions{}); err != nil {
|
if err := apiClient.ContainerStart(ctx, containerID, container.StartOptions{}); err != nil {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ func waitExitOrRemoved(ctx context.Context, apiClient client.APIClient, containe
|
|||||||
|
|
||||||
statusC := make(chan int)
|
statusC := make(chan int)
|
||||||
go func() {
|
go func() {
|
||||||
|
defer close(statusC)
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
variable "GO_VERSION" {
|
variable "GO_VERSION" {
|
||||||
default = "1.21.9"
|
default = "1.21.10"
|
||||||
}
|
}
|
||||||
variable "VERSION" {
|
variable "VERSION" {
|
||||||
default = ""
|
default = ""
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.21.9
|
ARG GO_VERSION=1.21.10
|
||||||
ARG ALPINE_VERSION=3.18
|
ARG ALPINE_VERSION=3.18
|
||||||
|
|
||||||
ARG BUILDX_VERSION=0.12.1
|
ARG BUILDX_VERSION=0.12.1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.21.9
|
ARG GO_VERSION=1.21.10
|
||||||
ARG ALPINE_VERSION=3.18
|
ARG ALPINE_VERSION=3.18
|
||||||
ARG GOLANGCI_LINT_VERSION=v1.55.2
|
ARG GOLANGCI_LINT_VERSION=v1.55.2
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.21.9
|
ARG GO_VERSION=1.21.10
|
||||||
ARG ALPINE_VERSION=3.18
|
ARG ALPINE_VERSION=3.18
|
||||||
ARG MODOUTDATED_VERSION=v0.8.0
|
ARG MODOUTDATED_VERSION=v0.8.0
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/docker/cli/e2e/internal/fixtures"
|
"github.com/docker/cli/e2e/internal/fixtures"
|
||||||
"github.com/docker/cli/internal/test/environment"
|
"github.com/docker/cli/internal/test/environment"
|
||||||
@@ -34,6 +35,22 @@ func TestRunAttachedFromRemoteImageAndRemove(t *testing.T) {
|
|||||||
golden.Assert(t, result.Stderr(), "run-attached-from-remote-and-remove.golden")
|
golden.Assert(t, result.Stderr(), "run-attached-from-remote-and-remove.golden")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Regression test for https://github.com/docker/cli/issues/5053
|
||||||
|
func TestRunInvalidEntrypointWithAutoremove(t *testing.T) {
|
||||||
|
environment.SkipIfDaemonNotLinux(t)
|
||||||
|
|
||||||
|
result := make(chan *icmd.Result)
|
||||||
|
go func() {
|
||||||
|
result <- icmd.RunCommand("docker", "run", "--rm", fixtures.AlpineImage, "invalidcommand")
|
||||||
|
}()
|
||||||
|
select {
|
||||||
|
case r := <-result:
|
||||||
|
r.Assert(t, icmd.Expected{ExitCode: 127})
|
||||||
|
case <-time.After(4 * time.Second):
|
||||||
|
t.Fatal("test took too long, shouldn't hang")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestRunWithContentTrust(t *testing.T) {
|
func TestRunWithContentTrust(t *testing.T) {
|
||||||
skip.If(t, environment.RemoteDaemon())
|
skip.If(t, environment.RemoteDaemon())
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.21.9
|
ARG GO_VERSION=1.21.10
|
||||||
|
|
||||||
FROM golang:${GO_VERSION}-alpine AS generated
|
FROM golang:${GO_VERSION}-alpine AS generated
|
||||||
ENV GOTOOLCHAIN=local
|
ENV GOTOOLCHAIN=local
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ require (
|
|||||||
github.com/creack/pty v1.1.21
|
github.com/creack/pty v1.1.21
|
||||||
github.com/distribution/reference v0.5.0
|
github.com/distribution/reference v0.5.0
|
||||||
github.com/docker/distribution v2.8.3+incompatible
|
github.com/docker/distribution v2.8.3+incompatible
|
||||||
github.com/docker/docker v26.0.1-0.20240422144514-c8af8ebe4a89+incompatible
|
github.com/docker/docker v26.1.2-0.20240508085902-ef1912d8b6ae+incompatible
|
||||||
github.com/docker/docker-credential-helpers v0.8.1
|
github.com/docker/docker-credential-helpers v0.8.1
|
||||||
github.com/docker/go-connections v0.5.0
|
github.com/docker/go-connections v0.5.0
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
|
|||||||
+2
-2
@@ -57,8 +57,8 @@ github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5
|
|||||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
||||||
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/docker v26.0.1-0.20240422144514-c8af8ebe4a89+incompatible h1:9eSHthT5Vvfh3aYy9xUaxMuecDicnMjfe7s9/qndRMw=
|
github.com/docker/docker v26.1.2-0.20240508085902-ef1912d8b6ae+incompatible h1:PcRQNw8eAMTjdnD7+y3IeJcsCKqxHmlT0MmqfNs9Jc4=
|
||||||
github.com/docker/docker v26.0.1-0.20240422144514-c8af8ebe4a89+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
github.com/docker/docker v26.1.2-0.20240508085902-ef1912d8b6ae+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||||
github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
|
github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo=
|
||||||
github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
|
github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
|
||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
||||||
|
|||||||
Vendored
+1
-1
@@ -56,7 +56,7 @@ github.com/docker/distribution/registry/client/transport
|
|||||||
github.com/docker/distribution/registry/storage/cache
|
github.com/docker/distribution/registry/storage/cache
|
||||||
github.com/docker/distribution/registry/storage/cache/memory
|
github.com/docker/distribution/registry/storage/cache/memory
|
||||||
github.com/docker/distribution/uuid
|
github.com/docker/distribution/uuid
|
||||||
# github.com/docker/docker v26.0.1-0.20240422144514-c8af8ebe4a89+incompatible
|
# github.com/docker/docker v26.1.2-0.20240508085902-ef1912d8b6ae+incompatible
|
||||||
## explicit
|
## explicit
|
||||||
github.com/docker/docker/api
|
github.com/docker/docker/api
|
||||||
github.com/docker/docker/api/types
|
github.com/docker/docker/api/types
|
||||||
|
|||||||
Reference in New Issue
Block a user