Commit graph

43070 commits

Author SHA1 Message Date
Sebastiaan van Stijn
28b0f47599
volume/mounts: add constructors for each parser
This adds constructors for the Linux, Windows, and LCOW,
to allow using these parsers externally.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-02 14:11:50 +02:00
Sebastiaan van Stijn
df179a1d6a
volume/mounts: split tests per parser
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-02 14:08:34 +02:00
Sebastiaan van Stijn
536818508d
volume/mounts: move TestConvertTmpfsOptions
It's only testing the LinuxParser, so moving it to a file specific
to that code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-02 14:05:04 +02:00
Sebastiaan van Stijn
300c11c7c9
volume/mounts: remove "containerOS" argument from NewParser (LCOW code)
This changes mounts.NewParser() to create a parser for the current operatingsystem,
instead of one specific to a (possibly non-matching, in case of LCOW) OS.

With the OS-specific handling being removed, the "OS" parameter is also removed
from `daemon.verifyContainerSettings()`, and various other container-related
functions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-02 13:51:55 +02:00
Sebastiaan van Stijn
f3d08d59aa
volume/mounts: move some code to correct location, and minor linting/formatting
- Remove the windowsparser.HasResource() override, as it was the same on both
  Windows and Linux
- Move the rxLCOWDestination to the lcowParser code
- Move the rwModes variable to a generic (non-platform-specific) file, as it's
  used both for the windowsParser and the linuxParser
- Some minor formatting and linting changes

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-02 13:25:27 +02:00
Roman Volosatovs
af3e5568fc
daemon/images: fix shared size computation for filtered requests
Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
2021-07-02 11:46:25 +02:00
Adam Williams
a8d92be6e8 Use crypto/rand
Signed-off-by: Adam Williams <awilliams@mirantis.com>
2021-07-01 14:15:39 -07:00
Adam Williams
9f0e268b00 Fix use of unsafe ptr #42444
Signed-off-by: Adam Williams <awilliams@mirantis.com>
2021-07-01 12:24:33 -07:00
Roman Volosatovs
b308097ec3
daemon/images: refactor image listing
- Rename image summary constructor
    - Rename `newImage` into `newImageSummary`, since the returned type is
      `*types.ImageSummary`
- Rename variables for clarity
    - Rename `newImage` into `summary`, since the variable type is
      `*types.ImageSummary`
    - Rename `imagesMap` into `summaryMap`, since the value type
      contained is `*types.ImageSummary`
- Only compute `DiffSize` when more than 1 reference to the layer
  exists, since it is not used otherwise
- Move variable declarations closer to where they are used

Signed-off-by: Roman Volosatovs <roman.volosatovs@docker.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-30 11:32:32 +02:00
Sebastiaan van Stijn
2a562b1583
Merge pull request #42569 from steffengy/master-2
libnetwork: processEndpointCreate: Fix deadlock between getSvcRecords and processEndpointCreate
2021-06-30 11:09:08 +02:00
Sebastiaan van Stijn
00a4f67ddf
Reduce TestClientWithRequestTimeout flakiness
The test sometimes failed because no error was returned:

    === Failed
    === FAIL: pkg/plugins TestClientWithRequestTimeout (0.00s)
         client_test.go:254: assertion failed: expected an error, got nil: expected error

Possibly caused by a race condition, as the sleep was just 1 ms longer than the timeout;
this patch is increasing the sleep in the response to try to reduce flakiness.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-29 23:53:23 +02:00
Stefan Scherer
7a6cac2b23
Run s390x tests on Ubuntu 20.04
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
2021-06-29 17:33:40 +02:00
Steffen Butzer
0c1a125644 libnetwork: processEndpointCreate: Fix deadlock between getSvcRecords and processEndpointCreate
References https://github.com/moby/moby/pull/42545

Signed-off-by: Steffen Butzer <steffen.butzer@outlook.com>
2021-06-29 08:07:14 +02:00
Sebastiaan van Stijn
d12fc17073
Merge pull request #42571 from xiaoding945/master
file mkimage-rinse.sh has been abort, should modify the script annotation
2021-06-28 19:58:33 +02:00
Akihiro Suda
1e71c6cffe
Merge pull request #42567 from thaJeztah/remove_unused_const 2021-06-28 23:24:37 +09:00
dingwei
345a180a55 there is no file named mkimage-rinse.sh in contrib floder, should delete
it

Signed-off-by: dingwei <dingwei@cmss.chinamobile.com>
2021-06-28 17:36:34 +08:00
Sebastiaan van Stijn
665de2e973
Merge pull request #42528 from thaJeztah/jenkins_windows_containerd
Jenkinsfile: add stage for Windows 2022 on containerd
2021-06-28 09:35:03 +02:00
Sebastiaan van Stijn
050929ab83
Merge pull request #42539 from cpuguy83/libnet_cleanup
Various libnetwork cleanups
2021-06-26 22:25:27 +02:00
Tianon Gravi
4b4e4c7c69
Merge pull request #42557 from thaJeztah/remove_report_issue
contrib: remove report-issue.sh script
2021-06-25 22:24:32 -07:00
Sebastiaan van Stijn
2050e085f9
hack: remove proxy.installer
It's no longer used

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-25 18:02:51 +02:00
Brian Goff
2bec9f607f
Remove spurious libnetwork vendor entry.
Not sure how this got added in there...

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-25 18:02:05 +02:00
Brian Goff
116f200737
Fix gosec complaints in libnetwork
These were purposefully ignored before but this goes ahead and "fixes"
most of them.
Note that none of the things gosec flagged are problematic, just
quieting the linter here.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-25 18:02:03 +02:00
Brian Goff
0645eb8461
Remove libnetwork/client package
This is another one of those tools to mimic the docker network cli.
It is not needed anymore, along with an old fork of the docker flag
packages which was a fork of the go flag package.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-25 18:02:00 +02:00
Brian Goff
e7cf711c02
Move proxy CLI to main cmd/
Since this command is part of the official distribution and even
required for tests, let's move this up to the main cmd's.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-25 18:01:55 +02:00
Brian Goff
7266a956a8
Remove dnet libnetwork cli
This was used for testing purposes when libnetwork was in a separate
repo.
Now that it is integrated we no longer need it since dockerd and docker
cli provide the same function.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-25 17:59:04 +02:00
Brian Goff
42bcc2df68
Remove leftovers from libnetwork move
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-06-25 17:59:01 +02:00
Akihiro Suda
159bad5332
Merge pull request #42450 from AkihiroSuda/runc-v1.0.0
update runc binary to v1.0.0 GA
2021-06-25 13:54:29 +09:00
Sebastiaan van Stijn
b5835646eb
registry: remove const for 'Docker-Distribution-Api-Version' header
This header was used for fallbacks to v1 registries, but it's no longer
used, and marked optional / legacy in the OCI distribution-spec:

https://github.com/opencontainers/distribution-spec/blob/v1.0.0/spec.md#legacy-docker-support-http-headers

> Because of the origins this specification, the client MAY encounter
> Docker-specific headers, such as `Docker-Content-Digest`, or
> `Docker-Distribution-API-Version`. These headers are OPTIONAL and
> clients SHOULD NOT depend on them.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-24 22:08:28 +02:00
Sebastiaan van Stijn
7d471d88a0
Merge pull request #42524 from fredericdalleau/crossbuild
Crosscompilation for s390x and ppc64le
2021-06-24 21:23:27 +02:00
Sebastiaan van Stijn
301be64d41
Merge pull request #42515 from geaaru/permit-override-name
ReplaceFileTarWrapper: permit to override file name
2021-06-24 21:01:08 +02:00
Frédéric Dalleau
e93132e273 Add s390x to cross platforms target
Update build script and buid environment for supporting s390x
Signed-off-by: Frédéric Dalleau <frederic.dalleau@docker.com>
2021-06-24 18:52:55 +02:00
Frédéric Dalleau
3a208c0ff9 Add ppc64le to cross platforms target
debian uses ppc64el
go uses ppc64le
the cross compiler is powerpc64le
Signed-off-by: Frédéric Dalleau <frederic.dalleau@docker.com>
2021-06-24 18:51:49 +02:00
Sebastiaan van Stijn
8a529d4e2e
Merge pull request #42565 from aiordache/update_validate_flag
Make `validate` flag description more generic
2021-06-24 18:13:33 +02:00
aiordache
f558056d2b Make validate flag description more generic
Signed-off-by: aiordache <anca.iordache@docker.com>
2021-06-24 15:43:28 +00:00
Sebastiaan van Stijn
9973dc67dd
Jenkinsfile: add stage for Windows 2022 on containerd
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-24 10:24:59 +02:00
Sebastiaan van Stijn
314759dc2f
Merge pull request #42393 from aiordache/daemon_config
Daemon config validation
2021-06-23 19:32:07 +02:00
Rich Horwood
8f80e55111 Add configuration validation option and tests.
Fixes #36911

If config file is invalid we'll exit anyhow, so this just prevents
the daemon from starting if the configuration is fine.

Mainly useful for making config changes and restarting the daemon
iff the config is valid.

Signed-off-by: Rich Horwood <rjhorwood@apple.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
2021-06-23 09:54:55 +00:00
Sebastiaan van Stijn
52744fccdd
contrib: remove report-issue.sh script
I don't think this script was really used, and now that GitHub has
issue templates, it will diverge from the template we have configured,
so better to remove it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-23 10:17:43 +02:00
Frédéric Dalleau
7168d98c43 Remove libseccomp dependency in runtime-dev-cross-true image
It turns out libseccomp is not used for building docker at all.
It is only used for building runc (and needs libseccomp > 2.4)

Signed-off-by: Frédéric Dalleau <frederic.dalleau@docker.com>
2021-06-22 22:18:03 +02:00
Sebastiaan van Stijn
ee8f581167
Merge pull request #42552 from thaJeztah/jenkins_cross
Fix cross compilation in Jenkinsfile
2021-06-22 22:13:37 +02:00
Steffen Butzer
7c97896747 libnetwork: processEndpointDelete: Fix deadlock between getSvcRecords and processEndpointDelete
We had some hosts with quite a bit of cycling containers that ocassionally causes docker daemons to lock up.
Most prominently `docker run` commands do not respond and nothing happens anymore.

Looking at the stack trace the following is at least likely sometimes a cause to that:
Two goroutines g0 and g1 can race against each other:
* (g0) 1. getSvcRecords is called and calls (*network).Lock()
       --> Network is locked.
* (g1) 2. processEndpointDelete is called, and calls (*controller).Lock()
       --> Controller is locked
* (g1) 3. processEndpointDelete tries (*network).ID() which calls (*network).Lock().
* (g0) 4. getSvcRecords calls (*controller).Lock().

3./4. are deadlocked against each other since the other goroutine holds the lock they need.

References b5dc370370/network.go

Signed-off-by: Steffen Butzer <steffen.butzer@outlook.com>
2021-06-22 16:05:20 +02:00
Frédéric Dalleau
72549d4ca1 Fix cross compilation in Jenkinsfile
Signed-off-by: Frédéric Dalleau <frederic.dalleau@docker.com>
2021-06-22 12:05:51 +02:00
Akihiro Suda
64badfc018
update runc binary to v1.0.0 GA
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-06-22 15:07:48 +09:00
Akihiro Suda
25917217ca
Merge pull request #42535 from thaJeztah/remove_depecated_osversion 2021-06-22 09:06:23 +09:00
Sebastiaan van Stijn
44269c6653
Merge pull request #42537 from dperny/vendor-swarmkit-fix-logbroker-deadlock
vendor: swarmkit to fix deadlock in log broker.
2021-06-21 14:32:47 +02:00
Lei Jitang
cda846e9a8
Merge pull request #42541 from yalpul/patch-1
Fix typo in macvlan_setup.go
2021-06-21 13:39:01 +02:00
Sebastiaan van Stijn
af1e74555a
vendor: moby/term, Azure/go-ansiterm for golang.org/x/sys/windows compatibility
- winterm: GetStdFile(): Added compatibility with "golang.org/x/sys/windows"
- winterm: fix GetStdFile() falltrough
- update deprecation message to refer to the correct replacement
- add go.mod
- Fix int overflow
- Convert int to string using rune()

full diff:

- bea5bbe245...3f7ff695ad
- d6e3b3328b...d185dfc1b5

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-21 13:25:06 +02:00
Samuel Karp
bdd90773ef
Merge pull request #42502 from thaJeztah/netutils_cleanup 2021-06-19 20:40:40 -07:00
Akihiro Suda
8610d8ce4c
rootless: fix "x509: certificate signed by unknown authority" on openSUSE Tumbleweed
openSUSE Tumbleweed was facing "x509: certificate signed by unknown authority" error,
as `/etc/ssl/ca-bundle.pem` is provided as a symlink to `../../var/lib/ca-certificates/ca-bundle.pem`,
which was not supported by `rootlesskit --copy-up=/etc` .

See rootless-containers/rootlesskit issues 225

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-06-19 18:21:18 +09:00
yalpul
967ec6f2e8 Fix typo in macvlan_setup.go
Signed-off-by: yalpul <yalpul@gmail.com>
2021-06-19 11:36:16 +03:00