mirror of
https://github.com/docker/cli.git
synced 2026-11-12 15:53:52 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ced0996600 | ||
|
|
1ee40e2c74 | ||
|
|
40cc1d8eae | ||
|
|
3c2278afae | ||
|
|
3bd6d6902e | ||
|
|
05bf7fbcc8 | ||
|
|
c6d7c0bb21 | ||
|
|
dd08d44044 | ||
|
|
809975d8bd | ||
|
|
8b5023dd2e | ||
|
|
9edd9a1f2f | ||
|
|
e93cdb6ca5 | ||
|
|
2a6348d1b2 | ||
|
|
f4782b3250 | ||
|
|
a5024666e7 | ||
|
|
39b2a6cc6a | ||
|
|
7d06f6b2f7 | ||
|
|
1447974b83 | ||
|
|
46293e97f7 | ||
|
|
bfe2ff8208 | ||
|
|
380eb72940 | ||
|
|
b407429628 | ||
|
|
79c42c0b97 | ||
|
|
a96d0a526c | ||
|
|
5c5c50d717 | ||
|
|
4bf11b7562 | ||
|
|
224c7dbec4 | ||
|
|
e25d5c64c5 | ||
|
|
419e94df4a | ||
|
|
3713ee1eea | ||
|
|
2d5f041bde | ||
|
|
520e3600ee | ||
|
|
fad718c7ea | ||
|
|
cd68c8f003 | ||
|
|
05fabe63ba | ||
|
|
0a2dcdb446 | ||
|
|
a78fd6ca69 | ||
|
|
ddb9220abf | ||
|
|
9cd335d44b | ||
|
|
bcc889f6cf | ||
|
|
d61e4fe879 | ||
|
|
ee62dcd8dc | ||
|
|
b3750a8461 | ||
|
|
8e3a2942a5 | ||
|
|
c3ef1ceadf | ||
|
|
44eebb8bc1 | ||
|
|
7ecfa2e7fd | ||
|
|
751bb353fe | ||
|
|
f11f309090 | ||
|
|
3a6c11773d | ||
|
|
0823df7daa | ||
|
|
11af1189d7 | ||
|
|
f118c05e87 | ||
|
|
be0e76bf84 | ||
|
|
f66f7ed7ff | ||
|
|
ec621aae2d | ||
|
|
2814c01b09 | ||
|
|
4dc5ea0e80 | ||
|
|
32f66cbe51 | ||
|
|
cb74dfcd85 | ||
|
|
dc4707edb0 | ||
|
|
680212238b | ||
|
|
298e67926e | ||
|
|
aa40216965 | ||
|
|
9175ffa9b2 | ||
|
|
beb0330a72 | ||
|
|
405be90634 | ||
|
|
7a269817b5 | ||
|
|
41ef7c45cc | ||
|
|
199b872c98 | ||
|
|
661f70b52d | ||
|
|
c184a61dab | ||
|
|
e7a60449f7 | ||
|
|
77541afeab | ||
|
|
f4b354f688 | ||
|
|
e67a7acd06 | ||
|
|
98fdcd769b | ||
|
|
fb6ae356c7 | ||
|
|
1d7dd91593 | ||
|
|
de93c9b260 | ||
|
|
75f2669d56 | ||
|
|
46615e8724 | ||
|
|
cafdcf283e | ||
|
|
3768143c2e | ||
|
|
59e9fbd497 | ||
|
|
52ac1a974c | ||
|
|
f25ae85b8e | ||
|
|
58f37f630c |
@@ -63,7 +63,7 @@ jobs:
|
|||||||
name: Set up Go
|
name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: 1.20.4
|
go-version: 1.20.6
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+5
-5
@@ -1,12 +1,12 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG BASE_VARIANT=alpine
|
ARG BASE_VARIANT=alpine
|
||||||
ARG GO_VERSION=1.20.4
|
ARG GO_VERSION=1.20.6
|
||||||
ARG ALPINE_VERSION=3.16
|
ARG ALPINE_VERSION=3.17
|
||||||
ARG XX_VERSION=1.1.1
|
ARG XX_VERSION=1.2.1
|
||||||
ARG GOVERSIONINFO_VERSION=v1.3.0
|
ARG GOVERSIONINFO_VERSION=v1.3.0
|
||||||
ARG GOTESTSUM_VERSION=v1.8.2
|
ARG GOTESTSUM_VERSION=v1.10.0
|
||||||
ARG BUILDX_VERSION=0.10.4
|
ARG BUILDX_VERSION=0.11.2
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ type Metadata struct {
|
|||||||
// URL is a pointer to the plugin's homepage.
|
// URL is a pointer to the plugin's homepage.
|
||||||
URL string `json:",omitempty"`
|
URL string `json:",omitempty"`
|
||||||
// Experimental specifies whether the plugin is experimental.
|
// Experimental specifies whether the plugin is experimental.
|
||||||
|
//
|
||||||
// Deprecated: experimental features are now always enabled in the CLI
|
// Deprecated: experimental features are now always enabled in the CLI
|
||||||
Experimental bool `json:",omitempty"`
|
Experimental bool `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-9
@@ -8,7 +8,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -327,13 +326,8 @@ func (cli *DockerCli) getInitTimeout() time.Duration {
|
|||||||
|
|
||||||
func (cli *DockerCli) initializeFromClient() {
|
func (cli *DockerCli) initializeFromClient() {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
if !strings.HasPrefix(cli.dockerEndpoint.Host, "ssh://") {
|
ctx, cancel := context.WithTimeout(ctx, cli.getInitTimeout())
|
||||||
// @FIXME context.WithTimeout doesn't work with connhelper / ssh connections
|
defer cancel()
|
||||||
// time="2020-04-10T10:16:26Z" level=warning msg="commandConn.CloseWrite: commandconn: failed to wait: signal: killed"
|
|
||||||
var cancel func()
|
|
||||||
ctx, cancel = context.WithTimeout(ctx, cli.getInitTimeout())
|
|
||||||
defer cancel()
|
|
||||||
}
|
|
||||||
|
|
||||||
ping, err := cli.client.Ping(ctx)
|
ping, err := cli.client.Ping(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -381,7 +375,7 @@ func (cli *DockerCli) ContextStore() store.Store {
|
|||||||
// the "default" context is used if:
|
// the "default" context is used if:
|
||||||
//
|
//
|
||||||
// - The "--host" option is set
|
// - The "--host" option is set
|
||||||
// - The "DOCKER_HOST" ([DefaultContextName]) environment variable is set
|
// - The "DOCKER_HOST" ([client.EnvOverrideHost]) environment variable is set
|
||||||
// to a non-empty value.
|
// to a non-empty value.
|
||||||
//
|
//
|
||||||
// In these cases, the default context is used, which uses the host as
|
// In these cases, the default context is used, which uses the host as
|
||||||
|
|||||||
@@ -354,7 +354,10 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
|
|||||||
volumes := copts.volumes.GetMap()
|
volumes := copts.volumes.GetMap()
|
||||||
// add any bind targets to the list of container volumes
|
// add any bind targets to the list of container volumes
|
||||||
for bind := range copts.volumes.GetMap() {
|
for bind := range copts.volumes.GetMap() {
|
||||||
parsed, _ := loader.ParseVolume(bind)
|
parsed, err := loader.ParseVolume(bind)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
if parsed.Source != "" {
|
if parsed.Source != "" {
|
||||||
toBind := bind
|
toBind := bind
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/cli/cli/command"
|
"github.com/docker/cli/cli/command"
|
||||||
@@ -13,7 +14,6 @@ import (
|
|||||||
"github.com/docker/cli/cli/config/configfile"
|
"github.com/docker/cli/cli/config/configfile"
|
||||||
"github.com/docker/cli/cli/flags"
|
"github.com/docker/cli/cli/flags"
|
||||||
"github.com/docker/docker/errdefs"
|
"github.com/docker/docker/errdefs"
|
||||||
"github.com/docker/docker/pkg/homedir"
|
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
is "gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
@@ -57,7 +57,11 @@ func TestUseDefaultWithoutConfigFile(t *testing.T) {
|
|||||||
// the _default_ configuration file. If we specify a custom configuration
|
// the _default_ configuration file. If we specify a custom configuration
|
||||||
// file, the CLI produces an error if the file doesn't exist.
|
// file, the CLI produces an error if the file doesn't exist.
|
||||||
tmpHomeDir := t.TempDir()
|
tmpHomeDir := t.TempDir()
|
||||||
t.Setenv(homedir.Key(), tmpHomeDir)
|
if runtime.GOOS == "windows" {
|
||||||
|
t.Setenv("USERPROFILE", tmpHomeDir)
|
||||||
|
} else {
|
||||||
|
t.Setenv("HOME", tmpHomeDir)
|
||||||
|
}
|
||||||
configDir := filepath.Join(tmpHomeDir, ".docker")
|
configDir := filepath.Join(tmpHomeDir, ".docker")
|
||||||
configFilePath := filepath.Join(configDir, "config.json")
|
configFilePath := filepath.Join(configDir, "config.json")
|
||||||
|
|
||||||
|
|||||||
@@ -313,7 +313,12 @@ func prettyPrintServerInfo(streams command.Streams, info *info) []error {
|
|||||||
fprintln(output, " Docker Root Dir:", info.DockerRootDir)
|
fprintln(output, " Docker Root Dir:", info.DockerRootDir)
|
||||||
fprintln(output, " Debug Mode:", info.Debug)
|
fprintln(output, " Debug Mode:", info.Debug)
|
||||||
|
|
||||||
if info.Debug {
|
// The daemon collects this information regardless if "debug" is
|
||||||
|
// enabled. Print the debugging information if either the daemon,
|
||||||
|
// or the client has debug enabled. We should probably improve this
|
||||||
|
// logic and print any of these if set (but some special rules are
|
||||||
|
// needed for file-descriptors, which may use "-1".
|
||||||
|
if info.Debug || debug.IsEnabled() {
|
||||||
fprintln(output, " File Descriptors:", info.NFd)
|
fprintln(output, " File Descriptors:", info.NFd)
|
||||||
fprintln(output, " Goroutines:", info.NGoroutines)
|
fprintln(output, " Goroutines:", info.NGoroutines)
|
||||||
fprintln(output, " System Time:", info.SystemTime)
|
fprintln(output, " System Time:", info.SystemTime)
|
||||||
|
|||||||
@@ -223,3 +223,8 @@ func TestParseVolumeInvalidSections(t *testing.T) {
|
|||||||
_, err := ParseVolume("/foo::rw")
|
_, err := ParseVolume("/foo::rw")
|
||||||
assert.ErrorContains(t, err, "invalid spec")
|
assert.ErrorContains(t, err, "invalid spec")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestParseVolumeWithEmptySource(t *testing.T) {
|
||||||
|
_, err := ParseVolume(":/vol")
|
||||||
|
assert.ErrorContains(t, err, "empty section between colons")
|
||||||
|
}
|
||||||
|
|||||||
@@ -94,6 +94,9 @@ func (configFile *ConfigFile) ContainsAuth() bool {
|
|||||||
|
|
||||||
// GetAuthConfigs returns the mapping of repo to auth configuration
|
// GetAuthConfigs returns the mapping of repo to auth configuration
|
||||||
func (configFile *ConfigFile) GetAuthConfigs() map[string]types.AuthConfig {
|
func (configFile *ConfigFile) GetAuthConfigs() map[string]types.AuthConfig {
|
||||||
|
if configFile.AuthConfigs == nil {
|
||||||
|
configFile.AuthConfigs = make(map[string]types.AuthConfig)
|
||||||
|
}
|
||||||
return configFile.AuthConfigs
|
return configFile.AuthConfigs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ func (c *fileStore) GetAll() (map[string]types.AuthConfig, error) {
|
|||||||
|
|
||||||
// Store saves the given credentials in the file store.
|
// Store saves the given credentials in the file store.
|
||||||
func (c *fileStore) Store(authConfig types.AuthConfig) error {
|
func (c *fileStore) Store(authConfig types.AuthConfig) error {
|
||||||
c.file.GetAuthConfigs()[authConfig.ServerAddress] = authConfig
|
authConfigs := c.file.GetAuthConfigs()
|
||||||
|
authConfigs[authConfig.ServerAddress] = authConfig
|
||||||
return c.file.Save()
|
return c.file.Save()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
"sync/atomic"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -64,81 +65,68 @@ func New(_ context.Context, cmd string, args ...string) (net.Conn, error) {
|
|||||||
|
|
||||||
// commandConn implements net.Conn
|
// commandConn implements net.Conn
|
||||||
type commandConn struct {
|
type commandConn struct {
|
||||||
cmd *exec.Cmd
|
cmdMutex sync.Mutex // for cmd, cmdWaitErr
|
||||||
cmdExited bool
|
cmd *exec.Cmd
|
||||||
cmdWaitErr error
|
cmdWaitErr error
|
||||||
cmdMutex sync.Mutex
|
cmdExited atomic.Bool
|
||||||
stdin io.WriteCloser
|
stdin io.WriteCloser
|
||||||
stdout io.ReadCloser
|
stdout io.ReadCloser
|
||||||
stderrMu sync.Mutex
|
stderrMu sync.Mutex // for stderr
|
||||||
stderr bytes.Buffer
|
stderr bytes.Buffer
|
||||||
stdioClosedMu sync.Mutex // for stdinClosed and stdoutClosed
|
stdinClosed atomic.Bool
|
||||||
stdinClosed bool
|
stdoutClosed atomic.Bool
|
||||||
stdoutClosed bool
|
closing atomic.Bool
|
||||||
localAddr net.Addr
|
localAddr net.Addr
|
||||||
remoteAddr net.Addr
|
remoteAddr net.Addr
|
||||||
}
|
}
|
||||||
|
|
||||||
// killIfStdioClosed kills the cmd if both stdin and stdout are closed.
|
// kill terminates the process. On Windows it kills the process directly,
|
||||||
func (c *commandConn) killIfStdioClosed() error {
|
// whereas on other platforms, a SIGTERM is sent, before forcefully terminating
|
||||||
c.stdioClosedMu.Lock()
|
// the process after 3 seconds.
|
||||||
stdioClosed := c.stdoutClosed && c.stdinClosed
|
func (c *commandConn) kill() {
|
||||||
c.stdioClosedMu.Unlock()
|
if c.cmdExited.Load() {
|
||||||
if !stdioClosed {
|
return
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
return c.kill()
|
c.cmdMutex.Lock()
|
||||||
}
|
|
||||||
|
|
||||||
// killAndWait tries sending SIGTERM to the process before sending SIGKILL.
|
|
||||||
func killAndWait(cmd *exec.Cmd) error {
|
|
||||||
var werr error
|
var werr error
|
||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
werrCh := make(chan error)
|
werrCh := make(chan error)
|
||||||
go func() { werrCh <- cmd.Wait() }()
|
go func() { werrCh <- c.cmd.Wait() }()
|
||||||
cmd.Process.Signal(syscall.SIGTERM)
|
_ = c.cmd.Process.Signal(syscall.SIGTERM)
|
||||||
select {
|
select {
|
||||||
case werr = <-werrCh:
|
case werr = <-werrCh:
|
||||||
case <-time.After(3 * time.Second):
|
case <-time.After(3 * time.Second):
|
||||||
cmd.Process.Kill()
|
_ = c.cmd.Process.Kill()
|
||||||
werr = <-werrCh
|
werr = <-werrCh
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cmd.Process.Kill()
|
_ = c.cmd.Process.Kill()
|
||||||
werr = cmd.Wait()
|
werr = c.cmd.Wait()
|
||||||
}
|
|
||||||
return werr
|
|
||||||
}
|
|
||||||
|
|
||||||
// kill returns nil if the command terminated, regardless to the exit status.
|
|
||||||
func (c *commandConn) kill() error {
|
|
||||||
var werr error
|
|
||||||
c.cmdMutex.Lock()
|
|
||||||
if c.cmdExited {
|
|
||||||
werr = c.cmdWaitErr
|
|
||||||
} else {
|
|
||||||
werr = killAndWait(c.cmd)
|
|
||||||
c.cmdWaitErr = werr
|
|
||||||
c.cmdExited = true
|
|
||||||
}
|
}
|
||||||
|
c.cmdWaitErr = werr
|
||||||
c.cmdMutex.Unlock()
|
c.cmdMutex.Unlock()
|
||||||
if werr == nil {
|
c.cmdExited.Store(true)
|
||||||
return nil
|
|
||||||
}
|
|
||||||
wExitErr, ok := werr.(*exec.ExitError)
|
|
||||||
if ok {
|
|
||||||
if wExitErr.ProcessState.Exited() {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return errors.Wrapf(werr, "commandconn: failed to wait")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandConn) onEOF(eof error) error {
|
// handleEOF handles io.EOF errors while reading or writing from the underlying
|
||||||
// when we got EOF, the command is going to be terminated
|
// command pipes.
|
||||||
var werr error
|
//
|
||||||
|
// When we've received an EOF we expect that the command will
|
||||||
|
// be terminated soon. As such, we call Wait() on the command
|
||||||
|
// and return EOF or the error depending on whether the command
|
||||||
|
// exited with an error.
|
||||||
|
//
|
||||||
|
// If Wait() does not return within 10s, an error is returned
|
||||||
|
func (c *commandConn) handleEOF(err error) error {
|
||||||
|
if err != io.EOF {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
c.cmdMutex.Lock()
|
c.cmdMutex.Lock()
|
||||||
if c.cmdExited {
|
defer c.cmdMutex.Unlock()
|
||||||
|
|
||||||
|
var werr error
|
||||||
|
if c.cmdExited.Load() {
|
||||||
werr = c.cmdWaitErr
|
werr = c.cmdWaitErr
|
||||||
} else {
|
} else {
|
||||||
werrCh := make(chan error)
|
werrCh := make(chan error)
|
||||||
@@ -146,18 +134,17 @@ func (c *commandConn) onEOF(eof error) error {
|
|||||||
select {
|
select {
|
||||||
case werr = <-werrCh:
|
case werr = <-werrCh:
|
||||||
c.cmdWaitErr = werr
|
c.cmdWaitErr = werr
|
||||||
c.cmdExited = true
|
c.cmdExited.Store(true)
|
||||||
case <-time.After(10 * time.Second):
|
case <-time.After(10 * time.Second):
|
||||||
c.cmdMutex.Unlock()
|
|
||||||
c.stderrMu.Lock()
|
c.stderrMu.Lock()
|
||||||
stderr := c.stderr.String()
|
stderr := c.stderr.String()
|
||||||
c.stderrMu.Unlock()
|
c.stderrMu.Unlock()
|
||||||
return errors.Errorf("command %v did not exit after %v: stderr=%q", c.cmd.Args, eof, stderr)
|
return errors.Errorf("command %v did not exit after %v: stderr=%q", c.cmd.Args, err, stderr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.cmdMutex.Unlock()
|
|
||||||
if werr == nil {
|
if werr == nil {
|
||||||
return eof
|
return err
|
||||||
}
|
}
|
||||||
c.stderrMu.Lock()
|
c.stderrMu.Lock()
|
||||||
stderr := c.stderr.String()
|
stderr := c.stderr.String()
|
||||||
@@ -166,71 +153,86 @@ func (c *commandConn) onEOF(eof error) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ignorableCloseError(err error) bool {
|
func ignorableCloseError(err error) bool {
|
||||||
errS := err.Error()
|
return strings.Contains(err.Error(), os.ErrClosed.Error())
|
||||||
ss := []string{
|
|
||||||
os.ErrClosed.Error(),
|
|
||||||
}
|
|
||||||
for _, s := range ss {
|
|
||||||
if strings.Contains(errS, s) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *commandConn) CloseRead() error {
|
|
||||||
// NOTE: maybe already closed here
|
|
||||||
if err := c.stdout.Close(); err != nil && !ignorableCloseError(err) {
|
|
||||||
logrus.Warnf("commandConn.CloseRead: %v", err)
|
|
||||||
}
|
|
||||||
c.stdioClosedMu.Lock()
|
|
||||||
c.stdoutClosed = true
|
|
||||||
c.stdioClosedMu.Unlock()
|
|
||||||
if err := c.killIfStdioClosed(); err != nil {
|
|
||||||
logrus.Warnf("commandConn.CloseRead: %v", err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandConn) Read(p []byte) (int, error) {
|
func (c *commandConn) Read(p []byte) (int, error) {
|
||||||
n, err := c.stdout.Read(p)
|
n, err := c.stdout.Read(p)
|
||||||
if err == io.EOF {
|
// check after the call to Read, since
|
||||||
err = c.onEOF(err)
|
// it is blocking, and while waiting on it
|
||||||
|
// Close might get called
|
||||||
|
if c.closing.Load() {
|
||||||
|
// If we're currently closing the connection
|
||||||
|
// we don't want to call onEOF
|
||||||
|
return n, err
|
||||||
}
|
}
|
||||||
return n, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *commandConn) CloseWrite() error {
|
return n, c.handleEOF(err)
|
||||||
// NOTE: maybe already closed here
|
|
||||||
if err := c.stdin.Close(); err != nil && !ignorableCloseError(err) {
|
|
||||||
logrus.Warnf("commandConn.CloseWrite: %v", err)
|
|
||||||
}
|
|
||||||
c.stdioClosedMu.Lock()
|
|
||||||
c.stdinClosed = true
|
|
||||||
c.stdioClosedMu.Unlock()
|
|
||||||
if err := c.killIfStdioClosed(); err != nil {
|
|
||||||
logrus.Warnf("commandConn.CloseWrite: %v", err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandConn) Write(p []byte) (int, error) {
|
func (c *commandConn) Write(p []byte) (int, error) {
|
||||||
n, err := c.stdin.Write(p)
|
n, err := c.stdin.Write(p)
|
||||||
if err == io.EOF {
|
// check after the call to Write, since
|
||||||
err = c.onEOF(err)
|
// it is blocking, and while waiting on it
|
||||||
|
// Close might get called
|
||||||
|
if c.closing.Load() {
|
||||||
|
// If we're currently closing the connection
|
||||||
|
// we don't want to call onEOF
|
||||||
|
return n, err
|
||||||
}
|
}
|
||||||
return n, err
|
|
||||||
|
return n, c.handleEOF(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CloseRead allows commandConn to implement halfCloser
|
||||||
|
func (c *commandConn) CloseRead() error {
|
||||||
|
// NOTE: maybe already closed here
|
||||||
|
if err := c.stdout.Close(); err != nil && !ignorableCloseError(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
c.stdoutClosed.Store(true)
|
||||||
|
|
||||||
|
if c.stdinClosed.Load() {
|
||||||
|
c.kill()
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CloseWrite allows commandConn to implement halfCloser
|
||||||
|
func (c *commandConn) CloseWrite() error {
|
||||||
|
// NOTE: maybe already closed here
|
||||||
|
if err := c.stdin.Close(); err != nil && !ignorableCloseError(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
c.stdinClosed.Store(true)
|
||||||
|
|
||||||
|
if c.stdoutClosed.Load() {
|
||||||
|
c.kill()
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close is the net.Conn func that gets called
|
||||||
|
// by the transport when a dial is cancelled
|
||||||
|
// due to it's context timing out. Any blocked
|
||||||
|
// Read or Write calls will be unblocked and
|
||||||
|
// return errors. It will block until the underlying
|
||||||
|
// command has terminated.
|
||||||
func (c *commandConn) Close() error {
|
func (c *commandConn) Close() error {
|
||||||
var err error
|
c.closing.Store(true)
|
||||||
if err = c.CloseRead(); err != nil {
|
defer c.closing.Store(false)
|
||||||
|
|
||||||
|
if err := c.CloseRead(); err != nil {
|
||||||
logrus.Warnf("commandConn.Close: CloseRead: %v", err)
|
logrus.Warnf("commandConn.Close: CloseRead: %v", err)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
if err = c.CloseWrite(); err != nil {
|
if err := c.CloseWrite(); err != nil {
|
||||||
logrus.Warnf("commandConn.Close: CloseWrite: %v", err)
|
logrus.Warnf("commandConn.Close: CloseWrite: %v", err)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
return err
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *commandConn) LocalAddr() net.Addr {
|
func (c *commandConn) LocalAddr() net.Addr {
|
||||||
|
|||||||
@@ -6,8 +6,11 @@ package commandconn
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
|
"io/fs"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/docker/docker/pkg/process"
|
||||||
"gotest.tools/v3/assert"
|
"gotest.tools/v3/assert"
|
||||||
is "gotest.tools/v3/assert/cmp"
|
is "gotest.tools/v3/assert/cmp"
|
||||||
)
|
)
|
||||||
@@ -43,3 +46,170 @@ func TestEOFWithoutError(t *testing.T) {
|
|||||||
assert.Check(t, is.Equal(0, n))
|
assert.Check(t, is.Equal(0, n))
|
||||||
assert.Check(t, is.Equal(io.EOF, err))
|
assert.Check(t, is.Equal(io.EOF, err))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCloseRunningCommand(t *testing.T) {
|
||||||
|
cmd := "sh"
|
||||||
|
args := []string{"-c", "while true; sleep 1; done"}
|
||||||
|
|
||||||
|
done := make(chan struct{})
|
||||||
|
defer close(done)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
c, err := New(context.TODO(), cmd, args...)
|
||||||
|
assert.NilError(t, err)
|
||||||
|
cmdConn := c.(*commandConn)
|
||||||
|
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
|
||||||
|
n, err := c.Write([]byte("hello"))
|
||||||
|
assert.Check(t, is.Equal(len("hello"), n))
|
||||||
|
assert.NilError(t, err)
|
||||||
|
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
|
||||||
|
err = cmdConn.Close()
|
||||||
|
assert.NilError(t, err)
|
||||||
|
assert.Check(t, !process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
done <- struct{}{}
|
||||||
|
}()
|
||||||
|
|
||||||
|
select {
|
||||||
|
case <-time.After(5 * time.Second):
|
||||||
|
t.Error("test did not finish in time")
|
||||||
|
case <-done:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestCloseTwice(t *testing.T) {
|
||||||
|
cmd := "sh"
|
||||||
|
args := []string{"-c", "echo hello; sleep 1; exit 0"}
|
||||||
|
|
||||||
|
done := make(chan struct{})
|
||||||
|
go func() {
|
||||||
|
c, err := New(context.TODO(), cmd, args...)
|
||||||
|
assert.NilError(t, err)
|
||||||
|
cmdConn := c.(*commandConn)
|
||||||
|
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
|
||||||
|
b := make([]byte, 32)
|
||||||
|
n, err := c.Read(b)
|
||||||
|
assert.Check(t, is.Equal(len("hello\n"), n))
|
||||||
|
assert.NilError(t, err)
|
||||||
|
|
||||||
|
err = cmdConn.Close()
|
||||||
|
assert.NilError(t, err)
|
||||||
|
assert.Check(t, !process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
|
||||||
|
err = cmdConn.Close()
|
||||||
|
assert.NilError(t, err)
|
||||||
|
assert.Check(t, !process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
done <- struct{}{}
|
||||||
|
}()
|
||||||
|
|
||||||
|
select {
|
||||||
|
case <-time.After(10 * time.Second):
|
||||||
|
t.Error("test did not finish in time")
|
||||||
|
case <-done:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestEOFTimeout(t *testing.T) {
|
||||||
|
cmd := "sh"
|
||||||
|
args := []string{"-c", "sleep 20"}
|
||||||
|
|
||||||
|
done := make(chan struct{})
|
||||||
|
go func() {
|
||||||
|
c, err := New(context.TODO(), cmd, args...)
|
||||||
|
assert.NilError(t, err)
|
||||||
|
cmdConn := c.(*commandConn)
|
||||||
|
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
|
||||||
|
cmdConn.stdout = mockStdoutEOF{}
|
||||||
|
|
||||||
|
b := make([]byte, 32)
|
||||||
|
n, err := c.Read(b)
|
||||||
|
assert.Check(t, is.Equal(0, n))
|
||||||
|
assert.ErrorContains(t, err, "did not exit after EOF")
|
||||||
|
|
||||||
|
done <- struct{}{}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// after receiving an EOF, we try to kill the command
|
||||||
|
// if it doesn't exit after 10s, we throw an error
|
||||||
|
select {
|
||||||
|
case <-time.After(12 * time.Second):
|
||||||
|
t.Error("test did not finish in time")
|
||||||
|
case <-done:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type mockStdoutEOF struct{}
|
||||||
|
|
||||||
|
func (mockStdoutEOF) Read(_ []byte) (int, error) {
|
||||||
|
return 0, io.EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mockStdoutEOF) Close() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestCloseWhileWriting(t *testing.T) {
|
||||||
|
cmd := "sh"
|
||||||
|
args := []string{"-c", "while true; sleep 1; done"}
|
||||||
|
|
||||||
|
c, err := New(context.TODO(), cmd, args...)
|
||||||
|
assert.NilError(t, err)
|
||||||
|
cmdConn := c.(*commandConn)
|
||||||
|
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
|
||||||
|
writeErrC := make(chan error)
|
||||||
|
go func() {
|
||||||
|
for {
|
||||||
|
n, err := c.Write([]byte("hello"))
|
||||||
|
if err != nil {
|
||||||
|
writeErrC <- err
|
||||||
|
return
|
||||||
|
}
|
||||||
|
assert.Equal(t, n, len("hello"))
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
err = c.Close()
|
||||||
|
assert.NilError(t, err)
|
||||||
|
assert.Check(t, !process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
|
||||||
|
writeErr := <-writeErrC
|
||||||
|
assert.ErrorContains(t, writeErr, "file already closed")
|
||||||
|
assert.Check(t, is.ErrorIs(writeErr, fs.ErrClosed))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestCloseWhileReading(t *testing.T) {
|
||||||
|
cmd := "sh"
|
||||||
|
args := []string{"-c", "while true; sleep 1; done"}
|
||||||
|
|
||||||
|
c, err := New(context.TODO(), cmd, args...)
|
||||||
|
assert.NilError(t, err)
|
||||||
|
cmdConn := c.(*commandConn)
|
||||||
|
assert.Check(t, process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
|
||||||
|
readErrC := make(chan error)
|
||||||
|
go func() {
|
||||||
|
for {
|
||||||
|
b := make([]byte, 32)
|
||||||
|
n, err := c.Read(b)
|
||||||
|
if err != nil {
|
||||||
|
readErrC <- err
|
||||||
|
return
|
||||||
|
}
|
||||||
|
assert.Check(t, is.Equal(0, n))
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
err = cmdConn.Close()
|
||||||
|
assert.NilError(t, err)
|
||||||
|
assert.Check(t, !process.Alive(cmdConn.cmd.Process.Pid))
|
||||||
|
|
||||||
|
readErr := <-readErrC
|
||||||
|
assert.Check(t, is.ErrorIs(readErr, fs.ErrClosed))
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/cli/cli/connhelper/commandconn"
|
"github.com/docker/cli/cli/connhelper/commandconn"
|
||||||
"github.com/docker/cli/cli/connhelper/ssh"
|
"github.com/docker/cli/cli/connhelper/ssh"
|
||||||
@@ -51,6 +52,7 @@ func getConnectionHelper(daemonURL string, sshFlags []string) (*ConnectionHelper
|
|||||||
if sp.Path != "" {
|
if sp.Path != "" {
|
||||||
args = append(args, "--host", "unix://"+sp.Path)
|
args = append(args, "--host", "unix://"+sp.Path)
|
||||||
}
|
}
|
||||||
|
sshFlags = addSSHTimeout(sshFlags)
|
||||||
args = append(args, "system", "dial-stdio")
|
args = append(args, "system", "dial-stdio")
|
||||||
return commandconn.New(ctx, "ssh", append(sshFlags, sp.Args(args...)...)...)
|
return commandconn.New(ctx, "ssh", append(sshFlags, sp.Args(args...)...)...)
|
||||||
},
|
},
|
||||||
@@ -71,3 +73,10 @@ func GetCommandConnectionHelper(cmd string, flags ...string) (*ConnectionHelper,
|
|||||||
Host: "http://docker.example.com",
|
Host: "http://docker.example.com",
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func addSSHTimeout(sshFlags []string) []string {
|
||||||
|
if !strings.Contains(strings.Join(sshFlags, ""), "ConnectTimeout") {
|
||||||
|
sshFlags = append(sshFlags, "-o ConnectTimeout=30")
|
||||||
|
}
|
||||||
|
return sshFlags
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package connhelper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"gotest.tools/v3/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestSSHFlags(t *testing.T) {
|
||||||
|
testCases := []struct {
|
||||||
|
in []string
|
||||||
|
out []string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
in: []string{},
|
||||||
|
out: []string{"-o ConnectTimeout=30"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
in: []string{"option", "-o anotherOption"},
|
||||||
|
out: []string{"option", "-o anotherOption", "-o ConnectTimeout=30"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
in: []string{"-o ConnectTimeout=5", "anotherOption"},
|
||||||
|
out: []string{"-o ConnectTimeout=5", "anotherOption"},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range testCases {
|
||||||
|
assert.DeepEqual(t, addSSHTimeout(tc.in), tc.out)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -83,7 +83,7 @@ func (o *ClientOptions) InstallFlags(flags *pflag.FlagSet) {
|
|||||||
|
|
||||||
// opts.ValidateHost is not used here, so as to allow connection helpers
|
// opts.ValidateHost is not used here, so as to allow connection helpers
|
||||||
hostOpt := opts.NewNamedListOptsRef("hosts", &o.Hosts, nil)
|
hostOpt := opts.NewNamedListOptsRef("hosts", &o.Hosts, nil)
|
||||||
flags.VarP(hostOpt, "host", "H", "Daemon socket(s) to connect to")
|
flags.VarP(hostOpt, "host", "H", "Daemon socket to connect to")
|
||||||
flags.StringVarP(&o.Context, "context", "c", "",
|
flags.StringVarP(&o.Context, "context", "c", "",
|
||||||
`Name of the context to use to connect to the daemon (overrides `+client.EnvOverrideHost+` env var and default context set with "docker context use")`)
|
`Name of the context to use to connect to the daemon (overrides `+client.EnvOverrideHost+` env var and default context set with "docker context use")`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2649,7 +2649,7 @@ _docker_daemon() {
|
|||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
--storage-driver|-s)
|
--storage-driver|-s)
|
||||||
COMPREPLY=( $( compgen -W "aufs btrfs overlay2 vfs zfs" -- "$(echo "$cur" | tr '[:upper:]' '[:lower:]')" ) )
|
COMPREPLY=( $( compgen -W "btrfs overlay2 vfs zfs" -- "$(echo "$cur" | tr '[:upper:]' '[:lower:]')" ) )
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
--storage-opt)
|
--storage-opt)
|
||||||
|
|||||||
@@ -2777,7 +2777,7 @@ __docker_subcommand() {
|
|||||||
"($help)--raw-logs[Full timestamps without ANSI coloring]" \
|
"($help)--raw-logs[Full timestamps without ANSI coloring]" \
|
||||||
"($help)*--registry-mirror=[Preferred registry mirror]:registry mirror: " \
|
"($help)*--registry-mirror=[Preferred registry mirror]:registry mirror: " \
|
||||||
"($help)--seccomp-profile=[Path to seccomp profile]:path:_files -g \"*.json\"" \
|
"($help)--seccomp-profile=[Path to seccomp profile]:path:_files -g \"*.json\"" \
|
||||||
"($help -s --storage-driver)"{-s=,--storage-driver=}"[Storage driver to use]:driver:(aufs btrfs devicemapper overlay overlay2 vfs zfs)" \
|
"($help -s --storage-driver)"{-s=,--storage-driver=}"[Storage driver to use]:driver:(btrfs devicemapper overlay2 vfs zfs)" \
|
||||||
"($help)--selinux-enabled[Enable selinux support]" \
|
"($help)--selinux-enabled[Enable selinux support]" \
|
||||||
"($help)--shutdown-timeout=[Set the shutdown timeout value in seconds]:time: " \
|
"($help)--shutdown-timeout=[Set the shutdown timeout value in seconds]:time: " \
|
||||||
"($help)*--storage-opt=[Storage driver options]:storage driver options: " \
|
"($help)*--storage-opt=[Storage driver options]:storage driver options: " \
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
variable "GO_VERSION" {
|
variable "GO_VERSION" {
|
||||||
default = "1.20.4"
|
default = "1.20.6"
|
||||||
}
|
}
|
||||||
variable "VERSION" {
|
variable "VERSION" {
|
||||||
default = ""
|
default = ""
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG ALPINE_VERSION=3.16
|
ARG ALPINE_VERSION=3.17
|
||||||
|
|
||||||
FROM alpine:${ALPINE_VERSION} AS gen
|
FROM alpine:${ALPINE_VERSION} AS gen
|
||||||
RUN apk add --no-cache bash git
|
RUN apk add --no-cache bash git
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.20.4
|
ARG GO_VERSION=1.20.6
|
||||||
ARG ALPINE_VERSION=3.16
|
ARG ALPINE_VERSION=3.17
|
||||||
|
|
||||||
ARG BUILDX_VERSION=0.10.4
|
ARG BUILDX_VERSION=0.11.2
|
||||||
FROM docker/buildx-bin:${BUILDX_VERSION} AS buildx
|
FROM docker/buildx-bin:${BUILDX_VERSION} AS buildx
|
||||||
|
|
||||||
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golang
|
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golang
|
||||||
@@ -18,7 +18,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
|
|||||||
&& gofumpt --version
|
&& gofumpt --version
|
||||||
|
|
||||||
FROM golang AS gotestsum
|
FROM golang AS gotestsum
|
||||||
ARG GOTESTSUM_VERSION=v1.8.2
|
ARG GOTESTSUM_VERSION=v1.10.0
|
||||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
--mount=type=cache,target=/go/pkg/mod \
|
--mount=type=cache,target=/go/pkg/mod \
|
||||||
--mount=type=tmpfs,target=/go/src/ \
|
--mount=type=tmpfs,target=/go/src/ \
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.20.4
|
ARG GO_VERSION=1.20.6
|
||||||
ARG ALPINE_VERSION=3.16
|
ARG ALPINE_VERSION=3.17
|
||||||
ARG GOLANGCI_LINT_VERSION=v1.52.2
|
ARG GOLANGCI_LINT_VERSION=v1.52.2
|
||||||
|
|
||||||
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint
|
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.20.4
|
ARG GO_VERSION=1.20.6
|
||||||
ARG ALPINE_VERSION=3.16
|
ARG ALPINE_VERSION=3.17
|
||||||
ARG MODOUTDATED_VERSION=v0.8.0
|
ARG MODOUTDATED_VERSION=v0.8.0
|
||||||
|
|
||||||
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base
|
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base
|
||||||
@@ -9,7 +9,7 @@ RUN apk add --no-cache bash git rsync
|
|||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
FROM base AS vendored
|
FROM base AS vendored
|
||||||
ENV GOPROXY=direct
|
ENV GOPROXY=https://proxy.golang.org|direct
|
||||||
RUN --mount=target=/context \
|
RUN --mount=target=/context \
|
||||||
--mount=target=.,type=tmpfs \
|
--mount=target=.,type=tmpfs \
|
||||||
--mount=target=/go/pkg/mod,type=cache <<EOT
|
--mount=target=/go/pkg/mod,type=cache <<EOT
|
||||||
|
|||||||
+93
-129
@@ -48,68 +48,68 @@ The table below provides an overview of the current status of deprecated feature
|
|||||||
alternatives. In such cases, a warning may be printed, and users should not rely
|
alternatives. In such cases, a warning may be printed, and users should not rely
|
||||||
on this feature.
|
on this feature.
|
||||||
|
|
||||||
| Status | Feature | Deprecated | Remove |
|
| Status | Feature | Deprecated | Remove |
|
||||||
|------------|------------------------------------------------------------------------------------------------------------------------------------|------------|---------|
|
|------------|------------------------------------------------------------------------------------------------------------------------------------|------------|--------|
|
||||||
| Deprecated | [OOM-score adjust for the daemon](#oom-score-adjust-for-the-daemon) | v24.0.0 | v25.0.0 |
|
| Deprecated | [OOM-score adjust for the daemon](#oom-score-adjust-for-the-daemon) | v24.0 | v25.0 |
|
||||||
| Removed | [Buildkit build information](#buildkit-build-information) | v23.0.0 | v24.0.0 |
|
| Removed | [Buildkit build information](#buildkit-build-information) | v23.0 | v24.0 |
|
||||||
| Deprecated | [Legacy builder for Linux images](#legacy-builder-for-linux-images) | v23.0.0 | - |
|
| Deprecated | [Legacy builder for Linux images](#legacy-builder-for-linux-images) | v23.0 | - |
|
||||||
| Deprecated | [Legacy builder fallback](#legacy-builder-fallback) | v23.0.0 | - |
|
| Deprecated | [Legacy builder fallback](#legacy-builder-fallback) | v23.0 | - |
|
||||||
| Removed | [Btrfs storage driver on CentOS 7 and RHEL 7](#btrfs-storage-driver-on-centos-7-and-rhel-7) | v20.10 | v23.0.0 |
|
| Removed | [Btrfs storage driver on CentOS 7 and RHEL 7](#btrfs-storage-driver-on-centos-7-and-rhel-7) | v20.10 | v23.0 |
|
||||||
| Removed | [Support for encrypted TLS private keys](#support-for-encrypted-tls-private-keys) | v20.10 | v23.0.0 |
|
| Removed | [Support for encrypted TLS private keys](#support-for-encrypted-tls-private-keys) | v20.10 | v23.0 |
|
||||||
| Removed | [Kubernetes stack and context support](#kubernetes-stack-and-context-support) | v20.10 | v23.0.0 |
|
| Removed | [Kubernetes stack and context support](#kubernetes-stack-and-context-support) | v20.10 | v23.0 |
|
||||||
| Deprecated | [Pulling images from non-compliant image registries](#pulling-images-from-non-compliant-image-registries) | v20.10 | - |
|
| Deprecated | [Pulling images from non-compliant image registries](#pulling-images-from-non-compliant-image-registries) | v20.10 | - |
|
||||||
| Removed | [Linux containers on Windows (LCOW)](#linux-containers-on-windows-lcow-experimental) | v20.10 | v23.0.0 |
|
| Removed | [Linux containers on Windows (LCOW)](#linux-containers-on-windows-lcow-experimental) | v20.10 | v23.0 |
|
||||||
| Deprecated | [BLKIO weight options with cgroups v1](#blkio-weight-options-with-cgroups-v1) | v20.10 | - |
|
| Deprecated | [BLKIO weight options with cgroups v1](#blkio-weight-options-with-cgroups-v1) | v20.10 | - |
|
||||||
| Removed | [Kernel memory limit](#kernel-memory-limit) | v20.10 | v23.0.0 |
|
| Removed | [Kernel memory limit](#kernel-memory-limit) | v20.10 | v23.0 |
|
||||||
| Removed | [Classic Swarm and overlay networks using external key/value stores](#classic-swarm-and-overlay-networks-using-cluster-store) | v20.10 | v23.0.0 |
|
| Removed | [Classic Swarm and overlay networks using external key/value stores](#classic-swarm-and-overlay-networks-using-cluster-store) | v20.10 | v23.0 |
|
||||||
| Removed | [Support for the legacy `~/.dockercfg` configuration file for authentication](#support-for-legacy-dockercfg-configuration-files) | v20.10 | v23.0.0 |
|
| Removed | [Support for the legacy `~/.dockercfg` configuration file for authentication](#support-for-legacy-dockercfg-configuration-files) | v20.10 | v23.0 |
|
||||||
| Deprecated | [CLI plugins support](#cli-plugins-support) | v20.10 | - |
|
| Deprecated | [CLI plugins support](#cli-plugins-support) | v20.10 | - |
|
||||||
| Deprecated | [Dockerfile legacy `ENV name value` syntax](#dockerfile-legacy-env-name-value-syntax) | v20.10 | - |
|
| Deprecated | [Dockerfile legacy `ENV name value` syntax](#dockerfile-legacy-env-name-value-syntax) | v20.10 | - |
|
||||||
| Removed | [`docker build --stream` flag (experimental)](#docker-build---stream-flag-experimental) | v20.10 | v20.10 |
|
| Removed | [`docker build --stream` flag (experimental)](#docker-build---stream-flag-experimental) | v20.10 | v20.10 |
|
||||||
| Deprecated | [`fluentd-async-connect` log opt](#fluentd-async-connect-log-opt) | v20.10 | - |
|
| Deprecated | [`fluentd-async-connect` log opt](#fluentd-async-connect-log-opt) | v20.10 | - |
|
||||||
| Removed | [Configuration options for experimental CLI features](#configuration-options-for-experimental-cli-features) | v19.03 | v23.0.0 |
|
| Removed | [Configuration options for experimental CLI features](#configuration-options-for-experimental-cli-features) | v19.03 | v23.0 |
|
||||||
| Deprecated | [Pushing and pulling with image manifest v2 schema 1](#pushing-and-pulling-with-image-manifest-v2-schema-1) | v19.03 | v20.10 |
|
| Deprecated | [Pushing and pulling with image manifest v2 schema 1](#pushing-and-pulling-with-image-manifest-v2-schema-1) | v19.03 | v20.10 |
|
||||||
| Removed | [`docker engine` subcommands](#docker-engine-subcommands) | v19.03 | v20.10 |
|
| Removed | [`docker engine` subcommands](#docker-engine-subcommands) | v19.03 | v20.10 |
|
||||||
| Removed | [Top-level `docker deploy` subcommand (experimental)](#top-level-docker-deploy-subcommand-experimental) | v19.03 | v20.10 |
|
| Removed | [Top-level `docker deploy` subcommand (experimental)](#top-level-docker-deploy-subcommand-experimental) | v19.03 | v20.10 |
|
||||||
| Removed | [`docker stack deploy` using "dab" files (experimental)](#docker-stack-deploy-using-dab-files-experimental) | v19.03 | v20.10 |
|
| Removed | [`docker stack deploy` using "dab" files (experimental)](#docker-stack-deploy-using-dab-files-experimental) | v19.03 | v20.10 |
|
||||||
| Removed | [Support for the `overlay2.override_kernel_check` storage option](#support-for-the-overlay2override_kernel_check-storage-option) | v19.03 | v24.0.0 |
|
| Removed | [Support for the `overlay2.override_kernel_check` storage option](#support-for-the-overlay2override_kernel_check-storage-option) | v19.03 | v24.0 |
|
||||||
| Removed | [AuFS storage driver](#aufs-storage-driver) | v19.03 | v24.0.0 |
|
| Removed | [AuFS storage driver](#aufs-storage-driver) | v19.03 | v24.0 |
|
||||||
| Removed | [Legacy "overlay" storage driver](#legacy-overlay-storage-driver) | v18.09 | v24.0.0 |
|
| Removed | [Legacy "overlay" storage driver](#legacy-overlay-storage-driver) | v18.09 | v24.0 |
|
||||||
| Disabled | [Device mapper storage driver](#device-mapper-storage-driver) | v18.09 | - |
|
| Disabled | [Device mapper storage driver](#device-mapper-storage-driver) | v18.09 | - |
|
||||||
| Removed | [Use of reserved namespaces in engine labels](#use-of-reserved-namespaces-in-engine-labels) | v18.06 | v20.10 |
|
| Removed | [Use of reserved namespaces in engine labels](#use-of-reserved-namespaces-in-engine-labels) | v18.06 | v20.10 |
|
||||||
| Removed | [`--disable-legacy-registry` override daemon option](#--disable-legacy-registry-override-daemon-option) | v17.12 | v19.03 |
|
| Removed | [`--disable-legacy-registry` override daemon option](#--disable-legacy-registry-override-daemon-option) | v17.12 | v19.03 |
|
||||||
| Removed | [Interacting with V1 registries](#interacting-with-v1-registries) | v17.06 | v17.12 |
|
| Removed | [Interacting with V1 registries](#interacting-with-v1-registries) | v17.06 | v17.12 |
|
||||||
| Removed | [Asynchronous `service create` and `service update` as default](#asynchronous-service-create-and-service-update-as-default) | v17.05 | v17.10 |
|
| Removed | [Asynchronous `service create` and `service update` as default](#asynchronous-service-create-and-service-update-as-default) | v17.05 | v17.10 |
|
||||||
| Removed | [`-g` and `--graph` flags on `dockerd`](#-g-and---graph-flags-on-dockerd) | v17.05 | - |
|
| Removed | [`-g` and `--graph` flags on `dockerd`](#-g-and---graph-flags-on-dockerd) | v17.05 | - |
|
||||||
| Deprecated | [Top-level network properties in NetworkSettings](#top-level-network-properties-in-networksettings) | v1.13 | v17.12 |
|
| Deprecated | [Top-level network properties in NetworkSettings](#top-level-network-properties-in-networksettings) | v1.13 | v17.12 |
|
||||||
| Removed | [`filter` param for `/images/json` endpoint](#filter-param-for-imagesjson-endpoint) | v1.13 | v20.10 |
|
| Removed | [`filter` param for `/images/json` endpoint](#filter-param-for-imagesjson-endpoint) | v1.13 | v20.10 |
|
||||||
| Removed | [`repository:shortid` image references](#repositoryshortid-image-references) | v1.13 | v17.12 |
|
| Removed | [`repository:shortid` image references](#repositoryshortid-image-references) | v1.13 | v17.12 |
|
||||||
| Removed | [`docker daemon` subcommand](#docker-daemon-subcommand) | v1.13 | v17.12 |
|
| Removed | [`docker daemon` subcommand](#docker-daemon-subcommand) | v1.13 | v17.12 |
|
||||||
| Removed | [Duplicate keys with conflicting values in engine labels](#duplicate-keys-with-conflicting-values-in-engine-labels) | v1.13 | v17.12 |
|
| Removed | [Duplicate keys with conflicting values in engine labels](#duplicate-keys-with-conflicting-values-in-engine-labels) | v1.13 | v17.12 |
|
||||||
| Deprecated | [`MAINTAINER` in Dockerfile](#maintainer-in-dockerfile) | v1.13 | - |
|
| Deprecated | [`MAINTAINER` in Dockerfile](#maintainer-in-dockerfile) | v1.13 | - |
|
||||||
| Deprecated | [API calls without a version](#api-calls-without-a-version) | v1.13 | v17.12 |
|
| Deprecated | [API calls without a version](#api-calls-without-a-version) | v1.13 | v17.12 |
|
||||||
| Removed | [Backing filesystem without `d_type` support for overlay/overlay2](#backing-filesystem-without-d_type-support-for-overlayoverlay2) | v1.13 | v17.12 |
|
| Removed | [Backing filesystem without `d_type` support for overlay/overlay2](#backing-filesystem-without-d_type-support-for-overlayoverlay2) | v1.13 | v17.12 |
|
||||||
| Removed | [`--automated` and `--stars` flags on `docker search`](#--automated-and---stars-flags-on-docker-search) | v1.12 | v20.10 |
|
| Removed | [`--automated` and `--stars` flags on `docker search`](#--automated-and---stars-flags-on-docker-search) | v1.12 | v20.10 |
|
||||||
| Deprecated | [`-h` shorthand for `--help`](#-h-shorthand-for---help) | v1.12 | v17.09 |
|
| Deprecated | [`-h` shorthand for `--help`](#-h-shorthand-for---help) | v1.12 | v17.09 |
|
||||||
| Removed | [`-e` and `--email` flags on `docker login`](#-e-and---email-flags-on-docker-login) | v1.11 | v17.06 |
|
| Removed | [`-e` and `--email` flags on `docker login`](#-e-and---email-flags-on-docker-login) | v1.11 | v17.06 |
|
||||||
| Deprecated | [Separator (`:`) of `--security-opt` flag on `docker run`](#separator--of---security-opt-flag-on-docker-run) | v1.11 | v17.06 |
|
| Deprecated | [Separator (`:`) of `--security-opt` flag on `docker run`](#separator--of---security-opt-flag-on-docker-run) | v1.11 | v17.06 |
|
||||||
| Deprecated | [Ambiguous event fields in API](#ambiguous-event-fields-in-api) | v1.10 | - |
|
| Deprecated | [Ambiguous event fields in API](#ambiguous-event-fields-in-api) | v1.10 | - |
|
||||||
| Removed | [`-f` flag on `docker tag`](#-f-flag-on-docker-tag) | v1.10 | v1.12 |
|
| Removed | [`-f` flag on `docker tag`](#-f-flag-on-docker-tag) | v1.10 | v1.12 |
|
||||||
| Removed | [HostConfig at API container start](#hostconfig-at-api-container-start) | v1.10 | v1.12 |
|
| Removed | [HostConfig at API container start](#hostconfig-at-api-container-start) | v1.10 | v1.12 |
|
||||||
| Removed | [`--before` and `--since` flags on `docker ps`](#--before-and---since-flags-on-docker-ps) | v1.10 | v1.12 |
|
| Removed | [`--before` and `--since` flags on `docker ps`](#--before-and---since-flags-on-docker-ps) | v1.10 | v1.12 |
|
||||||
| Removed | [Driver-specific log tags](#driver-specific-log-tags) | v1.9 | v1.12 |
|
| Removed | [Driver-specific log tags](#driver-specific-log-tags) | v1.9 | v1.12 |
|
||||||
| Removed | [Docker Content Trust `ENV` passphrase variables name change](#docker-content-trust-env-passphrase-variables-name-change) | v1.9 | v1.12 |
|
| Removed | [Docker Content Trust `ENV` passphrase variables name change](#docker-content-trust-env-passphrase-variables-name-change) | v1.9 | v1.12 |
|
||||||
| Removed | [`/containers/(id or name)/copy` endpoint](#containersid-or-namecopy-endpoint) | v1.8 | v1.12 |
|
| Removed | [`/containers/(id or name)/copy` endpoint](#containersid-or-namecopy-endpoint) | v1.8 | v1.12 |
|
||||||
| Removed | [LXC built-in exec driver](#lxc-built-in-exec-driver) | v1.8 | v1.10 |
|
| Removed | [LXC built-in exec driver](#lxc-built-in-exec-driver) | v1.8 | v1.10 |
|
||||||
| Removed | [Old Command Line Options](#old-command-line-options) | v1.8 | v1.10 |
|
| Removed | [Old Command Line Options](#old-command-line-options) | v1.8 | v1.10 |
|
||||||
| Removed | [`--api-enable-cors` flag on `dockerd`](#--api-enable-cors-flag-on-dockerd) | v1.6 | v17.09 |
|
| Removed | [`--api-enable-cors` flag on `dockerd`](#--api-enable-cors-flag-on-dockerd) | v1.6 | v17.09 |
|
||||||
| Removed | [`--run` flag on `docker commit`](#--run-flag-on-docker-commit) | v0.10 | v1.13 |
|
| Removed | [`--run` flag on `docker commit`](#--run-flag-on-docker-commit) | v0.10 | v1.13 |
|
||||||
| Removed | [Three arguments form in `docker import`](#three-arguments-form-in-docker-import) | v0.6.7 | v1.12 |
|
| Removed | [Three arguments form in `docker import`](#three-arguments-form-in-docker-import) | v0.6.7 | v1.12 |
|
||||||
|
|
||||||
### OOM-score adjust for the daemon
|
### OOM-score adjust for the daemon
|
||||||
|
|
||||||
**Deprecated in Release: v24.0.0**
|
**Deprecated in Release: v24.0**
|
||||||
**Target For Removal In Release: v25.0.0**
|
**Target For Removal In Release: v25.0**
|
||||||
|
|
||||||
The `oom-score-adjust` option was added to prevent the daemon from being
|
The `oom-score-adjust` option was added to prevent the daemon from being
|
||||||
OOM-killed before other processes. This option was mostly added as a
|
OOM-killed before other processes. This option was mostly added as a
|
||||||
@@ -128,8 +128,8 @@ the daemon.
|
|||||||
|
|
||||||
### Buildkit build information
|
### Buildkit build information
|
||||||
|
|
||||||
**Deprecated in Release: v23.0.0**
|
**Deprecated in Release: v23.0**
|
||||||
**Removed in Release: v24.0.0**
|
**Removed in Release: v24.0**
|
||||||
|
|
||||||
[Build information](https://github.com/moby/buildkit/blob/v0.11/docs/buildinfo.md)
|
[Build information](https://github.com/moby/buildkit/blob/v0.11/docs/buildinfo.md)
|
||||||
structures have been introduced in [BuildKit v0.10.0](https://github.com/moby/buildkit/releases/tag/v0.10.0)
|
structures have been introduced in [BuildKit v0.10.0](https://github.com/moby/buildkit/releases/tag/v0.10.0)
|
||||||
@@ -140,9 +140,9 @@ information is also embedded into the image configuration if one is generated.
|
|||||||
|
|
||||||
### Legacy builder for Linux images
|
### Legacy builder for Linux images
|
||||||
|
|
||||||
**Deprecated in Release: v23.0.0**
|
**Deprecated in Release: v23.0**
|
||||||
|
|
||||||
Docker v23.0.0 now uses BuildKit by default to build Linux images, and uses the
|
Docker v23.0 now uses BuildKit by default to build Linux images, and uses the
|
||||||
[Buildx](https://docs.docker.com/buildx/working-with-buildx/) CLI component for
|
[Buildx](https://docs.docker.com/buildx/working-with-buildx/) CLI component for
|
||||||
`docker build`. With this change, `docker build` now exposes all advanced features
|
`docker build`. With this change, `docker build` now exposes all advanced features
|
||||||
that BuildKit provides and which were previously only available through the
|
that BuildKit provides and which were previously only available through the
|
||||||
@@ -171,14 +171,14 @@ you to report issues in the [BuildKit issue tracker on GitHub](https://github.co
|
|||||||
|
|
||||||
### Legacy builder fallback
|
### Legacy builder fallback
|
||||||
|
|
||||||
**Deprecated in Release: v23.0.0**
|
**Deprecated in Release: v23.0**
|
||||||
|
|
||||||
[Docker v23.0.0 now uses BuildKit by default to build Linux images](#legacy-builder-for-linux-images),
|
[Docker v23.0 now uses BuildKit by default to build Linux images](#legacy-builder-for-linux-images),
|
||||||
which requires the Buildx component to build images with BuildKit. There may be
|
which requires the Buildx component to build images with BuildKit. There may be
|
||||||
situations where the Buildx component is not available, and BuildKit cannot be
|
situations where the Buildx component is not available, and BuildKit cannot be
|
||||||
used.
|
used.
|
||||||
|
|
||||||
To provide a smooth transition to BuildKit as the default builder, Docker v23.0.0
|
To provide a smooth transition to BuildKit as the default builder, Docker v23.0
|
||||||
has an automatic fallback for some situations, or produces an error to assist
|
has an automatic fallback for some situations, or produces an error to assist
|
||||||
users to resolve the problem.
|
users to resolve the problem.
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ be possible in a future release.
|
|||||||
|
|
||||||
### Btrfs storage driver on CentOS 7 and RHEL 7
|
### Btrfs storage driver on CentOS 7 and RHEL 7
|
||||||
|
|
||||||
**Removed in Release: v23.0.0**
|
**Removed in Release: v23.0**
|
||||||
|
|
||||||
The `btrfs` storage driver on CentOS and RHEL was provided as a technology preview
|
The `btrfs` storage driver on CentOS and RHEL was provided as a technology preview
|
||||||
by CentOS and RHEL, but has been deprecated since the [Red Hat Enterprise Linux 7.4 release](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-btrfs),
|
by CentOS and RHEL, but has been deprecated since the [Red Hat Enterprise Linux 7.4 release](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-btrfs),
|
||||||
@@ -231,7 +231,7 @@ of Docker will no longer provide this driver.
|
|||||||
|
|
||||||
**Deprecated in Release: v20.10**
|
**Deprecated in Release: v20.10**
|
||||||
|
|
||||||
**Removed in Release: v23.0.0**
|
**Removed in Release: v23.0**
|
||||||
|
|
||||||
Use of encrypted TLS private keys has been deprecated, and has been removed.
|
Use of encrypted TLS private keys has been deprecated, and has been removed.
|
||||||
Golang has deprecated support for legacy PEM encryption (as specified in
|
Golang has deprecated support for legacy PEM encryption (as specified in
|
||||||
@@ -246,7 +246,7 @@ to decrypt the private key, and store it un-encrypted to continue using it.
|
|||||||
### Kubernetes stack and context support
|
### Kubernetes stack and context support
|
||||||
|
|
||||||
**Deprecated in Release: v20.10**
|
**Deprecated in Release: v20.10**
|
||||||
**Removed in Release: v23.0.0**
|
**Removed in Release: v23.0**
|
||||||
|
|
||||||
Following the deprecation of [Compose on Kubernetes](https://github.com/docker/compose-on-kubernetes),
|
Following the deprecation of [Compose on Kubernetes](https://github.com/docker/compose-on-kubernetes),
|
||||||
support for Kubernetes in the `stack` and `context` commands has been removed from
|
support for Kubernetes in the `stack` and `context` commands has been removed from
|
||||||
@@ -307,7 +307,7 @@ major release.
|
|||||||
### Linux containers on Windows (LCOW) (experimental)
|
### Linux containers on Windows (LCOW) (experimental)
|
||||||
|
|
||||||
**Deprecated in Release: v20.10**
|
**Deprecated in Release: v20.10**
|
||||||
**Removed in Release: v23.0.0**
|
**Removed in Release: v23.0**
|
||||||
|
|
||||||
The experimental feature to run Linux containers on Windows (LCOW) was introduced
|
The experimental feature to run Linux containers on Windows (LCOW) was introduced
|
||||||
as a technical preview in Docker 17.09. While many enhancements were made after
|
as a technical preview in Docker 17.09. While many enhancements were made after
|
||||||
@@ -330,7 +330,7 @@ When using cgroups v2, the `--blkio-weight` options are implemented using
|
|||||||
### Kernel memory limit
|
### Kernel memory limit
|
||||||
|
|
||||||
**Deprecated in Release: v20.10**
|
**Deprecated in Release: v20.10**
|
||||||
**Removed in Release: v23.0.0**
|
**Removed in Release: v23.0**
|
||||||
|
|
||||||
Specifying kernel memory limit (`docker run --kernel-memory`) is no longer supported
|
Specifying kernel memory limit (`docker run --kernel-memory`) is no longer supported
|
||||||
because the [Linux kernel deprecated `kmem.limit_in_bytes` in v5.4](https://github.com/torvalds/linux/commit/0158115f702b0ba208ab0b5adf44cae99b3ebcc7).
|
because the [Linux kernel deprecated `kmem.limit_in_bytes` in v5.4](https://github.com/torvalds/linux/commit/0158115f702b0ba208ab0b5adf44cae99b3ebcc7).
|
||||||
@@ -358,7 +358,7 @@ take no effect.
|
|||||||
### Classic Swarm and overlay networks using cluster store
|
### Classic Swarm and overlay networks using cluster store
|
||||||
|
|
||||||
**Deprecated in Release: v20.10**
|
**Deprecated in Release: v20.10**
|
||||||
**Removed in Release: v23.0.0**
|
**Removed in Release: v23.0**
|
||||||
|
|
||||||
Standalone ("classic") Swarm has been deprecated, and with that the use of overlay
|
Standalone ("classic") Swarm has been deprecated, and with that the use of overlay
|
||||||
networks using an external key/value store. The corresponding`--cluster-advertise`,
|
networks using an external key/value store. The corresponding`--cluster-advertise`,
|
||||||
@@ -367,7 +367,7 @@ networks using an external key/value store. The corresponding`--cluster-advertis
|
|||||||
### Support for legacy `~/.dockercfg` configuration files
|
### Support for legacy `~/.dockercfg` configuration files
|
||||||
|
|
||||||
**Deprecated in Release: v20.10**
|
**Deprecated in Release: v20.10**
|
||||||
**Removed in Release: v23.0.0**
|
**Removed in Release: v23.0**
|
||||||
|
|
||||||
The docker CLI up until v1.7.0 used the `~/.dockercfg` file to store credentials
|
The docker CLI up until v1.7.0 used the `~/.dockercfg` file to store credentials
|
||||||
after authenticating to a registry (`docker login`). Docker v1.7.0 replaced this
|
after authenticating to a registry (`docker login`). Docker v1.7.0 replaced this
|
||||||
@@ -387,13 +387,13 @@ notifying the user that the legacy file is present, but ignored.
|
|||||||
|
|
||||||
**Deprecated in Release: v19.03**
|
**Deprecated in Release: v19.03**
|
||||||
|
|
||||||
**Removed in Release: v23.0.0**
|
**Removed in Release: v23.0**
|
||||||
|
|
||||||
The `DOCKER_CLI_EXPERIMENTAL` environment variable and the corresponding `experimental`
|
The `DOCKER_CLI_EXPERIMENTAL` environment variable and the corresponding `experimental`
|
||||||
field in the CLI configuration file are deprecated. Experimental features are
|
field in the CLI configuration file are deprecated. Experimental features are
|
||||||
enabled by default, and these configuration options are no longer functional.
|
enabled by default, and these configuration options are no longer functional.
|
||||||
|
|
||||||
Starting with v23.0.0, the Docker CLI no longer prints `Experimental` for the client
|
Starting with v23.0, the Docker CLI no longer prints `Experimental` for the client
|
||||||
in the output of `docker version`, and the field has been removed from the JSON
|
in the output of `docker version`, and the field has been removed from the JSON
|
||||||
format.
|
format.
|
||||||
|
|
||||||
@@ -515,7 +515,7 @@ using compose files.
|
|||||||
### Support for the `overlay2.override_kernel_check` storage option
|
### Support for the `overlay2.override_kernel_check` storage option
|
||||||
|
|
||||||
**Deprecated in Release: v19.03**
|
**Deprecated in Release: v19.03**
|
||||||
**Removed in Release: v24.0.0**
|
**Removed in Release: v24.0**
|
||||||
|
|
||||||
This daemon configuration option disabled the Linux kernel version check used
|
This daemon configuration option disabled the Linux kernel version check used
|
||||||
to detect if the kernel supported OverlayFS with multiple lower dirs, which is
|
to detect if the kernel supported OverlayFS with multiple lower dirs, which is
|
||||||
@@ -526,14 +526,14 @@ option was no longer used.
|
|||||||
### AuFS storage driver
|
### AuFS storage driver
|
||||||
|
|
||||||
**Deprecated in Release: v19.03**
|
**Deprecated in Release: v19.03**
|
||||||
**Removed in Release: v24.0.0**
|
**Removed in Release: v24.0**
|
||||||
|
|
||||||
The `aufs` storage driver is deprecated in favor of `overlay2`, and will
|
The `aufs` storage driver is deprecated in favor of `overlay2`, and has been
|
||||||
be removed in a future release. Users of the `aufs` storage driver are
|
removed in a Docker Engine v24.0. Users of the `aufs` storage driver must
|
||||||
recommended to migrate to a different storage driver, such as `overlay2`, which
|
migrate to a different storage driver, such as `overlay2`, before upgrading
|
||||||
is now the default storage driver.
|
to Docker Engine v24.0.
|
||||||
|
|
||||||
The `aufs` storage driver facilitates running Docker on distros that have no
|
The `aufs` storage driver facilitated running Docker on distros that have no
|
||||||
support for OverlayFS, such as Ubuntu 14.04 LTS, which originally shipped with
|
support for OverlayFS, such as Ubuntu 14.04 LTS, which originally shipped with
|
||||||
a 3.14 kernel.
|
a 3.14 kernel.
|
||||||
|
|
||||||
@@ -542,62 +542,26 @@ is available to all supported distros (as they are either on kernel 4.x, or have
|
|||||||
support for multiple lowerdirs backported), there is no reason to continue
|
support for multiple lowerdirs backported), there is no reason to continue
|
||||||
maintenance of the `aufs` storage driver.
|
maintenance of the `aufs` storage driver.
|
||||||
|
|
||||||
#### Disabled by default in v23.0.0
|
|
||||||
|
|
||||||
Docker already prevented deprecated storage drivers from being automatically
|
|
||||||
selected on new installations, but continued to use these drivers when upgrading
|
|
||||||
existing installations. Starting with the v23.0.0 release, the Docker Engine will
|
|
||||||
fail to start if a deprecated storage driver is used (see [moby#43378](https://github.com/moby/moby/pull/43378):
|
|
||||||
|
|
||||||
```console
|
|
||||||
failed to start daemon: error initializing graphdriver: prior storage driver
|
|
||||||
aufs is deprecated and will be removed in a future release; update the the daemon
|
|
||||||
configuration and explicitly choose this storage driver to continue using it;
|
|
||||||
visit https://docs.docker.com/go/storage-driver/ for more information.
|
|
||||||
```
|
|
||||||
|
|
||||||
To continue using the storage driver, update the daemon configuration to use
|
|
||||||
explicitly use the given storage driver. Users are encouraged to migrate to
|
|
||||||
different storage driver.
|
|
||||||
|
|
||||||
### Legacy overlay storage driver
|
### Legacy overlay storage driver
|
||||||
|
|
||||||
**Deprecated in Release: v18.09**
|
**Deprecated in Release: v18.09**
|
||||||
**Removed in Release: v24.0.0**
|
**Removed in Release: v24.0**
|
||||||
|
|
||||||
The `overlay` storage driver is deprecated in favor of the `overlay2` storage
|
The `overlay` storage driver is deprecated in favor of the `overlay2` storage
|
||||||
driver, which has all the benefits of `overlay`, without its limitations (excessive
|
driver, which has all the benefits of `overlay`, without its limitations (excessive
|
||||||
inode consumption). The legacy `overlay` storage driver will be removed in a future
|
inode consumption). The legacy `overlay` storage driver has been removed in
|
||||||
release. Users of the `overlay` storage driver should migrate to the `overlay2`
|
Docker Engine v24.0. Users of the `overlay` storage driver should migrate to the
|
||||||
storage driver.
|
`overlay2` storage driver before upgrading to Docker Engine v24.0.
|
||||||
|
|
||||||
The legacy `overlay` storage driver allowed using overlayFS-backed filesystems
|
The legacy `overlay` storage driver allowed using overlayFS-backed filesystems
|
||||||
on pre 4.x kernels. Now that all supported distributions are able to run `overlay2`
|
on pre 4.x kernels. Now that all supported distributions are able to run `overlay2`
|
||||||
(as they are either on kernel 4.x, or have support for multiple lowerdirs
|
(as they are either on kernel 4.x, or have support for multiple lowerdirs
|
||||||
backported), there is no reason to keep maintaining the `overlay` storage driver.
|
backported), there is no reason to keep maintaining the `overlay` storage driver.
|
||||||
|
|
||||||
#### Disabled by default in v23.0.0
|
|
||||||
|
|
||||||
Docker already prevented deprecated storage drivers from being automatically
|
|
||||||
selected on new installations, but continued to use these drivers when upgrading
|
|
||||||
existing installations. Starting with the v23.0.0 release, the Docker Engine will
|
|
||||||
fail to start if a deprecated storage driver is used (see [moby#43378](https://github.com/moby/moby/pull/43378):
|
|
||||||
|
|
||||||
```console
|
|
||||||
failed to start daemon: error initializing graphdriver: prior storage driver
|
|
||||||
overlay is deprecated and will be removed in a future release; update the the daemon
|
|
||||||
configuration and explicitly choose this storage driver to continue using it;
|
|
||||||
visit https://docs.docker.com/go/storage-driver/ for more information.
|
|
||||||
```
|
|
||||||
|
|
||||||
To continue using the storage driver, update the daemon configuration to use
|
|
||||||
explicitly use the given storage driver. Users are encouraged to migrate to
|
|
||||||
different storage driver.
|
|
||||||
|
|
||||||
### Device mapper storage driver
|
### Device mapper storage driver
|
||||||
|
|
||||||
**Deprecated in Release: v18.09**
|
**Deprecated in Release: v18.09**
|
||||||
**Disabled by default in Release: v23.0.0**
|
**Disabled by default in Release: v23.0**
|
||||||
|
|
||||||
The `devicemapper` storage driver is deprecated in favor of `overlay2`, and will
|
The `devicemapper` storage driver is deprecated in favor of `overlay2`, and will
|
||||||
be removed in a future release. Users of the `devicemapper` storage driver are
|
be removed in a future release. Users of the `devicemapper` storage driver are
|
||||||
@@ -605,17 +569,17 @@ recommended to migrate to a different storage driver, such as `overlay2`, which
|
|||||||
is now the default storage driver.
|
is now the default storage driver.
|
||||||
|
|
||||||
The `devicemapper` storage driver facilitates running Docker on older (3.x) kernels
|
The `devicemapper` storage driver facilitates running Docker on older (3.x) kernels
|
||||||
that have no support for other storage drivers (such as overlay2, or AUFS).
|
that have no support for other storage drivers (such as overlay2, or btrfs).
|
||||||
|
|
||||||
Now that support for `overlay2` is added to all supported distros (as they are
|
Now that support for `overlay2` is added to all supported distros (as they are
|
||||||
either on kernel 4.x, or have support for multiple lowerdirs backported), there
|
either on kernel 4.x, or have support for multiple lowerdirs backported), there
|
||||||
is no reason to continue maintenance of the `devicemapper` storage driver.
|
is no reason to continue maintenance of the `devicemapper` storage driver.
|
||||||
|
|
||||||
#### Disabled by default in v23.0.0
|
#### Disabled by default in v23.0
|
||||||
|
|
||||||
Docker already prevented deprecated storage drivers from being automatically
|
Docker already prevented deprecated storage drivers from being automatically
|
||||||
selected on new installations, but continued to use these drivers when upgrading
|
selected on new installations, but continued to use these drivers when upgrading
|
||||||
existing installations. Starting with the v23.0.0 release, the Docker Engine will
|
existing installations. Starting with the v23.0 release, the Docker Engine will
|
||||||
fail to start if a deprecated storage driver is used (see [moby#43378](https://github.com/moby/moby/pull/43378):
|
fail to start if a deprecated storage driver is used (see [moby#43378](https://github.com/moby/moby/pull/43378):
|
||||||
|
|
||||||
```console
|
```console
|
||||||
@@ -691,12 +655,12 @@ and `docker service scale` in Docker 17.10.
|
|||||||
|
|
||||||
**Deprecated In Release: v17.05**
|
**Deprecated In Release: v17.05**
|
||||||
|
|
||||||
**Removed In Release: v23.0.0**
|
**Removed In Release: v23.0**
|
||||||
|
|
||||||
The `-g` or `--graph` flag for the `dockerd` or `docker daemon` command was
|
The `-g` or `--graph` flag for the `dockerd` or `docker daemon` command was
|
||||||
used to indicate the directory in which to store persistent data and resource
|
used to indicate the directory in which to store persistent data and resource
|
||||||
configuration and has been replaced with the more descriptive `--data-root`
|
configuration and has been replaced with the more descriptive `--data-root`
|
||||||
flag. These flags were deprecated and hidden in v17.05, and removed in v23.0.0.
|
flag. These flags were deprecated and hidden in v17.05, and removed in v23.0.
|
||||||
|
|
||||||
### Top-level network properties in NetworkSettings
|
### Top-level network properties in NetworkSettings
|
||||||
|
|
||||||
@@ -774,7 +738,7 @@ The overlay and overlay2 storage driver does not work as expected if the backing
|
|||||||
filesystem does not support `d_type`. For example, XFS does not support `d_type`
|
filesystem does not support `d_type`. For example, XFS does not support `d_type`
|
||||||
if it is formatted with the `ftype=0` option.
|
if it is formatted with the `ftype=0` option.
|
||||||
|
|
||||||
Support for these setups has been removed, and Docker v23.0.0 and up now fails to
|
Support for these setups has been removed, and Docker v23.0 and up now fails to
|
||||||
start when attempting to use the `overlay2` or `overlay` storage driver on a
|
start when attempting to use the `overlay2` or `overlay` storage driver on a
|
||||||
backing filesystem without `d_type` support.
|
backing filesystem without `d_type` support.
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ advisory: experimental
|
|||||||
|
|
||||||
Docker graph driver plugins enable admins to use an external/out-of-process
|
Docker graph driver plugins enable admins to use an external/out-of-process
|
||||||
graph driver for use with Docker engine. This is an alternative to using the
|
graph driver for use with Docker engine. This is an alternative to using the
|
||||||
built-in storage drivers, such as aufs/overlay/devicemapper/btrfs.
|
built-in storage drivers, such as overlay2.
|
||||||
|
|
||||||
You need to install and enable the plugin and then restart the Docker daemon
|
You need to install and enable the plugin and then restart the Docker daemon
|
||||||
before using the plugin. See the following example for the correct ordering
|
before using the plugin. See the following example for the correct ordering
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ Attach local standard input, output, and error streams to a running container
|
|||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|:----------------|:---------|:--------|:----------------------------------------------------|
|
|:--------------------------------|:---------|:--------|:----------------------------------------------------|
|
||||||
| `--detach-keys` | `string` | | Override the key sequence for detaching a container |
|
| [`--detach-keys`](#detach-keys) | `string` | | Override the key sequence for detaching a container |
|
||||||
| `--no-stdin` | | | Do not attach STDIN |
|
| `--no-stdin` | | | Do not attach STDIN |
|
||||||
| `--sig-proxy` | | | Proxy all received signals to the process |
|
| `--sig-proxy` | | | Proxy all received signals to the process |
|
||||||
|
|
||||||
|
|
||||||
<!---MARKER_GEN_END-->
|
<!---MARKER_GEN_END-->
|
||||||
@@ -56,30 +56,6 @@ performance critical applications that generate a lot of output in the
|
|||||||
foreground over a slow client connection. Instead, users should use the
|
foreground over a slow client connection. Instead, users should use the
|
||||||
`docker logs` command to get access to the logs.
|
`docker logs` command to get access to the logs.
|
||||||
|
|
||||||
### Override the detach sequence
|
|
||||||
|
|
||||||
If you want, you can configure an override the Docker key sequence for detach.
|
|
||||||
This is useful if the Docker default sequence conflicts with key sequence you
|
|
||||||
use for other applications. There are two ways to define your own detach key
|
|
||||||
sequence, as a per-container override or as a configuration property on your
|
|
||||||
entire configuration.
|
|
||||||
|
|
||||||
To override the sequence for an individual container, use the
|
|
||||||
`--detach-keys="<sequence>"` flag with the `docker attach` command. The format of
|
|
||||||
the `<sequence>` is either a letter [a-Z], or the `ctrl-` combined with any of
|
|
||||||
the following:
|
|
||||||
|
|
||||||
* `a-z` (a single lowercase alpha character )
|
|
||||||
* `@` (at sign)
|
|
||||||
* `[` (left bracket)
|
|
||||||
* `\\` (two backward slashes)
|
|
||||||
* `_` (underscore)
|
|
||||||
* `^` (caret)
|
|
||||||
|
|
||||||
These `a`, `ctrl-a`, `X`, or `ctrl-\\` values are all examples of valid key
|
|
||||||
sequences. To configure a different configuration default key sequence for all
|
|
||||||
containers, see [**Configuration file** section](cli.md#configuration-files).
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Attach to and detach from a running container
|
### Attach to and detach from a running container
|
||||||
@@ -168,3 +144,27 @@ $ docker ps -a --filter name=test
|
|||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||||
a2fe3fd886db alpine "/bin/sh" About a minute ago Exited (13) 40 seconds ago test
|
a2fe3fd886db alpine "/bin/sh" About a minute ago Exited (13) 40 seconds ago test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### <a name="detach-keys"></a> Override the detach sequence (--detach-keys)
|
||||||
|
|
||||||
|
Use the `--detach-keys` option to override the Docker key sequence for detach.
|
||||||
|
This is useful if the Docker default sequence conflicts with key sequence you
|
||||||
|
use for other applications. There are two ways to define your own detach key
|
||||||
|
sequence, as a per-container override or as a configuration property on your
|
||||||
|
entire configuration.
|
||||||
|
|
||||||
|
To override the sequence for an individual container, use the
|
||||||
|
`--detach-keys="<sequence>"` flag with the `docker attach` command. The format of
|
||||||
|
the `<sequence>` is either a letter [a-Z], or the `ctrl-` combined with any of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
* `a-z` (a single lowercase alpha character )
|
||||||
|
* `@` (at sign)
|
||||||
|
* `[` (left bracket)
|
||||||
|
* `\\` (two backward slashes)
|
||||||
|
* `_` (underscore)
|
||||||
|
* `^` (caret)
|
||||||
|
|
||||||
|
These `a`, `ctrl-a`, `X`, or `ctrl-\\` values are all examples of valid key
|
||||||
|
sequences. To configure a different configuration default key sequence for all
|
||||||
|
containers, see [**Configuration file** section](cli.md#configuration-files).
|
||||||
|
|||||||
@@ -92,18 +92,18 @@ The base command for the Docker CLI.
|
|||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|:--------------------|:---------|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|
|
|:---------------------------------|:---------|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `--config` | `string` | `/root/.docker` | Location of client config files |
|
| `--config` | `string` | `/root/.docker` | Location of client config files |
|
||||||
| `-c`, `--context` | `string` | | Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with `docker context use`) |
|
| `-c`, `--context` | `string` | | Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with `docker context use`) |
|
||||||
| `-D`, `--debug` | | | Enable debug mode |
|
| `-D`, `--debug` | | | Enable debug mode |
|
||||||
| `-H`, `--host` | `list` | | Daemon socket(s) to connect to |
|
| [`-H`](#host), [`--host`](#host) | `list` | | Daemon socket to connect to |
|
||||||
| `-l`, `--log-level` | `string` | `info` | Set the logging level (`debug`, `info`, `warn`, `error`, `fatal`) |
|
| `-l`, `--log-level` | `string` | `info` | Set the logging level (`debug`, `info`, `warn`, `error`, `fatal`) |
|
||||||
| `--tls` | | | Use TLS; implied by --tlsverify |
|
| `--tls` | | | Use TLS; implied by --tlsverify |
|
||||||
| `--tlscacert` | `string` | `/root/.docker/ca.pem` | Trust certs signed only by this CA |
|
| `--tlscacert` | `string` | `/root/.docker/ca.pem` | Trust certs signed only by this CA |
|
||||||
| `--tlscert` | `string` | `/root/.docker/cert.pem` | Path to TLS certificate file |
|
| `--tlscert` | `string` | `/root/.docker/cert.pem` | Path to TLS certificate file |
|
||||||
| `--tlskey` | `string` | `/root/.docker/key.pem` | Path to TLS key file |
|
| `--tlskey` | `string` | `/root/.docker/key.pem` | Path to TLS key file |
|
||||||
| `--tlsverify` | | | Use TLS and verify the remote |
|
| `--tlsverify` | | | Use TLS and verify the remote |
|
||||||
|
|
||||||
|
|
||||||
<!---MARKER_GEN_END-->
|
<!---MARKER_GEN_END-->
|
||||||
@@ -240,7 +240,7 @@ credential store. When this property is set, `docker login` will attempt to
|
|||||||
store credentials in the binary specified by `docker-credential-<value>` which
|
store credentials in the binary specified by `docker-credential-<value>` which
|
||||||
is visible on `$PATH`. If this property is not set, credentials will be stored
|
is visible on `$PATH`. If this property is not set, credentials will be stored
|
||||||
in the `auths` property of the config. For more information, see the
|
in the `auths` property of the config. For more information, see the
|
||||||
[**Credentials store** section in the `docker login` documentation](login.md#credentials-store)
|
[**Credential stores** section in the `docker login` documentation](login.md#credential-stores)
|
||||||
|
|
||||||
The property `credHelpers` specifies a set of credential helpers to use
|
The property `credHelpers` specifies a set of credential helpers to use
|
||||||
preferentially over `credsStore` or `auths` when storing and retrieving
|
preferentially over `credsStore` or `auths` when storing and retrieving
|
||||||
@@ -378,6 +378,56 @@ list of root Certificate Authorities.
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
### <a name="host"></a> Specify daemon host (-H, --host)
|
||||||
|
|
||||||
|
You can use the `-H`, `--host` flag to specify a socket to use when you invoke
|
||||||
|
a `docker` command. You can use the following protocols:
|
||||||
|
|
||||||
|
| Scheme | Description | Example |
|
||||||
|
|----------------------------------------|---------------------------|----------------------------------|
|
||||||
|
| `unix://[<path>]` | Unix socket (Linux only) | `unix:///var/run/docker.sock` |
|
||||||
|
| `tcp://[<IP or host>[:port]]` | TCP connection | `tcp://174.17.0.1:2376` |
|
||||||
|
| `ssh://[username@]<IP or host>[:port]` | SSH connection | `ssh://user@192.168.64.5` |
|
||||||
|
| `npipe://[<name>]` | Named pipe (Windows only) | `npipe:////./pipe/docker_engine` |
|
||||||
|
|
||||||
|
If you don't specify the `-H` flag, and you're not using a custom
|
||||||
|
[context](https://docs.docker.com/engine/context/working-with-contexts),
|
||||||
|
commands use the following default sockets:
|
||||||
|
|
||||||
|
- `unix:///var/run/docker.sock` on macOS and Linux
|
||||||
|
- `npipe:////./pipe/docker_engine` on Windows
|
||||||
|
|
||||||
|
To achieve a similar effect without having to specify the `-H` flag for every
|
||||||
|
command, you could also [create a context](context_create.md),
|
||||||
|
or alternatively, use the
|
||||||
|
[`DOCKER_HOST` environment variable](#environment-variables).
|
||||||
|
|
||||||
|
For more information about the `-H` flag, see
|
||||||
|
[Daemon socket option](dockerd.md#daemon-socket-option).
|
||||||
|
|
||||||
|
#### Using TCP sockets
|
||||||
|
|
||||||
|
The following example shows how to invoke `docker ps` over TCP, to a remote
|
||||||
|
daemon with IP address `174.17.0.1`, listening on port `2376`:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ docker -H tcp://174.17.0.1:2376 ps
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> By convention, the Docker daemon uses port `2376` for secure TLS connections,
|
||||||
|
> and port `2375` for insecure, non-TLS connections.
|
||||||
|
|
||||||
|
#### Using SSH sockets
|
||||||
|
|
||||||
|
When you use SSH invoke a command on a remote daemon, the request gets forwarded
|
||||||
|
to the `/var/run/docker.sock` Unix socket on the SSH host.
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ docker -H ssh://user@192.168.64.5 ps
|
||||||
|
```
|
||||||
|
|
||||||
### Display help text
|
### Display help text
|
||||||
|
|
||||||
To list the help on any command just execute the command, followed by the
|
To list the help on any command just execute the command, followed by the
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ $ docker -H tcp://127.0.0.1:2375 pull ubuntu
|
|||||||
### Daemon storage-driver
|
### Daemon storage-driver
|
||||||
|
|
||||||
On Linux, the Docker daemon has support for several different image layer storage
|
On Linux, the Docker daemon has support for several different image layer storage
|
||||||
drivers: `aufs`, `devicemapper`, `btrfs`, `zfs`, `overlay`, `overlay2`, and `fuse-overlayfs`.
|
drivers: `overlay2`, `fuse-overlayfs`, `btrfs`, `zfs`, and `devicemapper`.
|
||||||
|
|
||||||
`overlay2` is the preferred storage driver for all currently supported Linux distributions,
|
`overlay2` is the preferred storage driver for all currently supported Linux distributions,
|
||||||
and is selected by default. Unless users have a strong reason to prefer another storage driver,
|
and is selected by default. Unless users have a strong reason to prefer another storage driver,
|
||||||
@@ -828,36 +828,197 @@ Defaults to 20G.
|
|||||||
C:\> dockerd --storage-opt size=40G
|
C:\> dockerd --storage-opt size=40G
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker runtime execution options
|
### Runtime options
|
||||||
|
|
||||||
The Docker daemon relies on a
|
The Docker daemon relies on a
|
||||||
[OCI](https://github.com/opencontainers/runtime-spec) compliant runtime
|
[OCI](https://github.com/opencontainers/runtime-spec) compliant runtime
|
||||||
(invoked via the `containerd` daemon) as its interface to the Linux
|
(invoked via the `containerd` daemon) as its interface to the Linux
|
||||||
kernel `namespaces`, `cgroups`, and `SELinux`.
|
kernel `namespaces`, `cgroups`, and `SELinux`.
|
||||||
|
|
||||||
By default, the Docker daemon automatically starts `containerd`. If you want to
|
#### Configure container runtimes
|
||||||
control `containerd` startup, manually start `containerd` and pass the path to
|
|
||||||
the `containerd` socket using the `--containerd` flag. For example:
|
By default, the Docker daemon uses runc as a container runtime.
|
||||||
|
You can configure the daemon to add additional runtimes.
|
||||||
|
|
||||||
|
containerd shims installed on `PATH` can be used directly, without the need
|
||||||
|
to edit the daemon's configuration. For example, if you install the Kata
|
||||||
|
Containers shim (`containerd-shim-kata-v2`) on `PATH`, then you can select that
|
||||||
|
runtime with `docker run` without having to edit the daemon's configuration:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ sudo dockerd --containerd /var/run/dev/docker-containerd.sock
|
$ docker run --runtime io.containerd.kata.v2
|
||||||
```
|
```
|
||||||
|
|
||||||
Runtimes can be registered with the daemon either via the
|
Container runtimes that don't implement containerd shims, or containerd shims
|
||||||
configuration file or using the `--add-runtime` command line argument.
|
installed outside of `PATH`, must be registered with the daemon, either via the
|
||||||
|
configuration file or using the `--add-runtime` command line flag.
|
||||||
|
|
||||||
The following is an example adding 2 runtimes via the configuration:
|
For examples on how to use other container runtimes, see
|
||||||
|
[Alternative container runtimes](https://docs.docker.com/engine/alternative-runtimes/)
|
||||||
|
|
||||||
|
##### Configure runtimes using `daemon.json`
|
||||||
|
|
||||||
|
To register and configure container runtimes using the daemon's configuration
|
||||||
|
file, add the runtimes as entries under `runtimes`:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"default-runtime": "runc",
|
|
||||||
"runtimes": {
|
"runtimes": {
|
||||||
"custom": {
|
"<runtime>": {}
|
||||||
"path": "/usr/local/bin/my-runc-replacement",
|
}
|
||||||
"runtimeArgs": [
|
}
|
||||||
"--debug"
|
```
|
||||||
]
|
|
||||||
|
The key of the entry (`<runtime>` in the previous example) represents the name
|
||||||
|
of the runtime. This is the name that you reference when you run a container,
|
||||||
|
using `docker run --runtime <runtime>`.
|
||||||
|
|
||||||
|
The runtime entry contains an object specifying the configuration for your
|
||||||
|
runtime. The properties of the object depends on what kind of runtime you're
|
||||||
|
looking to register:
|
||||||
|
|
||||||
|
- If the runtime implements its own containerd shim, the object shall contain
|
||||||
|
a `runtimeType` field and an optional `options` field.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"runtimes": {
|
||||||
|
"<runtime>": {
|
||||||
|
"runtimeType": "<name-or-path>",
|
||||||
|
"options": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
See [Configure shims](#configure-containerd-shims).
|
||||||
|
|
||||||
|
- If the runtime is designed to be a drop-in replacement for runc,
|
||||||
|
the object contains a `path` field, and an optional `runtimeArgs` field.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"runtimes": {
|
||||||
|
"<runtime>": {
|
||||||
|
"path": "/path/to/bin",
|
||||||
|
"runtimeArgs": ["...args"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
See [Configure runc drop-in replacements](#configure-runc-drop-in-replacements).
|
||||||
|
|
||||||
|
After changing the runtimes configuration in the configuration file,
|
||||||
|
you must reload or restart the daemon for changes to take effect:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ sudo systemctl reload dockerd
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Configure containerd shims
|
||||||
|
|
||||||
|
If the runtime that you want to register implements a containerd shim,
|
||||||
|
or if you want to register a runtime which uses the runc shim,
|
||||||
|
use the following format for the runtime entry:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"runtimes": {
|
||||||
|
"<runtime>": {
|
||||||
|
"runtimeType": "<name-or-path>",
|
||||||
|
"options": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
`runtimeType` refers to either:
|
||||||
|
|
||||||
|
- A fully qualified name of a containerd shim.
|
||||||
|
|
||||||
|
The fully qualified name of a shim is the same as the `runtime_type` used to
|
||||||
|
register the runtime in containerd's CRI configuration.
|
||||||
|
For example, `io.containerd.runsc.v1`.
|
||||||
|
|
||||||
|
- The path of a containerd shim binary.
|
||||||
|
|
||||||
|
This option is useful if you installed the containerd shim binary outside of
|
||||||
|
`PATH`.
|
||||||
|
|
||||||
|
`options` is optional. It lets you specify the runtime configuration that you
|
||||||
|
want to use for the shim. The configuration parameters that you can specify in
|
||||||
|
`options` depends on the runtime you're registering. For most shims,
|
||||||
|
the supported configuration options are `TypeUrl` and `ConfigPath`.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"runtimes": {
|
||||||
|
"gvisor": {
|
||||||
|
"runtimeType": "io.containerd.runsc.v1",
|
||||||
|
"options": {
|
||||||
|
"TypeUrl": "io.containerd.runsc.v1.options",
|
||||||
|
"ConfigPath": "/etc/containerd/runsc.toml",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can configure multiple runtimes using the same runtimeType. For example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"runtimes": {
|
||||||
|
"gvisor-foo": {
|
||||||
|
"runtimeType": "io.containerd.runsc.v1",
|
||||||
|
"options": {
|
||||||
|
"TypeUrl": "io.containerd.runsc.v1.options",
|
||||||
|
"ConfigPath": "/etc/containerd/runsc-foo.toml"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
"gvisor-bar": {
|
||||||
|
"runtimeType": "io.containerd.runsc.v1",
|
||||||
|
"options": {
|
||||||
|
"TypeUrl": "io.containerd.runsc.v1.options",
|
||||||
|
"ConfigPath": "/etc/containerd/runsc-bar.toml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `options` field takes a special set of configuration parameters when used
|
||||||
|
with `"runtimeType": "io.containerd.runc.v2"`. For more information about runc
|
||||||
|
parameters, refer to the runc configuration section in
|
||||||
|
[CRI Plugin Config Guide](https://github.com/containerd/containerd/blob/v1.7.2/docs/cri/config.md#full-configuration).
|
||||||
|
|
||||||
|
##### Configure runc drop-in replacements
|
||||||
|
|
||||||
|
If the runtime that you want to register can act as a drop-in replacement for
|
||||||
|
runc, you can register the runtime either using the daemon configuration file,
|
||||||
|
or using the `--add-runtime` flag for the `dockerd` cli.
|
||||||
|
|
||||||
|
When you use the configuration file, the entry uses the following format:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"runtimes": {
|
||||||
|
"<runtime>": {
|
||||||
|
"path": "/path/to/binary",
|
||||||
|
"runtimeArgs": ["...args"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Where `path` is either the absolute path to the runtime executable, or the name
|
||||||
|
of an executable installed on `PATH`:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"runtimes": {
|
||||||
"runc": {
|
"runc": {
|
||||||
"path": "runc"
|
"path": "runc"
|
||||||
}
|
}
|
||||||
@@ -865,24 +1026,58 @@ The following is an example adding 2 runtimes via the configuration:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This is the same example via the command line:
|
And `runtimeArgs` lets you optionally pass additional arguments to the runtime.
|
||||||
|
Entries with this format use the containerd runc shim to invoke a custom
|
||||||
|
runtime binary.
|
||||||
|
|
||||||
|
When you use the `--add-runtime` CLI flag, use the following format:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ sudo dockerd --add-runtime runc=runc --add-runtime custom=/usr/local/bin/my-runc-replacement
|
$ sudo dockerd --add-runtime <runtime>=<path>
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**
|
Defining runtime arguments via the command line is not supported.
|
||||||
>
|
|
||||||
> Defining runtime arguments via the command line is not supported.
|
|
||||||
|
|
||||||
#### Options for the runtime
|
For an example configuration for a runc drop-in replacment, see
|
||||||
|
[Alternative container runtimes > youki](https://docs.docker.com/engine/alternative-runtimes/#youki)
|
||||||
|
|
||||||
You can configure the runtime using options specified
|
##### Configure the default container runtime
|
||||||
with the `--exec-opt` flag. All the flag's options have the `native` prefix. A
|
|
||||||
single `native.cgroupdriver` option is available.
|
|
||||||
|
|
||||||
The `native.cgroupdriver` option specifies the management of the container's
|
You can specify either the name of a fully qualified containerd runtime shim,
|
||||||
cgroups. You can only specify `cgroupfs` or `systemd`. If you specify
|
or the name of a registered runtime. You can specify the default runtime either
|
||||||
|
using the daemon configuration file, or using the `--default-runtime` flag for
|
||||||
|
the `dockerd` cli.
|
||||||
|
|
||||||
|
When you use the configuration file, the entry uses the following format:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"default-runtime": "io.containerd.runsc.v1"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
When you use the `--default-runtime` CLI flag, use the following format:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ dockerd --default-runtime io.containerd.runsc.v1
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Run containerd standalone
|
||||||
|
|
||||||
|
By default, the Docker daemon automatically starts `containerd`. If you want to
|
||||||
|
control `containerd` startup, manually start `containerd` and pass the path to
|
||||||
|
the `containerd` socket using the `--containerd` flag. For example:
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ sudo dockerd --containerd /run/containerd/containerd.sock
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Configure cgroup driver
|
||||||
|
|
||||||
|
You can configure how the runtime should manage container cgroups, using the
|
||||||
|
`--exec-opt native.cgroupdriver` CLI flag.
|
||||||
|
|
||||||
|
You can only specify `cgroupfs` or `systemd`. If you specify
|
||||||
`systemd` and it is not available, the system errors out. If you omit the
|
`systemd` and it is not available, the system errors out. If you omit the
|
||||||
`native.cgroupdriver` option,` cgroupfs` is used on cgroup v1 hosts, `systemd`
|
`native.cgroupdriver` option,` cgroupfs` is used on cgroup v1 hosts, `systemd`
|
||||||
is used on cgroup v2 hosts with systemd available.
|
is used on cgroup v2 hosts with systemd available.
|
||||||
@@ -895,16 +1090,19 @@ $ sudo dockerd --exec-opt native.cgroupdriver=systemd
|
|||||||
|
|
||||||
Setting this option applies to all containers the daemon launches.
|
Setting this option applies to all containers the daemon launches.
|
||||||
|
|
||||||
Also Windows Container makes use of `--exec-opt` for special purpose. Docker user
|
#### Configure container isolation technology (Windows)
|
||||||
can specify default container isolation technology with this, for example:
|
|
||||||
|
For Windows containers, you can specify the default container isolation
|
||||||
|
technology to use, using the `--exec-opt isolation` flag.
|
||||||
|
|
||||||
|
The following example makes `hyperv` the default isolation technology:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
> dockerd --exec-opt isolation=hyperv
|
> dockerd --exec-opt isolation=hyperv
|
||||||
```
|
```
|
||||||
|
|
||||||
Will make `hyperv` the default isolation technology on Windows. If no isolation
|
If no isolation value is specified on daemon start, on Windows client,
|
||||||
value is specified on daemon start, on Windows client, the default is
|
the default is `hyperv`, and on Windows server, the default is `process`.
|
||||||
`hyperv`, and on Windows server, the default is `process`.
|
|
||||||
|
|
||||||
### Daemon DNS options
|
### Daemon DNS options
|
||||||
|
|
||||||
@@ -1252,9 +1450,11 @@ This is a full example of the allowed configuration options on Linux:
|
|||||||
"fixed-cidr-v6": "",
|
"fixed-cidr-v6": "",
|
||||||
"group": "",
|
"group": "",
|
||||||
"hosts": [],
|
"hosts": [],
|
||||||
"http-proxy": "http://proxy.example.com:80",
|
"proxies": {
|
||||||
"https-proxy": "https://proxy.example.com:443",
|
"http-proxy": "http://proxy.example.com:80",
|
||||||
"no-proxy": "*.test.example.com,.example.org",
|
"https-proxy": "https://proxy.example.com:443",
|
||||||
|
"no-proxy": "*.test.example.com,.example.org",
|
||||||
|
},
|
||||||
"icc": false,
|
"icc": false,
|
||||||
"init": false,
|
"init": false,
|
||||||
"init-path": "/usr/libexec/docker-init",
|
"init-path": "/usr/libexec/docker-init",
|
||||||
|
|||||||
@@ -56,27 +56,28 @@ credentials. When you log in, the command stores credentials in
|
|||||||
`$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on
|
`$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on
|
||||||
Windows, via the procedure described below.
|
Windows, via the procedure described below.
|
||||||
|
|
||||||
### Credentials store
|
### Credential stores
|
||||||
|
|
||||||
The Docker Engine can keep user credentials in an external credentials store,
|
The Docker Engine can keep user credentials in an external credential store,
|
||||||
such as the native keychain of the operating system. Using an external store
|
such as the native keychain of the operating system. Using an external store
|
||||||
is more secure than storing credentials in the Docker configuration file.
|
is more secure than storing credentials in the Docker configuration file.
|
||||||
|
|
||||||
To use a credentials store, you need an external helper program to interact
|
To use a credential store, you need an external helper program to interact
|
||||||
with a specific keychain or external store. Docker requires the helper
|
with a specific keychain or external store. Docker requires the helper
|
||||||
program to be in the client's host `$PATH`.
|
program to be in the client's host `$PATH`.
|
||||||
|
|
||||||
This is the list of currently available credentials helpers and where
|
You can download the helpers from the `docker-credential-helpers`
|
||||||
you can download them from:
|
[releases page](https://github.com/docker/docker-credential-helpers/releases).
|
||||||
|
Helpers are available for the following credential stores:
|
||||||
|
|
||||||
- D-Bus Secret Service: https://github.com/docker/docker-credential-helpers/releases
|
- D-Bus Secret Service
|
||||||
- Apple macOS keychain: https://github.com/docker/docker-credential-helpers/releases
|
- Apple macOS keychain
|
||||||
- Microsoft Windows Credential Manager: https://github.com/docker/docker-credential-helpers/releases
|
- Microsoft Windows Credential Manager
|
||||||
- [pass](https://www.passwordstore.org/): https://github.com/docker/docker-credential-helpers/releases
|
- [pass](https://www.passwordstore.org/)
|
||||||
|
|
||||||
#### Configure the credentials store
|
#### Configure the credential store
|
||||||
|
|
||||||
You need to specify the credentials store in `$HOME/.docker/config.json`
|
You need to specify the credential store in `$HOME/.docker/config.json`
|
||||||
to tell the docker engine to use it. The value of the config property should be
|
to tell the docker engine to use it. The value of the config property should be
|
||||||
the suffix of the program to use (i.e. everything after `docker-credential-`).
|
the suffix of the program to use (i.e. everything after `docker-credential-`).
|
||||||
For example, to use `docker-credential-osxkeychain`:
|
For example, to use `docker-credential-osxkeychain`:
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ Running `docker ps --no-trunc` showing 2 linked containers.
|
|||||||
```console
|
```console
|
||||||
$ docker ps --no-trunc
|
$ docker ps --no-trunc
|
||||||
|
|
||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||||
4c01db0b339c ubuntu:22.04 bash 17 seconds ago Up 16 seconds 3300-3310/tcp webapp
|
ca5534a51dd04bbcebe9b23ba05f389466cf0c190f1f8f182d7eea92a9671d00 ubuntu:22.04 bash 17 seconds ago Up 16 seconds 3300-3310/tcp webapp
|
||||||
d7886598dbe2 crosbymichael/redis:latest /redis-server --dir 33 minutes ago Up 33 minutes 6379/tcp redis,webapp/db
|
9ca9747b233100676a48cc7806131586213fa5dab86dd1972d6a8732e3a84a4d crosbymichael/redis:latest /redis-server --dir 33 minutes ago Up 33 minutes 6379/tcp redis,webapp/db
|
||||||
```
|
```
|
||||||
|
|
||||||
### <a name="all"></a> Show both running and stopped containers (-a, --all)
|
### <a name="all"></a> Show both running and stopped containers (-a, --all)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Create and run a new container from an image
|
|||||||
| `--cpuset-cpus` | `string` | | CPUs in which to allow execution (0-3, 0,1) |
|
| `--cpuset-cpus` | `string` | | CPUs in which to allow execution (0-3, 0,1) |
|
||||||
| `--cpuset-mems` | `string` | | MEMs in which to allow execution (0-3, 0,1) |
|
| `--cpuset-mems` | `string` | | MEMs in which to allow execution (0-3, 0,1) |
|
||||||
| `-d`, `--detach` | | | Run container in background and print container ID |
|
| `-d`, `--detach` | | | Run container in background and print container ID |
|
||||||
| `--detach-keys` | `string` | | Override the key sequence for detaching a container |
|
| [`--detach-keys`](#detach-keys) | `string` | | Override the key sequence for detaching a container |
|
||||||
| [`--device`](#device) | `list` | | Add a host device to the container |
|
| [`--device`](#device) | `list` | | Add a host device to the container |
|
||||||
| [`--device-cgroup-rule`](#device-cgroup-rule) | `list` | | Add a rule to the cgroup allowed devices list |
|
| [`--device-cgroup-rule`](#device-cgroup-rule) | `list` | | Add a rule to the cgroup allowed devices list |
|
||||||
| `--device-read-bps` | `list` | | Limit read rate (bytes per second) from a device |
|
| `--device-read-bps` | `list` | | Limit read rate (bytes per second) from a device |
|
||||||
@@ -485,10 +485,12 @@ $ docker run -itd --network=my-net busybox
|
|||||||
```
|
```
|
||||||
|
|
||||||
You can also choose the IP addresses for the container with `--ip` and `--ip6`
|
You can also choose the IP addresses for the container with `--ip` and `--ip6`
|
||||||
flags when you start the container on a user-defined network.
|
flags when you start the container on a user-defined network. To assign a
|
||||||
|
static IP to containers, you must specify subnet block for the network.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker run -itd --network=my-net --ip=10.10.9.75 busybox
|
$ docker network create --subnet 192.0.2.0/24 my-net
|
||||||
|
$ docker run -itd --network=my-net --ip=192.0.2.69 busybox
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to add a running container to a network use the `docker network connect` subcommand.
|
If you want to add a running container to a network use the `docker network connect` subcommand.
|
||||||
@@ -569,6 +571,30 @@ retrieve the container's ID once the container has finished running.
|
|||||||
|
|
||||||
See also [the `docker cp` command](cp.md).
|
See also [the `docker cp` command](cp.md).
|
||||||
|
|
||||||
|
### <a name="detach-keys"></a> Override the detach sequence (--detach-keys)
|
||||||
|
|
||||||
|
Use the `--detach-keys` option to override the Docker key sequence for detach.
|
||||||
|
This is useful if the Docker default sequence conflicts with key sequence you
|
||||||
|
use for other applications. There are two ways to define your own detach key
|
||||||
|
sequence, as a per-container override or as a configuration property on your
|
||||||
|
entire configuration.
|
||||||
|
|
||||||
|
To override the sequence for an individual container, use the
|
||||||
|
`--detach-keys="<sequence>"` flag with the `docker attach` command. The format of
|
||||||
|
the `<sequence>` is either a letter [a-Z], or the `ctrl-` combined with any of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
* `a-z` (a single lowercase alpha character )
|
||||||
|
* `@` (at sign)
|
||||||
|
* `[` (left bracket)
|
||||||
|
* `\\` (two backward slashes)
|
||||||
|
* `_` (underscore)
|
||||||
|
* `^` (caret)
|
||||||
|
|
||||||
|
These `a`, `ctrl-a`, `X`, or `ctrl-\\` values are all examples of valid key
|
||||||
|
sequences. To configure a different configuration default key sequence for all
|
||||||
|
containers, see [**Configuration file** section](cli.md#configuration-files).
|
||||||
|
|
||||||
### <a name="device"></a> Add host device to container (--device)
|
### <a name="device"></a> Add host device to container (--device)
|
||||||
|
|
||||||
```console
|
```console
|
||||||
@@ -948,4 +974,4 @@ The `docker run` command is equivalent to the following API calls:
|
|||||||
- If that call returns a 404 (image not found), and depending on the `--pull` option ("always", "missing", "never") the call can trigger a `docker pull <image>`.
|
- If that call returns a 404 (image not found), and depending on the `--pull` option ("always", "missing", "never") the call can trigger a `docker pull <image>`.
|
||||||
- `/containers/create` again after pulling the image.
|
- `/containers/create` again after pulling the image.
|
||||||
- `/containers/(id)/start` to start the container.
|
- `/containers/(id)/start` to start the container.
|
||||||
- `/containers/(id)/attach` to attach to the container when starting with the `-it` flags for interactive containers.
|
- `/containers/(id)/attach` to attach to the container when starting with the `-it` flags for interactive containers.
|
||||||
|
|||||||
@@ -916,7 +916,7 @@ $ docker service create \
|
|||||||
The swarm extends my-network to each node running the service.
|
The swarm extends my-network to each node running the service.
|
||||||
|
|
||||||
Containers on the same network can access each other using
|
Containers on the same network can access each other using
|
||||||
[service discovery](https://docs.docker.com/network/overlay/#container-discovery).
|
[service discovery](https://docs.docker.com/network/drivers/overlay/#container-discovery).
|
||||||
|
|
||||||
Long form syntax of `--network` allows to specify list of aliases and driver options:
|
Long form syntax of `--network` allows to specify list of aliases and driver options:
|
||||||
`--network name=my-network,alias=web1,driver-opt=field1=value1`
|
`--network name=my-network,alias=web1,driver-opt=field1=value1`
|
||||||
|
|||||||
@@ -12,27 +12,45 @@ Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
|
|||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
An image name is made up of slash-separated name components, optionally prefixed
|
A full image name has the following format and components:
|
||||||
by a registry hostname. The hostname must comply with standard DNS rules, but
|
|
||||||
may not contain underscores. If a hostname is present, it may optionally be
|
|
||||||
followed by a port number in the format `:8080`. If not present, the command
|
|
||||||
uses Docker's public registry located at `registry-1.docker.io` by default. Name
|
|
||||||
components may contain lowercase letters, digits and separators. A separator
|
|
||||||
is defined as a period, one or two underscores, or one or more hyphens. A name
|
|
||||||
component may not start or end with a separator.
|
|
||||||
|
|
||||||
A tag name must be valid ASCII and may contain lowercase and uppercase letters,
|
`[HOST[:PORT_NUMBER]/]PATH`
|
||||||
digits, underscores, periods and hyphens. A tag name may not start with a
|
|
||||||
period or a hyphen and may contain a maximum of 128 characters.
|
|
||||||
|
|
||||||
You can group your images together using names and tags, and then upload them
|
- `HOST`: The optional registry hostname specifies where the image is located.
|
||||||
to [*Share images on Docker Hub*](https://docs.docker.com/get-started/part3/).
|
The hostname must comply with standard DNS rules, but may not contain
|
||||||
|
underscores. If the hostname is not specified, the command uses Docker's public
|
||||||
|
registry at `registry-1.docker.io` by default. Note that `docker.io` is the
|
||||||
|
canonical reference for Docker's public registry.
|
||||||
|
- `PORT_NUMBER`: If a hostname is present, it may optionally be followed by a
|
||||||
|
registry port number in the format `:8080`.
|
||||||
|
- `PATH`: The path consists consists of slash-separated components. Each
|
||||||
|
component may contain lowercase letters, digits and separators. A separator is
|
||||||
|
defined as a period, one or two underscores, or one or more hyphens. A component
|
||||||
|
may not start or end with a separator. While the
|
||||||
|
[OCI Distribution Specification](https://github.com/opencontainers/distribution-spec)
|
||||||
|
supports more than two slash-separated components, most registries only support
|
||||||
|
two slash-separated components. For Docker's public registry, the path format is
|
||||||
|
as follows:
|
||||||
|
- `[NAMESPACE/]REPOSITORY`: The first, optional component is typically a
|
||||||
|
user's or an organization's namespace. The second, mandatory component is the
|
||||||
|
repository name. When the namespace is not present, Docker uses `library`
|
||||||
|
as the default namespace.
|
||||||
|
|
||||||
|
After the image name, the optional `TAG` is a custom, human-readable manifest
|
||||||
|
identifier that is typically a specific version or variant of an image. The tag
|
||||||
|
must be valid ASCII and can contain lowercase and uppercase letters, digits,
|
||||||
|
underscores, periods, and hyphens. It cannot start with a period or hyphen and
|
||||||
|
must be no longer than 128 characters. If the tag is not specified, the command uses `latest` by default.
|
||||||
|
|
||||||
|
You can group your images together using names and tags, and then
|
||||||
|
[push](https://docs.docker.com/engine/reference/commandline/push) them to a
|
||||||
|
registry.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Tag an image referenced by ID
|
### Tag an image referenced by ID
|
||||||
|
|
||||||
To tag a local image with ID "0e5574283393" into the "fedora" repository with
|
To tag a local image with ID "0e5574283393" as "fedora/httpd" with the tag
|
||||||
"version1.0":
|
"version1.0":
|
||||||
|
|
||||||
```console
|
```console
|
||||||
@@ -41,8 +59,7 @@ $ docker tag 0e5574283393 fedora/httpd:version1.0
|
|||||||
|
|
||||||
### Tag an image referenced by Name
|
### Tag an image referenced by Name
|
||||||
|
|
||||||
To tag a local image with name "httpd" into the "fedora" repository with
|
To tag a local image "httpd" as "fedora/httpd" with the tag "version1.0":
|
||||||
"version1.0":
|
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker tag httpd fedora/httpd:version1.0
|
$ docker tag httpd fedora/httpd:version1.0
|
||||||
@@ -53,18 +70,18 @@ existing local version `httpd:latest`.
|
|||||||
|
|
||||||
### Tag an image referenced by Name and Tag
|
### Tag an image referenced by Name and Tag
|
||||||
|
|
||||||
To tag a local image with name "httpd" and tag "test" into the "fedora"
|
To tag a local image with the name "httpd" and the tag "test" as "fedora/httpd"
|
||||||
repository with "version1.0.test":
|
with the tag "version1.0.test":
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker tag httpd:test fedora/httpd:version1.0.test
|
$ docker tag httpd:test fedora/httpd:version1.0.test
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tag an image for a private repository
|
### Tag an image for a private registry
|
||||||
|
|
||||||
To push an image to a private registry and not the central Docker
|
To push an image to a private registry and not the public Docker registry you
|
||||||
registry you must tag it with the registry hostname and port (if needed).
|
must include the registry hostname and port (if needed).
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0
|
$ docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0
|
||||||
```
|
```
|
||||||
@@ -16,21 +16,10 @@ keywords: "glossary, docker, terms, definitions"
|
|||||||
|
|
||||||
A list of terms used around the Docker project.
|
A list of terms used around the Docker project.
|
||||||
|
|
||||||
## aufs
|
|
||||||
|
|
||||||
aufs (advanced multi layered unification filesystem) is a Linux [filesystem](#filesystem) that
|
|
||||||
Docker supports as a storage backend. It implements the
|
|
||||||
[union mount](https://en.wikipedia.org/wiki/Union_mount) for Linux file systems.
|
|
||||||
|
|
||||||
## base image
|
## base image
|
||||||
|
|
||||||
An image that has no parent is a **base image**.
|
An image that has no parent is a **base image**.
|
||||||
|
|
||||||
## boot2docker
|
|
||||||
|
|
||||||
[boot2docker](https://boot2docker.io/) is a lightweight Linux distribution made
|
|
||||||
specifically to run Docker containers. The boot2docker management tool for Mac and Windows was deprecated and replaced by [`docker-machine`](#machine) which you can install with the Docker Toolbox.
|
|
||||||
|
|
||||||
## bridge
|
## bridge
|
||||||
|
|
||||||
In terms of generic networking, a bridge is a Link Layer device which forwards
|
In terms of generic networking, a bridge is a Link Layer device which forwards
|
||||||
@@ -183,7 +172,7 @@ and assign them locations for efficient storage and retrieval.
|
|||||||
|
|
||||||
Examples :
|
Examples :
|
||||||
|
|
||||||
- Linux : ext4, aufs, btrfs, zfs
|
- Linux : ext4, btrfs, zfs
|
||||||
- Windows : NTFS
|
- Windows : NTFS
|
||||||
- macOS : HFS+
|
- macOS : HFS+
|
||||||
|
|
||||||
@@ -214,15 +203,6 @@ links provide a legacy interface to connect Docker containers running on the
|
|||||||
same host to each other without exposing the hosts' network ports. Use the
|
same host to each other without exposing the hosts' network ports. Use the
|
||||||
Docker networks feature instead.
|
Docker networks feature instead.
|
||||||
|
|
||||||
## Machine
|
|
||||||
|
|
||||||
[Machine](https://github.com/docker/machine) is a Docker tool which
|
|
||||||
makes it really easy to create Docker hosts on your computer, on
|
|
||||||
cloud providers and inside your own data center. It creates servers,
|
|
||||||
installs Docker on them, then configures the Docker client to talk to them.
|
|
||||||
|
|
||||||
*Also known as : docker-machine*
|
|
||||||
|
|
||||||
## node
|
## node
|
||||||
|
|
||||||
A [node](https://docs.docker.com/engine/swarm/how-swarm-mode-works/nodes/) is a physical or virtual
|
A [node](https://docs.docker.com/engine/swarm/how-swarm-mode-works/nodes/) is a physical or virtual
|
||||||
@@ -328,38 +308,18 @@ containers.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Toolbox
|
|
||||||
|
|
||||||
[Docker Toolbox](https://docs.docker.com/toolbox/overview/) is a legacy
|
|
||||||
installer for Mac and Windows users. It uses Oracle VirtualBox for
|
|
||||||
virtualization.
|
|
||||||
|
|
||||||
For Macs running OS X El Capitan 10.11 and newer macOS releases, [Docker for
|
|
||||||
Mac](https://docs.docker.com/docker-for-mac/) is the better solution.
|
|
||||||
|
|
||||||
For Windows 10 systems that support Microsoft Hyper-V (Professional, Enterprise
|
|
||||||
and Education), [Docker for
|
|
||||||
Windows](https://docs.docker.com/docker-for-windows/) is the better solution.
|
|
||||||
|
|
||||||
## Union file system
|
## Union file system
|
||||||
|
|
||||||
Union file systems implement a [union
|
Union file systems implement a [union mount](https://en.wikipedia.org/wiki/Union_mount) and operate by creating
|
||||||
mount](https://en.wikipedia.org/wiki/Union_mount) and operate by creating
|
|
||||||
layers. Docker uses union file systems in conjunction with
|
layers. Docker uses union file systems in conjunction with
|
||||||
[copy-on-write](#copy-on-write) techniques to provide the building blocks for
|
[copy-on-write](#copy-on-write) techniques to provide the building blocks for
|
||||||
containers, making them very lightweight and fast.
|
containers, making them very lightweight and fast.
|
||||||
|
|
||||||
For more on Docker and union file systems, see [Docker and AUFS in
|
For more on Docker and union file systems, see [OverlayFS storage driver](https://docs.docker.com/storage/storagedriver/overlayfs-driver/),
|
||||||
practice](https://docs.docker.com/engine/userguide/storagedriver/aufs-driver/),
|
and [Btrfs storage driver](https://docs.docker.com/storage/storagedriver/btrfs-driver/).
|
||||||
[Docker and Btrfs in
|
|
||||||
practice](https://docs.docker.com/engine/userguide/storagedriver/btrfs-driver/),
|
|
||||||
and [Docker and OverlayFS in
|
|
||||||
practice](https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/)
|
|
||||||
|
|
||||||
Example implementations of union file systems are
|
Example implementations of union file systems are
|
||||||
[UnionFS](https://en.wikipedia.org/wiki/UnionFS),
|
[UnionFS](https://en.wikipedia.org/wiki/UnionFS), and [Btrfs](https://btrfs.wiki.kernel.org/index.php/Main_Page).
|
||||||
[AUFS](https://en.wikipedia.org/wiki/Aufs), and
|
|
||||||
[Btrfs](https://btrfs.wiki.kernel.org/index.php/Main_Page).
|
|
||||||
|
|
||||||
## virtual machine
|
## virtual machine
|
||||||
|
|
||||||
|
|||||||
@@ -101,3 +101,19 @@ func TestTrustedCreateFromBadTrustServer(t *testing.T) {
|
|||||||
Err: "could not rotate trust to a new trusted root",
|
Err: "could not rotate trust to a new trusted root",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCreateWithEmptySourceVolume(t *testing.T) {
|
||||||
|
icmd.RunCmd(icmd.Command("docker", "create", "-v", ":/volume", fixtures.AlpineImage)).
|
||||||
|
Assert(t, icmd.Expected{
|
||||||
|
ExitCode: 125,
|
||||||
|
Err: "empty section between colons",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestCreateWithEmptyVolumeSpec(t *testing.T) {
|
||||||
|
icmd.RunCmd(icmd.Command("docker", "create", "-v", "", fixtures.AlpineImage)).
|
||||||
|
Assert(t, icmd.Expected{
|
||||||
|
ExitCode: 125,
|
||||||
|
Err: "invalid empty volume spec",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.20.4
|
ARG GO_VERSION=1.20.6
|
||||||
|
|
||||||
FROM golang:${GO_VERSION}-alpine AS generated
|
FROM golang:${GO_VERSION}-alpine AS generated
|
||||||
RUN go install github.com/dmcgowan/quicktls@master
|
RUN go install github.com/dmcgowan/quicktls@master
|
||||||
|
|||||||
+22
-21
@@ -13,9 +13,29 @@ file. See **config-json(5)** for documentation on using a configuration file.
|
|||||||
It is forbidden to redirect the standard input of a **docker attach** command while
|
It is forbidden to redirect the standard input of a **docker attach** command while
|
||||||
attaching to a TTY-enabled container (i.e., launched with `-i` and `-t`).
|
attaching to a TTY-enabled container (i.e., launched with `-i` and `-t`).
|
||||||
|
|
||||||
# Override the detach sequence
|
# EXAMPLES
|
||||||
|
|
||||||
If you want, you can configure an override the Docker key sequence for detach.
|
## Attaching to a container
|
||||||
|
|
||||||
|
In this example the top command is run inside a container from an ubuntu image,
|
||||||
|
in detached mode, then attaches to it, and then terminates the container
|
||||||
|
with `CTRL-c`:
|
||||||
|
|
||||||
|
$ docker run -d --name topdemo ubuntu:20.04 /usr/bin/top -b
|
||||||
|
$ docker attach topdemo
|
||||||
|
top - 00:07:01 up 4:54, 0 users, load average: 0.83, 0.91, 0.82
|
||||||
|
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
|
||||||
|
%Cpu(s): 2.3 us, 1.6 sy, 0.0 ni, 95.9 id, 0.0 wa, 0.1 hi, 0.1 si, 0.0 st
|
||||||
|
MiB Mem : 15846.2 total, 5729.2 free, 2592.5 used, 7524.4 buff/cache
|
||||||
|
MiB Swap: 16384.0 total, 16384.0 free, 0.0 used. 12097.3 avail Mem
|
||||||
|
|
||||||
|
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||||
|
1 root 20 0 5976 3256 2828 R 0.0 0.0 0:00.04 top
|
||||||
|
^C
|
||||||
|
|
||||||
|
## Override the detach sequence
|
||||||
|
|
||||||
|
Use the **--detach-keys** option to override the Docker key sequence for detach.
|
||||||
This is useful if the Docker default sequence conflicts with key sequence you
|
This is useful if the Docker default sequence conflicts with key sequence you
|
||||||
use for other applications. There are two ways to define your own detach key
|
use for other applications. There are two ways to define your own detach key
|
||||||
sequence, as a per-container override or as a configuration property on your
|
sequence, as a per-container override or as a configuration property on your
|
||||||
@@ -37,22 +57,3 @@ These **a**, **ctrl-a**, **X**, or **ctrl-\\** values are all examples of valid
|
|||||||
sequences. To configure a different configuration default key sequence for all
|
sequences. To configure a different configuration default key sequence for all
|
||||||
containers, see **docker(1)**.
|
containers, see **docker(1)**.
|
||||||
|
|
||||||
# EXAMPLES
|
|
||||||
|
|
||||||
## Attaching to a container
|
|
||||||
|
|
||||||
In this example the top command is run inside a container from an ubuntu image,
|
|
||||||
in detached mode, then attaches to it, and then terminates the container
|
|
||||||
with `CTRL-c`:
|
|
||||||
|
|
||||||
$ docker run -d --name topdemo ubuntu:20.04 /usr/bin/top -b
|
|
||||||
$ docker attach topdemo
|
|
||||||
top - 00:07:01 up 4:54, 0 users, load average: 0.83, 0.91, 0.82
|
|
||||||
Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie
|
|
||||||
%Cpu(s): 2.3 us, 1.6 sy, 0.0 ni, 95.9 id, 0.0 wa, 0.1 hi, 0.1 si, 0.0 st
|
|
||||||
MiB Mem : 15846.2 total, 5729.2 free, 2592.5 used, 7524.4 buff/cache
|
|
||||||
MiB Swap: 16384.0 total, 16384.0 free, 0.0 used. 12097.3 avail Mem
|
|
||||||
|
|
||||||
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
|
||||||
1 root 20 0 5976 3256 2828 R 0.0 0.0 0:00.04 top
|
|
||||||
^C
|
|
||||||
|
|||||||
+15
-14
@@ -80,7 +80,7 @@ To get information on a container use its ID or instance name:
|
|||||||
"LogPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47-json.log",
|
"LogPath": "/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47-json.log",
|
||||||
"Name": "/adoring_wozniak",
|
"Name": "/adoring_wozniak",
|
||||||
"RestartCount": 0,
|
"RestartCount": 0,
|
||||||
"Driver": "devicemapper",
|
"Driver": "overlay2",
|
||||||
"MountLabel": "",
|
"MountLabel": "",
|
||||||
"ProcessLabel": "",
|
"ProcessLabel": "",
|
||||||
"Mounts": [
|
"Mounts": [
|
||||||
@@ -89,7 +89,7 @@ To get information on a container use its ID or instance name:
|
|||||||
"Destination": "/data",
|
"Destination": "/data",
|
||||||
"Mode": "ro,Z",
|
"Mode": "ro,Z",
|
||||||
"RW": false
|
"RW": false
|
||||||
"Propagation": ""
|
"Propagation": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"AppArmorProfile": "",
|
"AppArmorProfile": "",
|
||||||
@@ -136,12 +136,13 @@ To get information on a container use its ID or instance name:
|
|||||||
"CgroupParent": ""
|
"CgroupParent": ""
|
||||||
},
|
},
|
||||||
"GraphDriver": {
|
"GraphDriver": {
|
||||||
"Name": "devicemapper",
|
|
||||||
"Data": {
|
"Data": {
|
||||||
"DeviceId": "5",
|
"LowerDir": "/var/lib/docker/overlay2/44b1d1f04db6b1b73a86f9a62678673bf5d16d9a6b62c13e859aa34a99cce5ea/diff:/var/lib/docker/overlay2/ef637181eb13e30e84b7382183364ed7fd7ff7be22d8bb87049e36b75fb89a86/diff:/var/lib/docker/overlay2/64fb0f850b1289cd09cbc3b077cab2c0f59a4f540c67f997b094fc3652b9b0d6/diff:/var/lib/docker/overlay2/68c4d1411addc2b2bd07e900ca3a059c9c5f9fa2607efd87d8d715a0080ed242/diff",
|
||||||
"DeviceName": "docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47",
|
"MergedDir": "/var/lib/docker/overlay2/c7846fe68c6f18247ab9b8672114dde9f506bc164081a895c465716eeb10f2bc/merged",
|
||||||
"DeviceSize": "171798691840"
|
"UpperDir": "/var/lib/docker/overlay2/c7846fe68c6f18247ab9b8672114dde9f506bc164081a895c465716eeb10f2bc/diff",
|
||||||
}
|
"WorkDir": "/var/lib/docker/overlay2/c7846fe68c6f18247ab9b8672114dde9f506bc164081a895c465716eeb10f2bc/work"
|
||||||
|
},
|
||||||
|
"Name": "overlay2"
|
||||||
},
|
},
|
||||||
"Config": {
|
"Config": {
|
||||||
"Hostname": "d2cc496561d6",
|
"Hostname": "d2cc496561d6",
|
||||||
@@ -275,12 +276,12 @@ about the image:
|
|||||||
"Size": 186507296,
|
"Size": 186507296,
|
||||||
"VirtualSize": 186507296,
|
"VirtualSize": 186507296,
|
||||||
"GraphDriver": {
|
"GraphDriver": {
|
||||||
"Name": "devicemapper",
|
|
||||||
"Data": {
|
"Data": {
|
||||||
"DeviceId": "3",
|
"LowerDir": "/var/lib/docker/overlay2/44b1d1f04db6b1b73a86f9a62678673bf5d16d9a6b62c13e859aa34a99cce5ea/diff:/var/lib/docker/overlay2/ef637181eb13e30e84b7382183364ed7fd7ff7be22d8bb87049e36b75fb89a86/diff:/var/lib/docker/overlay2/64fb0f850b1289cd09cbc3b077cab2c0f59a4f540c67f997b094fc3652b9b0d6/diff:/var/lib/docker/overlay2/68c4d1411addc2b2bd07e900ca3a059c9c5f9fa2607efd87d8d715a0080ed242/diff",
|
||||||
"DeviceName": "docker-253:1-2763198-ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4",
|
"MergedDir": "/var/lib/docker/overlay2/c7846fe68c6f18247ab9b8672114dde9f506bc164081a895c465716eeb10f2bc/merged",
|
||||||
"DeviceSize": "171798691840"
|
"UpperDir": "/var/lib/docker/overlay2/c7846fe68c6f18247ab9b8672114dde9f506bc164081a895c465716eeb10f2bc/diff",
|
||||||
}
|
"WorkDir": "/var/lib/docker/overlay2/c7846fe68c6f18247ab9b8672114dde9f506bc164081a895c465716eeb10f2bc/work"
|
||||||
|
},
|
||||||
|
"Name": "overlay2"
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
|
|||||||
+9
-9
@@ -9,8 +9,8 @@ go 1.18
|
|||||||
require (
|
require (
|
||||||
github.com/containerd/containerd v1.6.21
|
github.com/containerd/containerd v1.6.21
|
||||||
github.com/creack/pty v1.1.18
|
github.com/creack/pty v1.1.18
|
||||||
github.com/docker/distribution v2.8.1+incompatible
|
github.com/docker/distribution v2.8.2+incompatible
|
||||||
github.com/docker/docker v24.0.0-rc.1.0.20230505222407-8d9a40a82034+incompatible
|
github.com/docker/docker v24.0.5-0.20230718221249-d4a26c153000+incompatible // v24.0.5-dev
|
||||||
github.com/docker/docker-credential-helpers v0.7.0
|
github.com/docker/docker-credential-helpers v0.7.0
|
||||||
github.com/docker/go-connections v0.4.0
|
github.com/docker/go-connections v0.4.0
|
||||||
github.com/docker/go-units v0.5.0
|
github.com/docker/go-units v0.5.0
|
||||||
@@ -23,24 +23,24 @@ require (
|
|||||||
github.com/mitchellh/mapstructure v1.3.2
|
github.com/mitchellh/mapstructure v1.3.2
|
||||||
github.com/moby/buildkit v0.11.6
|
github.com/moby/buildkit v0.11.6
|
||||||
github.com/moby/patternmatcher v0.5.0
|
github.com/moby/patternmatcher v0.5.0
|
||||||
github.com/moby/swarmkit/v2 v2.0.0-20230406225228-75e92ce14ff7
|
github.com/moby/swarmkit/v2 v2.0.0-20230531205928-01bb7a41396b
|
||||||
github.com/moby/sys/sequential v0.5.0
|
github.com/moby/sys/sequential v0.5.0
|
||||||
github.com/moby/sys/signal v0.7.0
|
github.com/moby/sys/signal v0.7.0
|
||||||
github.com/moby/term v0.5.0
|
github.com/moby/term v0.5.0
|
||||||
github.com/morikuni/aec v1.0.0
|
github.com/morikuni/aec v1.0.0
|
||||||
github.com/opencontainers/go-digest v1.0.0
|
github.com/opencontainers/go-digest v1.0.0
|
||||||
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b
|
github.com/opencontainers/image-spec v1.1.0-rc3
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/sirupsen/logrus v1.9.0
|
github.com/sirupsen/logrus v1.9.3
|
||||||
github.com/spf13/cobra v1.7.0
|
github.com/spf13/cobra v1.7.0
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/theupdateframework/notary v0.7.1-0.20210315103452-bf96a202a09a
|
github.com/theupdateframework/notary v0.7.1-0.20210315103452-bf96a202a09a
|
||||||
github.com/tonistiigi/go-rosetta v0.0.0-20200727161949-f79598599c5d
|
github.com/tonistiigi/go-rosetta v0.0.0-20200727161949-f79598599c5d
|
||||||
github.com/xeipuuv/gojsonschema v1.2.0
|
github.com/xeipuuv/gojsonschema v1.2.0
|
||||||
golang.org/x/sync v0.1.0
|
golang.org/x/sync v0.1.0
|
||||||
golang.org/x/sys v0.6.0
|
golang.org/x/sys v0.8.0
|
||||||
golang.org/x/term v0.6.0
|
golang.org/x/term v0.8.0
|
||||||
golang.org/x/text v0.8.0
|
golang.org/x/text v0.9.0
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
gotest.tools/v3 v3.4.0
|
gotest.tools/v3 v3.4.0
|
||||||
)
|
)
|
||||||
@@ -71,7 +71,7 @@ require (
|
|||||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||||
go.etcd.io/etcd/raft/v3 v3.5.6 // indirect
|
go.etcd.io/etcd/raft/v3 v3.5.6 // indirect
|
||||||
golang.org/x/crypto v0.2.0 // indirect
|
golang.org/x/crypto v0.2.0 // indirect
|
||||||
golang.org/x/net v0.8.0 // indirect
|
golang.org/x/net v0.10.0 // indirect
|
||||||
golang.org/x/time v0.3.0 // indirect
|
golang.org/x/time v0.3.0 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20220706185917-7780775163c4 // indirect
|
google.golang.org/genproto v0.0.0-20220706185917-7780775163c4 // indirect
|
||||||
google.golang.org/grpc v1.50.1 // indirect
|
google.golang.org/grpc v1.50.1 // indirect
|
||||||
|
|||||||
+18
-18
@@ -94,10 +94,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
|||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
||||||
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.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
|
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
|
||||||
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||||
github.com/docker/docker v24.0.0-rc.1.0.20230505222407-8d9a40a82034+incompatible h1:Y2oMmZDlVZhIkKzBUCeY48pi8ophHyEAoW04ABKn3DU=
|
github.com/docker/docker v24.0.5-0.20230718221249-d4a26c153000+incompatible h1:LkM7hKYoTf+ESj5ZuqRlI8NFxcKp2UprZ/IeL9Dses8=
|
||||||
github.com/docker/docker v24.0.0-rc.1.0.20230505222407-8d9a40a82034+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
github.com/docker/docker v24.0.5-0.20230718221249-d4a26c153000+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||||
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
|
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
|
||||||
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
|
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
|
||||||
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=
|
||||||
@@ -273,8 +273,8 @@ github.com/moby/buildkit v0.11.6 h1:VYNdoKk5TVxN7k4RvZgdeM4GOyRvIi4Z8MXOY7xvyUs=
|
|||||||
github.com/moby/buildkit v0.11.6/go.mod h1:GCqKfHhz+pddzfgaR7WmHVEE3nKKZMMDPpK8mh3ZLv4=
|
github.com/moby/buildkit v0.11.6/go.mod h1:GCqKfHhz+pddzfgaR7WmHVEE3nKKZMMDPpK8mh3ZLv4=
|
||||||
github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo=
|
github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo=
|
||||||
github.com/moby/patternmatcher v0.5.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
|
github.com/moby/patternmatcher v0.5.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
|
||||||
github.com/moby/swarmkit/v2 v2.0.0-20230406225228-75e92ce14ff7 h1:h6NclNly6/B9N4IdM5pcBaq/LkNLuaCmE7B44Vj+pb0=
|
github.com/moby/swarmkit/v2 v2.0.0-20230531205928-01bb7a41396b h1:w07xyBXYTrihwBqCkuXPLqcQ1a2guqXlRIocU+e9K7A=
|
||||||
github.com/moby/swarmkit/v2 v2.0.0-20230406225228-75e92ce14ff7/go.mod h1:P/ha3F7UZMmuUvqrHw9cZK/BjktSngQIgRPiairNHTc=
|
github.com/moby/swarmkit/v2 v2.0.0-20230531205928-01bb7a41396b/go.mod h1:Z5i5At5g0zU+ZBWb/95yVwDeNQX8BZmei9ZoYvoVD7g=
|
||||||
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
|
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
|
||||||
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
|
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
|
||||||
github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI=
|
github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI=
|
||||||
@@ -301,8 +301,8 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT
|
|||||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||||
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
||||||
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8=
|
github.com/opencontainers/image-spec v1.1.0-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8=
|
||||||
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ=
|
github.com/opencontainers/image-spec v1.1.0-rc3/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
|
||||||
github.com/opencontainers/runc v1.1.7 h1:y2EZDS8sNng4Ksf0GUYNhKbTShZJPJg1FiXJNH/uoCk=
|
github.com/opencontainers/runc v1.1.7 h1:y2EZDS8sNng4Ksf0GUYNhKbTShZJPJg1FiXJNH/uoCk=
|
||||||
github.com/opencontainers/runc v1.1.7/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50=
|
github.com/opencontainers/runc v1.1.7/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50=
|
||||||
github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
|
github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
|
||||||
@@ -357,8 +357,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
|
|||||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||||
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||||
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||||
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||||
github.com/spf13/cast v0.0.0-20150508191742-4d07383ffe94 h1:JmfC365KywYwHB946TTiQWEb8kqPY+pybPLoGE9GgVk=
|
github.com/spf13/cast v0.0.0-20150508191742-4d07383ffe94 h1:JmfC365KywYwHB946TTiQWEb8kqPY+pybPLoGE9GgVk=
|
||||||
github.com/spf13/cast v0.0.0-20150508191742-4d07383ffe94/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg=
|
github.com/spf13/cast v0.0.0-20150508191742-4d07383ffe94/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg=
|
||||||
github.com/spf13/cobra v0.0.1/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
github.com/spf13/cobra v0.0.1/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||||
@@ -482,8 +482,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b
|
|||||||
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
|
||||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
@@ -553,13 +553,13 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw=
|
golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols=
|
||||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
@@ -568,8 +568,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|||||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
|
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
||||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
bin/
|
||||||
+7
@@ -18,3 +18,10 @@ run:
|
|||||||
deadline: 2m
|
deadline: 2m
|
||||||
skip-dirs:
|
skip-dirs:
|
||||||
- vendor
|
- vendor
|
||||||
|
|
||||||
|
issues:
|
||||||
|
exclude-rules:
|
||||||
|
# io/ioutil is deprecated, but won't be removed until Go v2. It's safe to ignore for the release/2.8 branch.
|
||||||
|
- text: "SA1019: \"io/ioutil\" has been deprecated since Go 1.16"
|
||||||
|
linters:
|
||||||
|
- staticcheck
|
||||||
|
|||||||
+4
-2
@@ -44,6 +44,8 @@ Thomas Berger <loki@lokis-chaos.de> Thomas Berger <tbe@users.noreply.github.com>
|
|||||||
Samuel Karp <skarp@amazon.com> Samuel Karp <samuelkarp@users.noreply.github.com>
|
Samuel Karp <skarp@amazon.com> Samuel Karp <samuelkarp@users.noreply.github.com>
|
||||||
Justin Cormack <justin.cormack@docker.com>
|
Justin Cormack <justin.cormack@docker.com>
|
||||||
sayboras <sayboras@yahoo.com>
|
sayboras <sayboras@yahoo.com>
|
||||||
CrazyMax <github@crazymax.dev>
|
|
||||||
CrazyMax <github@crazymax.dev> <1951866+crazy-max@users.noreply.github.com>
|
CrazyMax <github@crazymax.dev> <1951866+crazy-max@users.noreply.github.com>
|
||||||
CrazyMax <github@crazymax.dev> <crazy-max@users.noreply.github.com>
|
Hayley Swimelar <hswimelar@gmail.com>
|
||||||
|
Jose D. Gomez R <jose.gomez@suse.com>
|
||||||
|
Shengjing Zhu <zhsj@debian.org>
|
||||||
|
Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com>
|
||||||
|
|||||||
+46
-36
@@ -1,49 +1,59 @@
|
|||||||
# syntax=docker/dockerfile:1.3
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.16.15
|
ARG GO_VERSION=1.19.9
|
||||||
ARG GORELEASER_XX_VERSION=1.2.5
|
ARG ALPINE_VERSION=3.16
|
||||||
|
ARG XX_VERSION=1.2.1
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM crazymax/goreleaser-xx:${GORELEASER_XX_VERSION} AS goreleaser-xx
|
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
||||||
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS base
|
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base
|
||||||
COPY --from=goreleaser-xx / /
|
COPY --from=xx / /
|
||||||
RUN apk add --no-cache file git
|
RUN apk add --no-cache bash coreutils file git
|
||||||
WORKDIR /go/src/github.com/docker/distribution
|
|
||||||
|
|
||||||
FROM base AS build
|
|
||||||
ENV GO111MODULE=auto
|
ENV GO111MODULE=auto
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
# GIT_REF is used by goreleaser-xx to handle the proper git ref when available.
|
WORKDIR /go/src/github.com/docker/distribution
|
||||||
# It will fallback to the working tree info if empty and use "git tag --points-at"
|
|
||||||
# or "git describe" to define the version info.
|
|
||||||
ARG GIT_REF
|
|
||||||
ARG TARGETPLATFORM
|
|
||||||
ARG PKG="github.com/distribution/distribution"
|
|
||||||
ARG BUILDTAGS="include_oss include_gcs"
|
|
||||||
RUN --mount=type=bind,rw \
|
|
||||||
--mount=type=cache,target=/root/.cache/go-build \
|
|
||||||
--mount=target=/go/pkg/mod,type=cache \
|
|
||||||
goreleaser-xx --debug \
|
|
||||||
--name="registry" \
|
|
||||||
--dist="/out" \
|
|
||||||
--main="./cmd/registry" \
|
|
||||||
--flags="-v" \
|
|
||||||
--ldflags="-s -w -X '$PKG/version.Version={{.Version}}' -X '$PKG/version.Revision={{.Commit}}' -X '$PKG/version.Package=$PKG'" \
|
|
||||||
--tags="$BUILDTAGS" \
|
|
||||||
--files="LICENSE" \
|
|
||||||
--files="README.md"
|
|
||||||
|
|
||||||
FROM scratch AS artifact
|
FROM base AS version
|
||||||
COPY --from=build /out/*.tar.gz /
|
ARG PKG="github.com/docker/distribution"
|
||||||
COPY --from=build /out/*.zip /
|
RUN --mount=target=. \
|
||||||
COPY --from=build /out/*.sha256 /
|
VERSION=$(git describe --match 'v[0-9]*' --dirty='.m' --always --tags) REVISION=$(git rev-parse HEAD)$(if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi); \
|
||||||
|
echo "-X ${PKG}/version.Version=${VERSION#v} -X ${PKG}/version.Revision=${REVISION} -X ${PKG}/version.Package=${PKG}" | tee /tmp/.ldflags; \
|
||||||
|
echo -n "${VERSION}" | tee /tmp/.version;
|
||||||
|
|
||||||
|
FROM base AS build
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
ARG LDFLAGS="-s -w"
|
||||||
|
ARG BUILDTAGS="include_oss include_gcs"
|
||||||
|
RUN --mount=type=bind,target=/go/src/github.com/docker/distribution,rw \
|
||||||
|
--mount=type=cache,target=/root/.cache/go-build \
|
||||||
|
--mount=target=/go/pkg/mod,type=cache \
|
||||||
|
--mount=type=bind,source=/tmp/.ldflags,target=/tmp/.ldflags,from=version \
|
||||||
|
set -x ; xx-go build -trimpath -ldflags "$(cat /tmp/.ldflags) ${LDFLAGS}" -o /usr/bin/registry ./cmd/registry \
|
||||||
|
&& xx-verify --static /usr/bin/registry
|
||||||
|
|
||||||
FROM scratch AS binary
|
FROM scratch AS binary
|
||||||
COPY --from=build /usr/local/bin/registry* /
|
COPY --from=build /usr/bin/registry /
|
||||||
|
|
||||||
FROM alpine:3.14
|
FROM base AS releaser
|
||||||
|
ARG TARGETOS
|
||||||
|
ARG TARGETARCH
|
||||||
|
ARG TARGETVARIANT
|
||||||
|
WORKDIR /work
|
||||||
|
RUN --mount=from=binary,target=/build \
|
||||||
|
--mount=type=bind,target=/src \
|
||||||
|
--mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version \
|
||||||
|
VERSION=$(cat /tmp/.version) \
|
||||||
|
&& mkdir -p /out \
|
||||||
|
&& cp /build/registry /src/README.md /src/LICENSE . \
|
||||||
|
&& tar -czvf "/out/registry_${VERSION#v}_${TARGETOS}_${TARGETARCH}${TARGETVARIANT}.tar.gz" * \
|
||||||
|
&& sha256sum -z "/out/registry_${VERSION#v}_${TARGETOS}_${TARGETARCH}${TARGETVARIANT}.tar.gz" | awk '{ print $1 }' > "/out/registry_${VERSION#v}_${TARGETOS}_${TARGETARCH}${TARGETVARIANT}.tar.gz.sha256"
|
||||||
|
|
||||||
|
FROM scratch AS artifact
|
||||||
|
COPY --from=releaser /out /
|
||||||
|
|
||||||
|
FROM alpine:${ALPINE_VERSION}
|
||||||
RUN apk add --no-cache ca-certificates
|
RUN apk add --no-cache ca-certificates
|
||||||
COPY cmd/registry/config-dev.yml /etc/docker/registry/config.yml
|
COPY cmd/registry/config-dev.yml /etc/docker/registry/config.yml
|
||||||
COPY --from=build /usr/local/bin/registry /bin/registry
|
COPY --from=binary /registry /bin/registry
|
||||||
VOLUME ["/var/lib/registry"]
|
VOLUME ["/var/lib/registry"]
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
ENTRYPOINT ["registry"]
|
ENTRYPOINT ["registry"]
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ version/version.go:
|
|||||||
|
|
||||||
check: ## run all linters (TODO: enable "unused", "varcheck", "ineffassign", "unconvert", "staticheck", "goimports", "structcheck")
|
check: ## run all linters (TODO: enable "unused", "varcheck", "ineffassign", "unconvert", "staticheck", "goimports", "structcheck")
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
golangci-lint run
|
@GO111MODULE=off golangci-lint run
|
||||||
|
|
||||||
test: ## run tests, except integration test with test.short
|
test: ## run tests, except integration test with test.short
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
|
|||||||
+6
-15
@@ -1,15 +1,3 @@
|
|||||||
// GITHUB_REF is the actual ref that triggers the workflow
|
|
||||||
// https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
|
|
||||||
variable "GITHUB_REF" {
|
|
||||||
default = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
target "_common" {
|
|
||||||
args = {
|
|
||||||
GIT_REF = GITHUB_REF
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
group "default" {
|
group "default" {
|
||||||
targets = ["image-local"]
|
targets = ["image-local"]
|
||||||
}
|
}
|
||||||
@@ -20,13 +8,11 @@ target "docker-metadata-action" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
target "binary" {
|
target "binary" {
|
||||||
inherits = ["_common"]
|
|
||||||
target = "binary"
|
target = "binary"
|
||||||
output = ["./bin"]
|
output = ["./bin"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "artifact" {
|
target "artifact" {
|
||||||
inherits = ["_common"]
|
|
||||||
target = "artifact"
|
target = "artifact"
|
||||||
output = ["./bin"]
|
output = ["./bin"]
|
||||||
}
|
}
|
||||||
@@ -43,8 +29,13 @@ target "artifact-all" {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Special target: https://github.com/docker/metadata-action#bake-definition
|
||||||
|
target "docker-metadata-action" {
|
||||||
|
tags = ["registry:local"]
|
||||||
|
}
|
||||||
|
|
||||||
target "image" {
|
target "image" {
|
||||||
inherits = ["_common", "docker-metadata-action"]
|
inherits = ["docker-metadata-action"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "image-local" {
|
target "image-local" {
|
||||||
|
|||||||
+2
-2
@@ -3,13 +3,13 @@
|
|||||||
//
|
//
|
||||||
// Grammar
|
// Grammar
|
||||||
//
|
//
|
||||||
// reference := name [ ":" tag ] [ "@" digest ]
|
// reference := name [ ":" tag ] [ "@" digest ]
|
||||||
// name := [domain '/'] path-component ['/' path-component]*
|
// name := [domain '/'] path-component ['/' path-component]*
|
||||||
// domain := domain-component ['.' domain-component]* [':' port-number]
|
// domain := domain-component ['.' domain-component]* [':' port-number]
|
||||||
// domain-component := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/
|
// domain-component := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/
|
||||||
// port-number := /[0-9]+/
|
// port-number := /[0-9]+/
|
||||||
// path-component := alpha-numeric [separator alpha-numeric]*
|
// path-component := alpha-numeric [separator alpha-numeric]*
|
||||||
// alpha-numeric := /[a-z0-9]+/
|
// alpha-numeric := /[a-z0-9]+/
|
||||||
// separator := /[_.]|__|[-]*/
|
// separator := /[_.]|__|[-]*/
|
||||||
//
|
//
|
||||||
// tag := /[\w][\w.-]{0,127}/
|
// tag := /[\w][\w.-]{0,127}/
|
||||||
|
|||||||
+17
@@ -134,6 +134,19 @@ var (
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
invalidPaginationResponseDescriptor = ResponseDescriptor{
|
||||||
|
Name: "Invalid pagination number",
|
||||||
|
Description: "The received parameter n was invalid in some way, as described by the error code. The client should resolve the issue and retry the request.",
|
||||||
|
StatusCode: http.StatusBadRequest,
|
||||||
|
Body: BodyDescriptor{
|
||||||
|
ContentType: "application/json",
|
||||||
|
Format: errorsBody,
|
||||||
|
},
|
||||||
|
ErrorCodes: []errcode.ErrorCode{
|
||||||
|
ErrorCodePaginationNumberInvalid,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
repositoryNotFoundResponseDescriptor = ResponseDescriptor{
|
repositoryNotFoundResponseDescriptor = ResponseDescriptor{
|
||||||
Name: "No Such Repository Error",
|
Name: "No Such Repository Error",
|
||||||
StatusCode: http.StatusNotFound,
|
StatusCode: http.StatusNotFound,
|
||||||
@@ -490,6 +503,7 @@ var routeDescriptors = []RouteDescriptor{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Failures: []ResponseDescriptor{
|
Failures: []ResponseDescriptor{
|
||||||
|
invalidPaginationResponseDescriptor,
|
||||||
unauthorizedResponseDescriptor,
|
unauthorizedResponseDescriptor,
|
||||||
repositoryNotFoundResponseDescriptor,
|
repositoryNotFoundResponseDescriptor,
|
||||||
deniedResponseDescriptor,
|
deniedResponseDescriptor,
|
||||||
@@ -1578,6 +1592,9 @@ var routeDescriptors = []RouteDescriptor{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Failures: []ResponseDescriptor{
|
||||||
|
invalidPaginationResponseDescriptor,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
+9
@@ -133,4 +133,13 @@ var (
|
|||||||
longer proceed.`,
|
longer proceed.`,
|
||||||
HTTPStatusCode: http.StatusNotFound,
|
HTTPStatusCode: http.StatusNotFound,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ErrorCodePaginationNumberInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{
|
||||||
|
Value: "PAGINATION_NUMBER_INVALID",
|
||||||
|
Message: "invalid number of results requested",
|
||||||
|
Description: `Returned when the "n" parameter (number of results
|
||||||
|
to return) is not an integer, "n" is negative or "n" is bigger than
|
||||||
|
the maximum allowed.`,
|
||||||
|
HTTPStatusCode: http.StatusBadRequest,
|
||||||
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
+2
@@ -55,6 +55,8 @@ func parseHTTPErrorResponse(statusCode int, r io.Reader) error {
|
|||||||
switch statusCode {
|
switch statusCode {
|
||||||
case http.StatusUnauthorized:
|
case http.StatusUnauthorized:
|
||||||
return errcode.ErrorCodeUnauthorized.WithMessage(detailsErr.Details)
|
return errcode.ErrorCodeUnauthorized.WithMessage(detailsErr.Details)
|
||||||
|
case http.StatusForbidden:
|
||||||
|
return errcode.ErrorCodeDenied.WithMessage(detailsErr.Details)
|
||||||
case http.StatusTooManyRequests:
|
case http.StatusTooManyRequests:
|
||||||
return errcode.ErrorCodeTooManyRequests.WithMessage(detailsErr.Details)
|
return errcode.ErrorCodeTooManyRequests.WithMessage(detailsErr.Details)
|
||||||
default:
|
default:
|
||||||
|
|||||||
+1
-3
@@ -114,9 +114,7 @@ func (r *registry) Repositories(ctx context.Context, entries []string, last stri
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
for cnt := range ctlg.Repositories {
|
copy(entries, ctlg.Repositories)
|
||||||
entries[cnt] = ctlg.Repositories[cnt]
|
|
||||||
}
|
|
||||||
numFilled = len(ctlg.Repositories)
|
numFilled = len(ctlg.Repositories)
|
||||||
|
|
||||||
link := resp.Header.Get("Link")
|
link := resp.Header.Get("Link")
|
||||||
|
|||||||
-1
@@ -180,7 +180,6 @@ func (hrs *httpReadSeeker) reader() (io.Reader, error) {
|
|||||||
// context.GetLogger(hrs.context).Infof("Range: %s", req.Header.Get("Range"))
|
// context.GetLogger(hrs.context).Infof("Range: %s", req.Header.Get("Range"))
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Header.Add("Accept-Encoding", "identity")
|
|
||||||
resp, err := hrs.client.Do(req)
|
resp, err := hrs.client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
+10
-36
@@ -5162,42 +5162,8 @@ definitions:
|
|||||||
ServerVersion:
|
ServerVersion:
|
||||||
description: |
|
description: |
|
||||||
Version string of the daemon.
|
Version string of the daemon.
|
||||||
|
|
||||||
> **Note**: the [standalone Swarm API](https://docs.docker.com/swarm/swarm-api/)
|
|
||||||
> returns the Swarm version instead of the daemon version, for example
|
|
||||||
> `swarm/1.2.8`.
|
|
||||||
type: "string"
|
type: "string"
|
||||||
example: "17.06.0-ce"
|
example: "24.0.2"
|
||||||
ClusterStore:
|
|
||||||
description: |
|
|
||||||
URL of the distributed storage backend.
|
|
||||||
|
|
||||||
|
|
||||||
The storage backend is used for multihost networking (to store
|
|
||||||
network and endpoint information) and by the node discovery mechanism.
|
|
||||||
|
|
||||||
<p><br /></p>
|
|
||||||
|
|
||||||
> **Deprecated**: This field is only propagated when using standalone Swarm
|
|
||||||
> mode, and overlay networking using an external k/v store. Overlay
|
|
||||||
> networks with Swarm mode enabled use the built-in raft store, and
|
|
||||||
> this field will be empty.
|
|
||||||
type: "string"
|
|
||||||
example: "consul://consul.corp.example.com:8600/some/path"
|
|
||||||
ClusterAdvertise:
|
|
||||||
description: |
|
|
||||||
The network endpoint that the Engine advertises for the purpose of
|
|
||||||
node discovery. ClusterAdvertise is a `host:port` combination on which
|
|
||||||
the daemon is reachable by other hosts.
|
|
||||||
|
|
||||||
<p><br /></p>
|
|
||||||
|
|
||||||
> **Deprecated**: This field is only propagated when using standalone Swarm
|
|
||||||
> mode, and overlay networking using an external k/v store. Overlay
|
|
||||||
> networks with Swarm mode enabled use the built-in raft store, and
|
|
||||||
> this field will be empty.
|
|
||||||
type: "string"
|
|
||||||
example: "node5.corp.example.com:8000"
|
|
||||||
Runtimes:
|
Runtimes:
|
||||||
description: |
|
description: |
|
||||||
List of [OCI compliant](https://github.com/opencontainers/runtime-spec)
|
List of [OCI compliant](https://github.com/opencontainers/runtime-spec)
|
||||||
@@ -9930,7 +9896,9 @@ paths:
|
|||||||
Id: "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30"
|
Id: "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30"
|
||||||
Warning: ""
|
Warning: ""
|
||||||
403:
|
403:
|
||||||
description: "operation not supported for pre-defined networks"
|
description: |
|
||||||
|
Forbidden operation. This happens when trying to create a network named after a pre-defined network,
|
||||||
|
or when trying to create an overlay network on a daemon which is not part of a Swarm cluster.
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/ErrorResponse"
|
$ref: "#/definitions/ErrorResponse"
|
||||||
404:
|
404:
|
||||||
@@ -10393,6 +10361,12 @@ paths:
|
|||||||
default if omitted.
|
default if omitted.
|
||||||
required: true
|
required: true
|
||||||
type: "string"
|
type: "string"
|
||||||
|
- name: "force"
|
||||||
|
in: "query"
|
||||||
|
description: |
|
||||||
|
Force disable a plugin even if still in use.
|
||||||
|
required: false
|
||||||
|
type: "boolean"
|
||||||
tags: ["Plugin"]
|
tags: ["Plugin"]
|
||||||
/plugins/{name}/upgrade:
|
/plugins/{name}/upgrade:
|
||||||
post:
|
post:
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ package types // import "github.com/docker/docker/api/types"
|
|||||||
import (
|
import (
|
||||||
"github.com/docker/docker/api/types/container"
|
"github.com/docker/docker/api/types/container"
|
||||||
"github.com/docker/docker/api/types/network"
|
"github.com/docker/docker/api/types/network"
|
||||||
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// configs holds structs used for internal communication between the
|
// configs holds structs used for internal communication between the
|
||||||
@@ -16,7 +16,7 @@ type ContainerCreateConfig struct {
|
|||||||
Config *container.Config
|
Config *container.Config
|
||||||
HostConfig *container.HostConfig
|
HostConfig *container.HostConfig
|
||||||
NetworkingConfig *network.NetworkingConfig
|
NetworkingConfig *network.NetworkingConfig
|
||||||
Platform *specs.Platform
|
Platform *ocispec.Platform
|
||||||
AdjustCPUShares bool
|
AdjustCPUShares bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
package image
|
package image
|
||||||
|
|
||||||
import specs "github.com/opencontainers/image-spec/specs-go/v1"
|
import ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
|
|
||||||
// GetImageOpts holds parameters to inspect an image.
|
// GetImageOpts holds parameters to inspect an image.
|
||||||
type GetImageOpts struct {
|
type GetImageOpts struct {
|
||||||
Platform *specs.Platform
|
Platform *ocispec.Platform
|
||||||
Details bool
|
Details bool
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -4,7 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServiceConfig stores daemon registry services configuration.
|
// ServiceConfig stores daemon registry services configuration.
|
||||||
@@ -113,8 +113,8 @@ type SearchResults struct {
|
|||||||
type DistributionInspect struct {
|
type DistributionInspect struct {
|
||||||
// Descriptor contains information about the manifest, including
|
// Descriptor contains information about the manifest, including
|
||||||
// the content addressable digest
|
// the content addressable digest
|
||||||
Descriptor v1.Descriptor
|
Descriptor ocispec.Descriptor
|
||||||
// Platforms contains the list of platforms supported by the image,
|
// Platforms contains the list of platforms supported by the image,
|
||||||
// obtained by parsing the manifest
|
// obtained by parsing the manifest
|
||||||
Platforms []v1.Platform
|
Platforms []ocispec.Platform
|
||||||
}
|
}
|
||||||
|
|||||||
+30
@@ -56,6 +56,36 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// DummyHost is a hostname used for local communication.
|
||||||
|
//
|
||||||
|
// It acts as a valid formatted hostname for local connections (such as "unix://"
|
||||||
|
// or "npipe://") which do not require a hostname. It should never be resolved,
|
||||||
|
// but uses the special-purpose ".localhost" TLD (as defined in [RFC 2606, Section 2]
|
||||||
|
// and [RFC 6761, Section 6.3]).
|
||||||
|
//
|
||||||
|
// [RFC 7230, Section 5.4] defines that an empty header must be used for such
|
||||||
|
// cases:
|
||||||
|
//
|
||||||
|
// If the authority component is missing or undefined for the target URI,
|
||||||
|
// then a client MUST send a Host header field with an empty field-value.
|
||||||
|
//
|
||||||
|
// However, [Go stdlib] enforces the semantics of HTTP(S) over TCP, does not
|
||||||
|
// allow an empty header to be used, and requires req.URL.Scheme to be either
|
||||||
|
// "http" or "https".
|
||||||
|
//
|
||||||
|
// For further details, refer to:
|
||||||
|
//
|
||||||
|
// - https://github.com/docker/engine-api/issues/189
|
||||||
|
// - https://github.com/golang/go/issues/13624
|
||||||
|
// - https://github.com/golang/go/issues/61076
|
||||||
|
// - https://github.com/moby/moby/issues/45935
|
||||||
|
//
|
||||||
|
// [RFC 2606, Section 2]: https://www.rfc-editor.org/rfc/rfc2606.html#section-2
|
||||||
|
// [RFC 6761, Section 6.3]: https://www.rfc-editor.org/rfc/rfc6761#section-6.3
|
||||||
|
// [RFC 7230, Section 5.4]: https://datatracker.ietf.org/doc/html/rfc7230#section-5.4
|
||||||
|
// [Go stdlib]: https://github.com/golang/go/blob/6244b1946bc2101b01955468f1be502dbadd6807/src/net/http/transport.go#L558-L569
|
||||||
|
const DummyHost = "api.moby.localhost"
|
||||||
|
|
||||||
// ErrRedirect is the error returned by checkRedirect when the request is non-GET.
|
// ErrRedirect is the error returned by checkRedirect when the request is non-GET.
|
||||||
var ErrRedirect = errors.New("unexpected redirect in response")
|
var ErrRedirect = errors.New("unexpected redirect in response")
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/docker/docker/api/types/container"
|
"github.com/docker/docker/api/types/container"
|
||||||
"github.com/docker/docker/api/types/network"
|
"github.com/docker/docker/api/types/network"
|
||||||
"github.com/docker/docker/api/types/versions"
|
"github.com/docker/docker/api/types/versions"
|
||||||
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
type configWrapper struct {
|
type configWrapper struct {
|
||||||
@@ -20,7 +20,7 @@ type configWrapper struct {
|
|||||||
|
|
||||||
// ContainerCreate creates a new container based on the given configuration.
|
// ContainerCreate creates a new container based on the given configuration.
|
||||||
// It can be associated with a name, but it's not mandatory.
|
// It can be associated with a name, but it's not mandatory.
|
||||||
func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.CreateResponse, error) {
|
func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error) {
|
||||||
var response container.CreateResponse
|
var response container.CreateResponse
|
||||||
|
|
||||||
if err := cli.NewVersionError("1.25", "stop timeout"); config != nil && config.StopTimeout != nil && err != nil {
|
if err := cli.NewVersionError("1.25", "stop timeout"); config != nil && config.StopTimeout != nil && err != nil {
|
||||||
@@ -75,7 +75,7 @@ func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config
|
|||||||
// Similar to containerd's platforms.Format(), but does allow components to be
|
// Similar to containerd's platforms.Format(), but does allow components to be
|
||||||
// omitted (e.g. pass "architecture" only, without "os":
|
// omitted (e.g. pass "architecture" only, without "os":
|
||||||
// https://github.com/containerd/containerd/blob/v1.5.2/platforms/platforms.go#L243-L263
|
// https://github.com/containerd/containerd/blob/v1.5.2/platforms/platforms.go#L243-L263
|
||||||
func formatPlatform(platform *specs.Platform) string {
|
func formatPlatform(platform *ocispec.Platform) string {
|
||||||
if platform == nil {
|
if platform == nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-9
@@ -23,14 +23,10 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return types.HijackedResponse{}, err
|
return types.HijackedResponse{}, err
|
||||||
}
|
}
|
||||||
|
req, err := cli.buildRequest(http.MethodPost, cli.getAPIPath(ctx, path, query), bodyEncoded, headers)
|
||||||
apiPath := cli.getAPIPath(ctx, path, query)
|
|
||||||
req, err := http.NewRequest(http.MethodPost, apiPath, bodyEncoded)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return types.HijackedResponse{}, err
|
return types.HijackedResponse{}, err
|
||||||
}
|
}
|
||||||
req = cli.addHeaders(req, headers)
|
|
||||||
|
|
||||||
conn, mediaType, err := cli.setupHijackConn(ctx, req, "tcp")
|
conn, mediaType, err := cli.setupHijackConn(ctx, req, "tcp")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return types.HijackedResponse{}, err
|
return types.HijackedResponse{}, err
|
||||||
@@ -64,7 +60,6 @@ func fallbackDial(proto, addr string, tlsConfig *tls.Config) (net.Conn, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto string) (net.Conn, string, error) {
|
func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto string) (net.Conn, string, error) {
|
||||||
req.Host = cli.addr
|
|
||||||
req.Header.Set("Connection", "Upgrade")
|
req.Header.Set("Connection", "Upgrade")
|
||||||
req.Header.Set("Upgrade", proto)
|
req.Header.Set("Upgrade", proto)
|
||||||
|
|
||||||
@@ -80,8 +75,8 @@ func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto
|
|||||||
// state. Setting TCP KeepAlive on the socket connection will prohibit
|
// state. Setting TCP KeepAlive on the socket connection will prohibit
|
||||||
// ECONNTIMEOUT unless the socket connection truly is broken
|
// ECONNTIMEOUT unless the socket connection truly is broken
|
||||||
if tcpConn, ok := conn.(*net.TCPConn); ok {
|
if tcpConn, ok := conn.(*net.TCPConn); ok {
|
||||||
tcpConn.SetKeepAlive(true)
|
_ = tcpConn.SetKeepAlive(true)
|
||||||
tcpConn.SetKeepAlivePeriod(30 * time.Second)
|
_ = tcpConn.SetKeepAlivePeriod(30 * time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
clientconn := httputil.NewClientConn(conn, nil)
|
clientconn := httputil.NewClientConn(conn, nil)
|
||||||
@@ -96,7 +91,7 @@ func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto
|
|||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
if resp.StatusCode != http.StatusSwitchingProtocols {
|
if resp.StatusCode != http.StatusSwitchingProtocols {
|
||||||
resp.Body.Close()
|
_ = resp.Body.Close()
|
||||||
return nil, "", fmt.Errorf("unable to upgrade to %s, received %d", proto, resp.StatusCode)
|
return nil, "", fmt.Errorf("unable to upgrade to %s, received %d", proto, resp.StatusCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -15,7 +15,7 @@ import (
|
|||||||
"github.com/docker/docker/api/types/registry"
|
"github.com/docker/docker/api/types/registry"
|
||||||
"github.com/docker/docker/api/types/swarm"
|
"github.com/docker/docker/api/types/swarm"
|
||||||
"github.com/docker/docker/api/types/volume"
|
"github.com/docker/docker/api/types/volume"
|
||||||
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CommonAPIClient is the common methods between stable and experimental versions of APIClient.
|
// CommonAPIClient is the common methods between stable and experimental versions of APIClient.
|
||||||
@@ -47,7 +47,7 @@ type CommonAPIClient interface {
|
|||||||
type ContainerAPIClient interface {
|
type ContainerAPIClient interface {
|
||||||
ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error)
|
ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error)
|
||||||
ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error)
|
ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error)
|
||||||
ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.CreateResponse, error)
|
ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
|
||||||
ContainerDiff(ctx context.Context, container string) ([]container.FilesystemChange, error)
|
ContainerDiff(ctx context.Context, container string) ([]container.FilesystemChange, error)
|
||||||
ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)
|
ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)
|
||||||
ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)
|
ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)
|
||||||
|
|||||||
+4
-6
@@ -96,16 +96,14 @@ func (cli *Client) buildRequest(method, path string, body io.Reader, headers hea
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
req = cli.addHeaders(req, headers)
|
req = cli.addHeaders(req, headers)
|
||||||
|
req.URL.Scheme = cli.scheme
|
||||||
|
req.URL.Host = cli.addr
|
||||||
|
|
||||||
if cli.proto == "unix" || cli.proto == "npipe" {
|
if cli.proto == "unix" || cli.proto == "npipe" {
|
||||||
// For local communications, it doesn't matter what the host is. We just
|
// Override host header for non-tcp connections.
|
||||||
// need a valid and meaningful host name. (See #189)
|
req.Host = DummyHost
|
||||||
req.Host = "docker"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
req.URL.Host = cli.addr
|
|
||||||
req.URL.Scheme = cli.scheme
|
|
||||||
|
|
||||||
if expectedPayload && req.Header.Get("Content-Type") == "" {
|
if expectedPayload && req.Header.Get("Content-Type") == "" {
|
||||||
req.Header.Set("Content-Type", "text/plain")
|
req.Header.Set("Content-Type", "text/plain")
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -167,7 +167,10 @@ func callGetent(database, key string) (io.Reader, error) {
|
|||||||
if getentCmd == "" {
|
if getentCmd == "" {
|
||||||
return nil, fmt.Errorf("unable to find getent command")
|
return nil, fmt.Errorf("unable to find getent command")
|
||||||
}
|
}
|
||||||
out, err := exec.Command(getentCmd, database, key).CombinedOutput()
|
command := exec.Command(getentCmd, database, key)
|
||||||
|
// we run getent within container filesystem, but without /dev so /dev/null is not available for exec to mock stdin
|
||||||
|
command.Stdin = io.NopCloser(bytes.NewReader(nil))
|
||||||
|
out, err := command.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
exitCode, errC := getExitCode(err)
|
exitCode, errC := getExitCode(err)
|
||||||
if errC != nil {
|
if errC != nil {
|
||||||
|
|||||||
-3
@@ -65,7 +65,4 @@ const (
|
|||||||
|
|
||||||
// AnnotationArtifactDescription is the annotation key for the human readable description for the artifact.
|
// AnnotationArtifactDescription is the annotation key for the human readable description for the artifact.
|
||||||
AnnotationArtifactDescription = "org.opencontainers.artifact.description"
|
AnnotationArtifactDescription = "org.opencontainers.artifact.description"
|
||||||
|
|
||||||
// AnnotationReferrersFiltersApplied is the annotation key for the comma separated list of filters applied by the registry in the referrers listing.
|
|
||||||
AnnotationReferrersFiltersApplied = "org.opencontainers.referrers.filtersApplied"
|
|
||||||
)
|
)
|
||||||
|
|||||||
-34
@@ -1,34 +0,0 @@
|
|||||||
// Copyright 2022 The Linux Foundation
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
package v1
|
|
||||||
|
|
||||||
// Artifact describes an artifact manifest.
|
|
||||||
// This structure provides `application/vnd.oci.artifact.manifest.v1+json` mediatype when marshalled to JSON.
|
|
||||||
type Artifact struct {
|
|
||||||
// MediaType is the media type of the object this schema refers to.
|
|
||||||
MediaType string `json:"mediaType"`
|
|
||||||
|
|
||||||
// ArtifactType is the IANA media type of the artifact this schema refers to.
|
|
||||||
ArtifactType string `json:"artifactType"`
|
|
||||||
|
|
||||||
// Blobs is a collection of blobs referenced by this manifest.
|
|
||||||
Blobs []Descriptor `json:"blobs,omitempty"`
|
|
||||||
|
|
||||||
// Subject (reference) is an optional link from the artifact to another manifest forming an association between the artifact and the other manifest.
|
|
||||||
Subject *Descriptor `json:"subject,omitempty"`
|
|
||||||
|
|
||||||
// Annotations contains arbitrary metadata for the artifact manifest.
|
|
||||||
Annotations map[string]string `json:"annotations,omitempty"`
|
|
||||||
}
|
|
||||||
+11
-23
@@ -49,13 +49,15 @@ type ImageConfig struct {
|
|||||||
// StopSignal contains the system call signal that will be sent to the container to exit.
|
// StopSignal contains the system call signal that will be sent to the container to exit.
|
||||||
StopSignal string `json:"StopSignal,omitempty"`
|
StopSignal string `json:"StopSignal,omitempty"`
|
||||||
|
|
||||||
// ArgsEscaped `[Deprecated]` - This field is present only for legacy
|
// ArgsEscaped
|
||||||
// compatibility with Docker and should not be used by new image builders.
|
//
|
||||||
// It is used by Docker for Windows images to indicate that the `Entrypoint`
|
// Deprecated: This field is present only for legacy compatibility with
|
||||||
// or `Cmd` or both, contains only a single element array, that is a
|
// Docker and should not be used by new image builders. It is used by Docker
|
||||||
// pre-escaped, and combined into a single string `CommandLine`. If `true`
|
// for Windows images to indicate that the `Entrypoint` or `Cmd` or both,
|
||||||
// the value in `Entrypoint` or `Cmd` should be used as-is to avoid double
|
// contains only a single element array, that is a pre-escaped, and combined
|
||||||
// escaping.
|
// into a single string `CommandLine`. If `true` the value in `Entrypoint` or
|
||||||
|
// `Cmd` should be used as-is to avoid double escaping.
|
||||||
|
// https://github.com/opencontainers/image-spec/pull/892
|
||||||
ArgsEscaped bool `json:"ArgsEscaped,omitempty"`
|
ArgsEscaped bool `json:"ArgsEscaped,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,22 +97,8 @@ type Image struct {
|
|||||||
// Author defines the name and/or email address of the person or entity which created and is responsible for maintaining the image.
|
// Author defines the name and/or email address of the person or entity which created and is responsible for maintaining the image.
|
||||||
Author string `json:"author,omitempty"`
|
Author string `json:"author,omitempty"`
|
||||||
|
|
||||||
// Architecture is the CPU architecture which the binaries in this image are built to run on.
|
// Platform describes the platform which the image in the manifest runs on.
|
||||||
Architecture string `json:"architecture"`
|
Platform
|
||||||
|
|
||||||
// Variant is the variant of the specified CPU architecture which image binaries are intended to run on.
|
|
||||||
Variant string `json:"variant,omitempty"`
|
|
||||||
|
|
||||||
// OS is the name of the operating system which the image is built to run on.
|
|
||||||
OS string `json:"os"`
|
|
||||||
|
|
||||||
// OSVersion is an optional field specifying the operating system
|
|
||||||
// version, for example on Windows `10.0.14393.1066`.
|
|
||||||
OSVersion string `json:"os.version,omitempty"`
|
|
||||||
|
|
||||||
// OSFeatures is an optional field specifying an array of strings,
|
|
||||||
// each listing a required OS feature (for example on Windows `win32k`).
|
|
||||||
OSFeatures []string `json:"os.features,omitempty"`
|
|
||||||
|
|
||||||
// Config defines the execution parameters which should be used as a base when running a container using the image.
|
// Config defines the execution parameters which should be used as a base when running a container using the image.
|
||||||
Config ImageConfig `json:"config,omitempty"`
|
Config ImageConfig `json:"config,omitempty"`
|
||||||
|
|||||||
+11
@@ -23,6 +23,9 @@ type Manifest struct {
|
|||||||
// MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.manifest.v1+json`
|
// MediaType specifies the type of this document data structure e.g. `application/vnd.oci.image.manifest.v1+json`
|
||||||
MediaType string `json:"mediaType,omitempty"`
|
MediaType string `json:"mediaType,omitempty"`
|
||||||
|
|
||||||
|
// ArtifactType specifies the IANA media type of artifact when the manifest is used for an artifact.
|
||||||
|
ArtifactType string `json:"artifactType,omitempty"`
|
||||||
|
|
||||||
// Config references a configuration object for a container, by digest.
|
// Config references a configuration object for a container, by digest.
|
||||||
// The referenced configuration object is a JSON blob that the runtime uses to set up the container.
|
// The referenced configuration object is a JSON blob that the runtime uses to set up the container.
|
||||||
Config Descriptor `json:"config"`
|
Config Descriptor `json:"config"`
|
||||||
@@ -36,3 +39,11 @@ type Manifest struct {
|
|||||||
// Annotations contains arbitrary metadata for the image manifest.
|
// Annotations contains arbitrary metadata for the image manifest.
|
||||||
Annotations map[string]string `json:"annotations,omitempty"`
|
Annotations map[string]string `json:"annotations,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ScratchDescriptor is the descriptor of a blob with content of `{}`.
|
||||||
|
var ScratchDescriptor = Descriptor{
|
||||||
|
MediaType: MediaTypeScratch,
|
||||||
|
Digest: `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`,
|
||||||
|
Size: 2,
|
||||||
|
Data: []byte(`{}`),
|
||||||
|
}
|
||||||
|
|||||||
+17
-2
@@ -40,21 +40,36 @@ const (
|
|||||||
|
|
||||||
// MediaTypeImageLayerNonDistributable is the media type for layers referenced by
|
// MediaTypeImageLayerNonDistributable is the media type for layers referenced by
|
||||||
// the manifest but with distribution restrictions.
|
// the manifest but with distribution restrictions.
|
||||||
|
//
|
||||||
|
// Deprecated: Non-distributable layers are deprecated, and not recommended
|
||||||
|
// for future use. Implementations SHOULD NOT produce new non-distributable
|
||||||
|
// layers.
|
||||||
|
// https://github.com/opencontainers/image-spec/pull/965
|
||||||
MediaTypeImageLayerNonDistributable = "application/vnd.oci.image.layer.nondistributable.v1.tar"
|
MediaTypeImageLayerNonDistributable = "application/vnd.oci.image.layer.nondistributable.v1.tar"
|
||||||
|
|
||||||
// MediaTypeImageLayerNonDistributableGzip is the media type for
|
// MediaTypeImageLayerNonDistributableGzip is the media type for
|
||||||
// gzipped layers referenced by the manifest but with distribution
|
// gzipped layers referenced by the manifest but with distribution
|
||||||
// restrictions.
|
// restrictions.
|
||||||
|
//
|
||||||
|
// Deprecated: Non-distributable layers are deprecated, and not recommended
|
||||||
|
// for future use. Implementations SHOULD NOT produce new non-distributable
|
||||||
|
// layers.
|
||||||
|
// https://github.com/opencontainers/image-spec/pull/965
|
||||||
MediaTypeImageLayerNonDistributableGzip = "application/vnd.oci.image.layer.nondistributable.v1.tar+gzip"
|
MediaTypeImageLayerNonDistributableGzip = "application/vnd.oci.image.layer.nondistributable.v1.tar+gzip"
|
||||||
|
|
||||||
// MediaTypeImageLayerNonDistributableZstd is the media type for zstd
|
// MediaTypeImageLayerNonDistributableZstd is the media type for zstd
|
||||||
// compressed layers referenced by the manifest but with distribution
|
// compressed layers referenced by the manifest but with distribution
|
||||||
// restrictions.
|
// restrictions.
|
||||||
|
//
|
||||||
|
// Deprecated: Non-distributable layers are deprecated, and not recommended
|
||||||
|
// for future use. Implementations SHOULD NOT produce new non-distributable
|
||||||
|
// layers.
|
||||||
|
// https://github.com/opencontainers/image-spec/pull/965
|
||||||
MediaTypeImageLayerNonDistributableZstd = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd"
|
MediaTypeImageLayerNonDistributableZstd = "application/vnd.oci.image.layer.nondistributable.v1.tar+zstd"
|
||||||
|
|
||||||
// MediaTypeImageConfig specifies the media type for the image configuration.
|
// MediaTypeImageConfig specifies the media type for the image configuration.
|
||||||
MediaTypeImageConfig = "application/vnd.oci.image.config.v1+json"
|
MediaTypeImageConfig = "application/vnd.oci.image.config.v1+json"
|
||||||
|
|
||||||
// MediaTypeArtifactManifest specifies the media type for a content descriptor.
|
// MediaTypeScratch specifies the media type for an unused blob containing the value `{}`
|
||||||
MediaTypeArtifactManifest = "application/vnd.oci.artifact.manifest.v1+json"
|
MediaTypeScratch = "application/vnd.oci.scratch.v1+json"
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ const (
|
|||||||
VersionPatch = 0
|
VersionPatch = 0
|
||||||
|
|
||||||
// VersionDev indicates development branch. Releases will be empty string.
|
// VersionDev indicates development branch. Releases will be empty string.
|
||||||
VersionDev = "-dev"
|
VersionDev = "-rc.3"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version is the specification version that the package types support.
|
// Version is the specification version that the package types support.
|
||||||
|
|||||||
+5
-3
@@ -9,7 +9,7 @@ the last thing you want from your Logging library (again...).
|
|||||||
|
|
||||||
This does not mean Logrus is dead. Logrus will continue to be maintained for
|
This does not mean Logrus is dead. Logrus will continue to be maintained for
|
||||||
security, (backwards compatible) bug fixes, and performance (where we are
|
security, (backwards compatible) bug fixes, and performance (where we are
|
||||||
limited by the interface).
|
limited by the interface).
|
||||||
|
|
||||||
I believe Logrus' biggest contribution is to have played a part in today's
|
I believe Logrus' biggest contribution is to have played a part in today's
|
||||||
widespread use of structured logging in Golang. There doesn't seem to be a
|
widespread use of structured logging in Golang. There doesn't seem to be a
|
||||||
@@ -43,7 +43,7 @@ plain text):
|
|||||||
With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash
|
With `log.SetFormatter(&log.JSONFormatter{})`, for easy parsing by logstash
|
||||||
or Splunk:
|
or Splunk:
|
||||||
|
|
||||||
```json
|
```text
|
||||||
{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the
|
{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the
|
||||||
ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"}
|
ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"}
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ time="2015-03-26T01:27:38-04:00" level=fatal method=github.com/sirupsen/arcticcr
|
|||||||
```
|
```
|
||||||
Note that this does add measurable overhead - the cost will depend on the version of Go, but is
|
Note that this does add measurable overhead - the cost will depend on the version of Go, but is
|
||||||
between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your
|
between 20 and 40% in recent tests with 1.6 and 1.7. You can validate this in your
|
||||||
environment via benchmarks:
|
environment via benchmarks:
|
||||||
```
|
```
|
||||||
go test -bench=.*CallerTracing
|
go test -bench=.*CallerTracing
|
||||||
```
|
```
|
||||||
@@ -317,6 +317,8 @@ log.SetLevel(log.InfoLevel)
|
|||||||
It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose
|
It may be useful to set `log.Level = logrus.DebugLevel` in a debug or verbose
|
||||||
environment if your application has that.
|
environment if your application has that.
|
||||||
|
|
||||||
|
Note: If you want different log levels for global (`log.SetLevel(...)`) and syslog logging, please check the [syslog hook README](hooks/syslog/README.md#different-log-levels-for-local-and-remote-logging).
|
||||||
|
|
||||||
#### Entries
|
#### Entries
|
||||||
|
|
||||||
Besides the fields added with `WithField` or `WithFields` some fields are
|
Besides the fields added with `WithField` or `WithFields` some fields are
|
||||||
|
|||||||
+34
-2
@@ -4,6 +4,7 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"io"
|
"io"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Writer at INFO level. See WriterLevel for details.
|
// Writer at INFO level. See WriterLevel for details.
|
||||||
@@ -20,15 +21,18 @@ func (logger *Logger) WriterLevel(level Level) *io.PipeWriter {
|
|||||||
return NewEntry(logger).WriterLevel(level)
|
return NewEntry(logger).WriterLevel(level)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Writer returns an io.Writer that writes to the logger at the info log level
|
||||||
func (entry *Entry) Writer() *io.PipeWriter {
|
func (entry *Entry) Writer() *io.PipeWriter {
|
||||||
return entry.WriterLevel(InfoLevel)
|
return entry.WriterLevel(InfoLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WriterLevel returns an io.Writer that writes to the logger at the given log level
|
||||||
func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
|
func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
|
||||||
reader, writer := io.Pipe()
|
reader, writer := io.Pipe()
|
||||||
|
|
||||||
var printFunc func(args ...interface{})
|
var printFunc func(args ...interface{})
|
||||||
|
|
||||||
|
// Determine which log function to use based on the specified log level
|
||||||
switch level {
|
switch level {
|
||||||
case TraceLevel:
|
case TraceLevel:
|
||||||
printFunc = entry.Trace
|
printFunc = entry.Trace
|
||||||
@@ -48,23 +52,51 @@ func (entry *Entry) WriterLevel(level Level) *io.PipeWriter {
|
|||||||
printFunc = entry.Print
|
printFunc = entry.Print
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start a new goroutine to scan the input and write it to the logger using the specified print function.
|
||||||
|
// It splits the input into chunks of up to 64KB to avoid buffer overflows.
|
||||||
go entry.writerScanner(reader, printFunc)
|
go entry.writerScanner(reader, printFunc)
|
||||||
|
|
||||||
|
// Set a finalizer function to close the writer when it is garbage collected
|
||||||
runtime.SetFinalizer(writer, writerFinalizer)
|
runtime.SetFinalizer(writer, writerFinalizer)
|
||||||
|
|
||||||
return writer
|
return writer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// writerScanner scans the input from the reader and writes it to the logger
|
||||||
func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) {
|
func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) {
|
||||||
scanner := bufio.NewScanner(reader)
|
scanner := bufio.NewScanner(reader)
|
||||||
for scanner.Scan() {
|
|
||||||
printFunc(scanner.Text())
|
// Set the buffer size to the maximum token size to avoid buffer overflows
|
||||||
|
scanner.Buffer(make([]byte, bufio.MaxScanTokenSize), bufio.MaxScanTokenSize)
|
||||||
|
|
||||||
|
// Define a split function to split the input into chunks of up to 64KB
|
||||||
|
chunkSize := bufio.MaxScanTokenSize // 64KB
|
||||||
|
splitFunc := func(data []byte, atEOF bool) (int, []byte, error) {
|
||||||
|
if len(data) >= chunkSize {
|
||||||
|
return chunkSize, data[:chunkSize], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return bufio.ScanLines(data, atEOF)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use the custom split function to split the input
|
||||||
|
scanner.Split(splitFunc)
|
||||||
|
|
||||||
|
// Scan the input and write it to the logger using the specified print function
|
||||||
|
for scanner.Scan() {
|
||||||
|
printFunc(strings.TrimRight(scanner.Text(), "\r\n"))
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there was an error while scanning the input, log an error
|
||||||
if err := scanner.Err(); err != nil {
|
if err := scanner.Err(); err != nil {
|
||||||
entry.Errorf("Error while reading from Writer: %s", err)
|
entry.Errorf("Error while reading from Writer: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Close the reader when we are done
|
||||||
reader.Close()
|
reader.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WriterFinalizer is a finalizer function that closes then given writer when it is garbage collected
|
||||||
func writerFinalizer(writer *io.PipeWriter) {
|
func writerFinalizer(writer *io.PipeWriter) {
|
||||||
writer.Close()
|
writer.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-5
@@ -88,13 +88,9 @@ func (p *pipe) Write(d []byte) (n int, err error) {
|
|||||||
p.c.L = &p.mu
|
p.c.L = &p.mu
|
||||||
}
|
}
|
||||||
defer p.c.Signal()
|
defer p.c.Signal()
|
||||||
if p.err != nil {
|
if p.err != nil || p.breakErr != nil {
|
||||||
return 0, errClosedPipeWrite
|
return 0, errClosedPipeWrite
|
||||||
}
|
}
|
||||||
if p.breakErr != nil {
|
|
||||||
p.unread += len(d)
|
|
||||||
return len(d), nil // discard when there is no reader
|
|
||||||
}
|
|
||||||
return p.b.Write(d)
|
return p.b.Write(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -1822,15 +1822,18 @@ func (sc *serverConn) processData(f *DataFrame) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(data) > 0 {
|
if len(data) > 0 {
|
||||||
|
st.bodyBytes += int64(len(data))
|
||||||
wrote, err := st.body.Write(data)
|
wrote, err := st.body.Write(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// The handler has closed the request body.
|
||||||
|
// Return the connection-level flow control for the discarded data,
|
||||||
|
// but not the stream-level flow control.
|
||||||
sc.sendWindowUpdate(nil, int(f.Length)-wrote)
|
sc.sendWindowUpdate(nil, int(f.Length)-wrote)
|
||||||
return sc.countError("body_write_err", streamError(id, ErrCodeStreamClosed))
|
return nil
|
||||||
}
|
}
|
||||||
if wrote != len(data) {
|
if wrote != len(data) {
|
||||||
panic("internal error: bad Writer")
|
panic("internal error: bad Writer")
|
||||||
}
|
}
|
||||||
st.bodyBytes += int64(len(data))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return any padded flow control now, since we won't
|
// Return any padded flow control now, since we won't
|
||||||
|
|||||||
+30
-11
@@ -560,10 +560,11 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res
|
|||||||
traceGotConn(req, cc, reused)
|
traceGotConn(req, cc, reused)
|
||||||
res, err := cc.RoundTrip(req)
|
res, err := cc.RoundTrip(req)
|
||||||
if err != nil && retry <= 6 {
|
if err != nil && retry <= 6 {
|
||||||
|
roundTripErr := err
|
||||||
if req, err = shouldRetryRequest(req, err); err == nil {
|
if req, err = shouldRetryRequest(req, err); err == nil {
|
||||||
// After the first retry, do exponential backoff with 10% jitter.
|
// After the first retry, do exponential backoff with 10% jitter.
|
||||||
if retry == 0 {
|
if retry == 0 {
|
||||||
t.vlogf("RoundTrip retrying after failure: %v", err)
|
t.vlogf("RoundTrip retrying after failure: %v", roundTripErr)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
backoff := float64(uint(1) << (uint(retry) - 1))
|
backoff := float64(uint(1) << (uint(retry) - 1))
|
||||||
@@ -572,7 +573,7 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res
|
|||||||
timer := backoffNewTimer(d)
|
timer := backoffNewTimer(d)
|
||||||
select {
|
select {
|
||||||
case <-timer.C:
|
case <-timer.C:
|
||||||
t.vlogf("RoundTrip retrying after failure: %v", err)
|
t.vlogf("RoundTrip retrying after failure: %v", roundTripErr)
|
||||||
continue
|
continue
|
||||||
case <-req.Context().Done():
|
case <-req.Context().Done():
|
||||||
timer.Stop()
|
timer.Stop()
|
||||||
@@ -1265,6 +1266,27 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) {
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cancelRequest := func(cs *clientStream, err error) error {
|
||||||
|
cs.cc.mu.Lock()
|
||||||
|
defer cs.cc.mu.Unlock()
|
||||||
|
cs.abortStreamLocked(err)
|
||||||
|
if cs.ID != 0 {
|
||||||
|
// This request may have failed because of a problem with the connection,
|
||||||
|
// or for some unrelated reason. (For example, the user might have canceled
|
||||||
|
// the request without waiting for a response.) Mark the connection as
|
||||||
|
// not reusable, since trying to reuse a dead connection is worse than
|
||||||
|
// unnecessarily creating a new one.
|
||||||
|
//
|
||||||
|
// If cs.ID is 0, then the request was never allocated a stream ID and
|
||||||
|
// whatever went wrong was unrelated to the connection. We might have
|
||||||
|
// timed out waiting for a stream slot when StrictMaxConcurrentStreams
|
||||||
|
// is set, for example, in which case retrying on a different connection
|
||||||
|
// will not help.
|
||||||
|
cs.cc.doNotReuse = true
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-cs.respHeaderRecv:
|
case <-cs.respHeaderRecv:
|
||||||
@@ -1279,15 +1301,12 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) {
|
|||||||
return handleResponseHeaders()
|
return handleResponseHeaders()
|
||||||
default:
|
default:
|
||||||
waitDone()
|
waitDone()
|
||||||
return nil, cs.abortErr
|
return nil, cancelRequest(cs, cs.abortErr)
|
||||||
}
|
}
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
err := ctx.Err()
|
return nil, cancelRequest(cs, ctx.Err())
|
||||||
cs.abortStream(err)
|
|
||||||
return nil, err
|
|
||||||
case <-cs.reqCancel:
|
case <-cs.reqCancel:
|
||||||
cs.abortStream(errRequestCanceled)
|
return nil, cancelRequest(cs, errRequestCanceled)
|
||||||
return nil, errRequestCanceled
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2555,6 +2574,9 @@ func (b transportResponseBody) Close() error {
|
|||||||
cs := b.cs
|
cs := b.cs
|
||||||
cc := cs.cc
|
cc := cs.cc
|
||||||
|
|
||||||
|
cs.bufPipe.BreakWithError(errClosedResponseBody)
|
||||||
|
cs.abortStream(errClosedResponseBody)
|
||||||
|
|
||||||
unread := cs.bufPipe.Len()
|
unread := cs.bufPipe.Len()
|
||||||
if unread > 0 {
|
if unread > 0 {
|
||||||
cc.mu.Lock()
|
cc.mu.Lock()
|
||||||
@@ -2573,9 +2595,6 @@ func (b transportResponseBody) Close() error {
|
|||||||
cc.wmu.Unlock()
|
cc.wmu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
cs.bufPipe.BreakWithError(errClosedResponseBody)
|
|
||||||
cs.abortStream(errClosedResponseBody)
|
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-cs.donec:
|
case <-cs.donec:
|
||||||
case <-cs.ctx.Done():
|
case <-cs.ctx.Done():
|
||||||
|
|||||||
+1
-1
@@ -289,7 +289,7 @@ func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter,
|
|||||||
case AuthMethodNotRequired:
|
case AuthMethodNotRequired:
|
||||||
return nil
|
return nil
|
||||||
case AuthMethodUsernamePassword:
|
case AuthMethodUsernamePassword:
|
||||||
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) == 0 || len(up.Password) > 255 {
|
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) > 255 {
|
||||||
return errors.New("invalid username/password")
|
return errors.New("invalid username/password")
|
||||||
}
|
}
|
||||||
b := []byte{authUsernamePasswordVersion}
|
b := []byte{authUsernamePasswordVersion}
|
||||||
|
|||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build aix || solaris
|
||||||
|
// +build aix solaris
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req int, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlSetPointerInt performs an ioctl operation which sets an
|
||||||
|
// integer value on fd, using the specified request number. The ioctl
|
||||||
|
// argument is called with a pointer to the integer value, rather than
|
||||||
|
// passing the integer value directly.
|
||||||
|
func IoctlSetPointerInt(fd int, req int, value int) error {
|
||||||
|
v := int32(value)
|
||||||
|
return ioctlPtr(fd, req, unsafe.Pointer(&v))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
|
||||||
|
//
|
||||||
|
// To change fd's window size, the req argument should be TIOCSWINSZ.
|
||||||
|
func IoctlSetWinsize(fd int, req int, value *Winsize) error {
|
||||||
|
// TODO: if we get the chance, remove the req parameter and
|
||||||
|
// hardcode TIOCSWINSZ.
|
||||||
|
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlSetTermios performs an ioctl on fd with a *Termios.
|
||||||
|
//
|
||||||
|
// The req value will usually be TCSETA or TIOCSETA.
|
||||||
|
func IoctlSetTermios(fd int, req int, value *Termios) error {
|
||||||
|
// TODO: if we get the chance, remove the req parameter.
|
||||||
|
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
//
|
||||||
|
// A few ioctl requests use the return value as an output parameter;
|
||||||
|
// for those, IoctlRetInt should be used instead of this function.
|
||||||
|
func IoctlGetInt(fd int, req int) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req int) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
Generated
Vendored
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
|
//go:build darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd
|
||||||
// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris
|
// +build darwin dragonfly freebsd hurd linux netbsd openbsd
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
+6
-6
@@ -17,14 +17,14 @@ import (
|
|||||||
|
|
||||||
// IoctlSetInt performs an ioctl operation which sets an integer value
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
// on fd, using the specified request number.
|
// on fd, using the specified request number.
|
||||||
func IoctlSetInt(fd int, req uint, value int) error {
|
func IoctlSetInt(fd int, req int, value int) error {
|
||||||
return ioctl(fd, req, uintptr(value))
|
return ioctl(fd, req, uintptr(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
|
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
|
||||||
//
|
//
|
||||||
// To change fd's window size, the req argument should be TIOCSWINSZ.
|
// To change fd's window size, the req argument should be TIOCSWINSZ.
|
||||||
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
func IoctlSetWinsize(fd int, req int, value *Winsize) error {
|
||||||
// TODO: if we get the chance, remove the req parameter and
|
// TODO: if we get the chance, remove the req parameter and
|
||||||
// hardcode TIOCSWINSZ.
|
// hardcode TIOCSWINSZ.
|
||||||
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
||||||
@@ -33,7 +33,7 @@ func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
|||||||
// IoctlSetTermios performs an ioctl on fd with a *Termios.
|
// IoctlSetTermios performs an ioctl on fd with a *Termios.
|
||||||
//
|
//
|
||||||
// The req value is expected to be TCSETS, TCSETSW, or TCSETSF
|
// The req value is expected to be TCSETS, TCSETSW, or TCSETSF
|
||||||
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
func IoctlSetTermios(fd int, req int, value *Termios) error {
|
||||||
if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) {
|
if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) {
|
||||||
return ENOSYS
|
return ENOSYS
|
||||||
}
|
}
|
||||||
@@ -47,13 +47,13 @@ func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
|||||||
//
|
//
|
||||||
// A few ioctl requests use the return value as an output parameter;
|
// A few ioctl requests use the return value as an output parameter;
|
||||||
// for those, IoctlRetInt should be used instead of this function.
|
// for those, IoctlRetInt should be used instead of this function.
|
||||||
func IoctlGetInt(fd int, req uint) (int, error) {
|
func IoctlGetInt(fd int, req int) (int, error) {
|
||||||
var value int
|
var value int
|
||||||
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
return value, err
|
return value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
|
||||||
var value Winsize
|
var value Winsize
|
||||||
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
return &value, err
|
return &value, err
|
||||||
@@ -62,7 +62,7 @@ func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
|||||||
// IoctlGetTermios performs an ioctl on fd with a *Termios.
|
// IoctlGetTermios performs an ioctl on fd with a *Termios.
|
||||||
//
|
//
|
||||||
// The req value is expected to be TCGETS
|
// The req value is expected to be TCGETS
|
||||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
func IoctlGetTermios(fd int, req int) (*Termios, error) {
|
||||||
var value Termios
|
var value Termios
|
||||||
if req != TCGETS {
|
if req != TCGETS {
|
||||||
return &value, ENOSYS
|
return &value, ENOSYS
|
||||||
|
|||||||
+4
-1
@@ -66,6 +66,7 @@ includes_Darwin='
|
|||||||
#include <sys/ptrace.h>
|
#include <sys/ptrace.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#include <sys/sys_domain.h>
|
#include <sys/sys_domain.h>
|
||||||
@@ -203,6 +204,7 @@ struct ltchars {
|
|||||||
#include <sys/timerfd.h>
|
#include <sys/timerfd.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/xattr.h>
|
#include <sys/xattr.h>
|
||||||
|
#include <netinet/udp.h>
|
||||||
#include <linux/audit.h>
|
#include <linux/audit.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/can.h>
|
#include <linux/can.h>
|
||||||
@@ -517,10 +519,11 @@ ccflags="$@"
|
|||||||
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
|
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
|
||||||
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
|
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
|
||||||
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
|
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
|
||||||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT)_/ ||
|
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ ||
|
||||||
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
|
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
|
||||||
$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
|
$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
|
||||||
$2 ~ /^RAW_PAYLOAD_/ ||
|
$2 ~ /^RAW_PAYLOAD_/ ||
|
||||||
|
$2 ~ /^[US]F_/ ||
|
||||||
$2 ~ /^TP_STATUS_/ ||
|
$2 ~ /^TP_STATUS_/ ||
|
||||||
$2 ~ /^FALLOC_/ ||
|
$2 ~ /^FALLOC_/ ||
|
||||||
$2 ~ /^ICMPV?6?_(FILTER|SEC)/ ||
|
$2 ~ /^ICMPV?6?_(FILTER|SEC)/ ||
|
||||||
|
|||||||
+2
-2
@@ -408,8 +408,8 @@ func (w WaitStatus) CoreDump() bool { return w&0x80 == 0x80 }
|
|||||||
|
|
||||||
func (w WaitStatus) TrapCause() int { return -1 }
|
func (w WaitStatus) TrapCause() int { return -1 }
|
||||||
|
|
||||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
//sys ioctl(fd int, req int, arg uintptr) (err error)
|
||||||
//sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = ioctl
|
//sys ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) = ioctl
|
||||||
|
|
||||||
// fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX
|
// fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX
|
||||||
// There is no way to create a custom fcntl and to keep //sys fcntl easily,
|
// There is no way to create a custom fcntl and to keep //sys fcntl easily,
|
||||||
|
|||||||
-1
@@ -8,7 +8,6 @@
|
|||||||
package unix
|
package unix
|
||||||
|
|
||||||
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64
|
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64
|
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64
|
||||||
|
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|||||||
-1
@@ -8,7 +8,6 @@
|
|||||||
package unix
|
package unix
|
||||||
|
|
||||||
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
|
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek
|
||||||
|
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64
|
||||||
|
|||||||
+1
-2
@@ -613,6 +613,7 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
|
|||||||
//sys Rmdir(path string) (err error)
|
//sys Rmdir(path string) (err error)
|
||||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
|
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
|
||||||
|
//sys Setattrlist(path string, attrlist *Attrlist, attrBuf []byte, options int) (err error)
|
||||||
//sys Setegid(egid int) (err error)
|
//sys Setegid(egid int) (err error)
|
||||||
//sysnb Seteuid(euid int) (err error)
|
//sysnb Seteuid(euid int) (err error)
|
||||||
//sysnb Setgid(gid int) (err error)
|
//sysnb Setgid(gid int) (err error)
|
||||||
@@ -622,7 +623,6 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
|
|||||||
//sys Setprivexec(flag int) (err error)
|
//sys Setprivexec(flag int) (err error)
|
||||||
//sysnb Setregid(rgid int, egid int) (err error)
|
//sysnb Setregid(rgid int, egid int) (err error)
|
||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
@@ -676,7 +676,6 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
|
|||||||
// Kqueue_from_portset_np
|
// Kqueue_from_portset_np
|
||||||
// Kqueue_portset
|
// Kqueue_portset
|
||||||
// Getattrlist
|
// Getattrlist
|
||||||
// Setattrlist
|
|
||||||
// Getdirentriesattr
|
// Getdirentriesattr
|
||||||
// Searchfs
|
// Searchfs
|
||||||
// Delete
|
// Delete
|
||||||
|
|||||||
-1
@@ -326,7 +326,6 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
|
|||||||
-1
@@ -433,7 +433,6 @@ func Dup3(oldfd, newfd, flags int) error {
|
|||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
|
|||||||
+9
-1
@@ -1873,7 +1873,6 @@ func Getpgrp() (pid int) {
|
|||||||
//sys OpenTree(dfd int, fileName string, flags uint) (r int, err error)
|
//sys OpenTree(dfd int, fileName string, flags uint) (r int, err error)
|
||||||
//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
|
//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
|
||||||
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
|
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
|
||||||
//sysnb Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
|
|
||||||
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
|
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
|
||||||
//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) = SYS_PSELECT6
|
//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) = SYS_PSELECT6
|
||||||
//sys read(fd int, p []byte) (n int, err error)
|
//sys read(fd int, p []byte) (n int, err error)
|
||||||
@@ -1887,6 +1886,15 @@ func Getpgrp() (pid int) {
|
|||||||
//sysnb Settimeofday(tv *Timeval) (err error)
|
//sysnb Settimeofday(tv *Timeval) (err error)
|
||||||
//sys Setns(fd int, nstype int) (err error)
|
//sys Setns(fd int, nstype int) (err error)
|
||||||
|
|
||||||
|
//go:linkname syscall_prlimit syscall.prlimit
|
||||||
|
func syscall_prlimit(pid, resource int, newlimit, old *syscall.Rlimit) error
|
||||||
|
|
||||||
|
func Prlimit(pid, resource int, newlimit, old *Rlimit) error {
|
||||||
|
// Just call the syscall version, because as of Go 1.21
|
||||||
|
// it will affect starting a new process.
|
||||||
|
return syscall_prlimit(pid, resource, (*syscall.Rlimit)(newlimit), (*syscall.Rlimit)(old))
|
||||||
|
}
|
||||||
|
|
||||||
// PrctlRetInt performs a prctl operation specified by option and further
|
// PrctlRetInt performs a prctl operation specified by option and further
|
||||||
// optional arguments arg2 through arg5 depending on option. It returns a
|
// optional arguments arg2 through arg5 depending on option. It returns a
|
||||||
// non-negative integer that is returned by the prctl syscall.
|
// non-negative integer that is returned by the prctl syscall.
|
||||||
|
|||||||
-27
@@ -97,33 +97,6 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
|
|
||||||
|
|
||||||
func Setrlimit(resource int, rlim *Rlimit) (err error) {
|
|
||||||
err = Prlimit(0, resource, rlim, nil)
|
|
||||||
if err != ENOSYS {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
rl := rlimit32{}
|
|
||||||
if rlim.Cur == rlimInf64 {
|
|
||||||
rl.Cur = rlimInf32
|
|
||||||
} else if rlim.Cur < uint64(rlimInf32) {
|
|
||||||
rl.Cur = uint32(rlim.Cur)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
if rlim.Max == rlimInf64 {
|
|
||||||
rl.Max = rlimInf32
|
|
||||||
} else if rlim.Max < uint64(rlimInf32) {
|
|
||||||
rl.Max = uint32(rlim.Max)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
|
|
||||||
return setrlimit(resource, &rl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
||||||
newoffset, errno := seek(fd, offset, whence)
|
newoffset, errno := seek(fd, offset, whence)
|
||||||
if errno != 0 {
|
if errno != 0 {
|
||||||
|
|||||||
-1
@@ -46,7 +46,6 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys setfsgid(gid int) (prev int, err error)
|
//sys setfsgid(gid int) (prev int, err error)
|
||||||
//sys setfsuid(uid int) (prev int, err error)
|
//sys setfsuid(uid int) (prev int, err error)
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||||
|
|
||||||
|
|||||||
-27
@@ -171,33 +171,6 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
|
|
||||||
|
|
||||||
func Setrlimit(resource int, rlim *Rlimit) (err error) {
|
|
||||||
err = Prlimit(0, resource, rlim, nil)
|
|
||||||
if err != ENOSYS {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
rl := rlimit32{}
|
|
||||||
if rlim.Cur == rlimInf64 {
|
|
||||||
rl.Cur = rlimInf32
|
|
||||||
} else if rlim.Cur < uint64(rlimInf32) {
|
|
||||||
rl.Cur = uint32(rlim.Cur)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
if rlim.Max == rlimInf64 {
|
|
||||||
rl.Max = rlimInf32
|
|
||||||
} else if rlim.Max < uint64(rlimInf32) {
|
|
||||||
rl.Max = uint32(rlim.Max)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
|
|
||||||
return setrlimit(resource, &rl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return uint64(r.Uregs[15]) }
|
func (r *PtraceRegs) PC() uint64 { return uint64(r.Uregs[15]) }
|
||||||
|
|
||||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Uregs[15] = uint32(pc) }
|
func (r *PtraceRegs) SetPC(pc uint64) { r.Uregs[15] = uint32(pc) }
|
||||||
|
|||||||
-10
@@ -39,7 +39,6 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys setfsgid(gid int) (prev int, err error)
|
//sys setfsgid(gid int) (prev int, err error)
|
||||||
//sys setfsuid(uid int) (prev int, err error)
|
//sys setfsuid(uid int) (prev int, err error)
|
||||||
//sysnb setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||||
|
|
||||||
@@ -143,15 +142,6 @@ func Getrlimit(resource int, rlim *Rlimit) error {
|
|||||||
return getrlimit(resource, rlim)
|
return getrlimit(resource, rlim)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setrlimit prefers the prlimit64 system call. See issue 38604.
|
|
||||||
func Setrlimit(resource int, rlim *Rlimit) error {
|
|
||||||
err := Prlimit(0, resource, rlim, nil)
|
|
||||||
if err != ENOSYS {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return setrlimit(resource, rlim)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return r.Pc }
|
func (r *PtraceRegs) PC() uint64 { return r.Pc }
|
||||||
|
|
||||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
|
func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
|
||||||
|
|||||||
-5
@@ -126,11 +126,6 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func Setrlimit(resource int, rlim *Rlimit) (err error) {
|
|
||||||
err = Prlimit(0, resource, rlim, nil)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
|
func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
|
||||||
if tv == nil {
|
if tv == nil {
|
||||||
return utimensat(dirfd, path, nil, 0)
|
return utimensat(dirfd, path, nil, 0)
|
||||||
|
|||||||
-1
@@ -37,7 +37,6 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys setfsgid(gid int) (prev int, err error)
|
//sys setfsgid(gid int) (prev int, err error)
|
||||||
//sys setfsuid(uid int) (prev int, err error)
|
//sys setfsuid(uid int) (prev int, err error)
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||||
|
|||||||
-27
@@ -151,33 +151,6 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
|
|
||||||
|
|
||||||
func Setrlimit(resource int, rlim *Rlimit) (err error) {
|
|
||||||
err = Prlimit(0, resource, rlim, nil)
|
|
||||||
if err != ENOSYS {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
rl := rlimit32{}
|
|
||||||
if rlim.Cur == rlimInf64 {
|
|
||||||
rl.Cur = rlimInf32
|
|
||||||
} else if rlim.Cur < uint64(rlimInf32) {
|
|
||||||
rl.Cur = uint32(rlim.Cur)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
if rlim.Max == rlimInf64 {
|
|
||||||
rl.Max = rlimInf32
|
|
||||||
} else if rlim.Max < uint64(rlimInf32) {
|
|
||||||
rl.Max = uint32(rlim.Max)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
|
|
||||||
return setrlimit(resource, &rl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return r.Epc }
|
func (r *PtraceRegs) PC() uint64 { return r.Epc }
|
||||||
|
|
||||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc }
|
func (r *PtraceRegs) SetPC(pc uint64) { r.Epc = pc }
|
||||||
|
|||||||
-27
@@ -159,33 +159,6 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
|
|
||||||
|
|
||||||
func Setrlimit(resource int, rlim *Rlimit) (err error) {
|
|
||||||
err = Prlimit(0, resource, rlim, nil)
|
|
||||||
if err != ENOSYS {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
rl := rlimit32{}
|
|
||||||
if rlim.Cur == rlimInf64 {
|
|
||||||
rl.Cur = rlimInf32
|
|
||||||
} else if rlim.Cur < uint64(rlimInf32) {
|
|
||||||
rl.Cur = uint32(rlim.Cur)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
if rlim.Max == rlimInf64 {
|
|
||||||
rl.Max = rlimInf32
|
|
||||||
} else if rlim.Max < uint64(rlimInf32) {
|
|
||||||
rl.Max = uint32(rlim.Max)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
|
|
||||||
return setrlimit(resource, &rl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint32 { return r.Nip }
|
func (r *PtraceRegs) PC() uint32 { return r.Nip }
|
||||||
|
|
||||||
func (r *PtraceRegs) SetPC(pc uint32) { r.Nip = pc }
|
func (r *PtraceRegs) SetPC(pc uint32) { r.Nip = pc }
|
||||||
|
|||||||
-1
@@ -34,7 +34,6 @@ package unix
|
|||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys setfsgid(gid int) (prev int, err error)
|
//sys setfsgid(gid int) (prev int, err error)
|
||||||
//sys setfsuid(uid int) (prev int, err error)
|
//sys setfsuid(uid int) (prev int, err error)
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
//sys Stat(path string, stat *Stat_t) (err error)
|
||||||
|
|||||||
-1
@@ -38,7 +38,6 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys setfsgid(gid int) (prev int, err error)
|
//sys setfsgid(gid int) (prev int, err error)
|
||||||
//sys setfsuid(uid int) (prev int, err error)
|
//sys setfsuid(uid int) (prev int, err error)
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||||
|
|
||||||
|
|||||||
-1
@@ -34,7 +34,6 @@ import (
|
|||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys setfsgid(gid int) (prev int, err error)
|
//sys setfsgid(gid int) (prev int, err error)
|
||||||
//sys setfsuid(uid int) (prev int, err error)
|
//sys setfsuid(uid int) (prev int, err error)
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
//sys Stat(path string, stat *Stat_t) (err error)
|
||||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||||
|
|||||||
-1
@@ -31,7 +31,6 @@ package unix
|
|||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys setfsgid(gid int) (prev int, err error)
|
//sys setfsgid(gid int) (prev int, err error)
|
||||||
//sys setfsuid(uid int) (prev int, err error)
|
//sys setfsuid(uid int) (prev int, err error)
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
//sys Stat(path string, stat *Stat_t) (err error)
|
||||||
|
|||||||
-2
@@ -340,7 +340,6 @@ func Statvfs(path string, buf *Statvfs_t) (err error) {
|
|||||||
//sys Setpriority(which int, who int, prio int) (err error)
|
//sys Setpriority(which int, who int, prio int) (err error)
|
||||||
//sysnb Setregid(rgid int, egid int) (err error)
|
//sysnb Setregid(rgid int, egid int) (err error)
|
||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
@@ -501,7 +500,6 @@ func Statvfs(path string, buf *Statvfs_t) (err error) {
|
|||||||
// compat_43_osendmsg
|
// compat_43_osendmsg
|
||||||
// compat_43_osethostid
|
// compat_43_osethostid
|
||||||
// compat_43_osethostname
|
// compat_43_osethostname
|
||||||
// compat_43_osetrlimit
|
|
||||||
// compat_43_osigblock
|
// compat_43_osigblock
|
||||||
// compat_43_osigsetmask
|
// compat_43_osigsetmask
|
||||||
// compat_43_osigstack
|
// compat_43_osigstack
|
||||||
|
|||||||
-1
@@ -294,7 +294,6 @@ func Uname(uname *Utsname) error {
|
|||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
|
||||||
//sysnb Setrtable(rtable int) (err error)
|
//sysnb Setrtable(rtable int) (err error)
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||||
|
|||||||
+10
-11
@@ -545,24 +545,24 @@ func Minor(dev uint64) uint32 {
|
|||||||
* Expose the ioctl function
|
* Expose the ioctl function
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//sys ioctlRet(fd int, req uint, arg uintptr) (ret int, err error) = libc.ioctl
|
//sys ioctlRet(fd int, req int, arg uintptr) (ret int, err error) = libc.ioctl
|
||||||
//sys ioctlPtrRet(fd int, req uint, arg unsafe.Pointer) (ret int, err error) = libc.ioctl
|
//sys ioctlPtrRet(fd int, req int, arg unsafe.Pointer) (ret int, err error) = libc.ioctl
|
||||||
|
|
||||||
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
func ioctl(fd int, req int, arg uintptr) (err error) {
|
||||||
_, err = ioctlRet(fd, req, arg)
|
_, err = ioctlRet(fd, req, arg)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) {
|
func ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) {
|
||||||
_, err = ioctlPtrRet(fd, req, arg)
|
_, err = ioctlPtrRet(fd, req, arg)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetTermio(fd int, req uint, value *Termio) error {
|
func IoctlSetTermio(fd int, req int, value *Termio) error {
|
||||||
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetTermio(fd int, req uint) (*Termio, error) {
|
func IoctlGetTermio(fd int, req int) (*Termio, error) {
|
||||||
var value Termio
|
var value Termio
|
||||||
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
return &value, err
|
return &value, err
|
||||||
@@ -665,7 +665,6 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||||||
//sys Setpriority(which int, who int, prio int) (err error)
|
//sys Setpriority(which int, who int, prio int) (err error)
|
||||||
//sysnb Setregid(rgid int, egid int) (err error)
|
//sysnb Setregid(rgid int, egid int) (err error)
|
||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
//sys Shutdown(s int, how int) (err error) = libsocket.shutdown
|
//sys Shutdown(s int, how int) (err error) = libsocket.shutdown
|
||||||
@@ -1080,11 +1079,11 @@ func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags
|
|||||||
return retCl, retData, flags, nil
|
return retCl, retData, flags, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) {
|
func IoctlSetIntRetInt(fd int, req int, arg int) (int, error) {
|
||||||
return ioctlRet(fd, req, uintptr(arg))
|
return ioctlRet(fd, req, uintptr(arg))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetString(fd int, req uint, val string) error {
|
func IoctlSetString(fd int, req int, val string) error {
|
||||||
bs := make([]byte, len(val)+1)
|
bs := make([]byte, len(val)+1)
|
||||||
copy(bs[:len(bs)-1], val)
|
copy(bs[:len(bs)-1], val)
|
||||||
err := ioctlPtr(fd, req, unsafe.Pointer(&bs[0]))
|
err := ioctlPtr(fd, req, unsafe.Pointer(&bs[0]))
|
||||||
@@ -1120,7 +1119,7 @@ func (l *Lifreq) GetLifruUint() uint {
|
|||||||
return *(*uint)(unsafe.Pointer(&l.Lifru[0]))
|
return *(*uint)(unsafe.Pointer(&l.Lifru[0]))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlLifreq(fd int, req uint, l *Lifreq) error {
|
func IoctlLifreq(fd int, req int, l *Lifreq) error {
|
||||||
return ioctlPtr(fd, req, unsafe.Pointer(l))
|
return ioctlPtr(fd, req, unsafe.Pointer(l))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1131,6 +1130,6 @@ func (s *Strioctl) SetInt(i int) {
|
|||||||
s.Dp = (*int8)(unsafe.Pointer(&i))
|
s.Dp = (*int8)(unsafe.Pointer(&i))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) {
|
func IoctlSetStrioctlRetInt(fd int, req int, s *Strioctl) (int, error) {
|
||||||
return ioctlPtrRet(fd, req, unsafe.Pointer(s))
|
return ioctlPtrRet(fd, req, unsafe.Pointer(s))
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -587,3 +587,10 @@ func emptyIovecs(iov []Iovec) bool {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Setrlimit sets a resource limit.
|
||||||
|
func Setrlimit(resource int, rlim *Rlimit) error {
|
||||||
|
// Just call the syscall version, because as of Go 1.21
|
||||||
|
// it will affect starting a new process.
|
||||||
|
return syscall.Setrlimit(resource, (*syscall.Rlimit)(rlim))
|
||||||
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user