Compare commits

...

56 Commits

Author SHA1 Message Date
Eli Uriegas a6743090d7
[19.03 backport] update Golang 1.12.12 (CVE-2019-17596) (#400)
[19.03 backport] update Golang 1.12.12 (CVE-2019-17596)
2019-10-20 14:51:41 -07:00
Sebastiaan van Stijn 8ededb10be
Update Golang 1.12.12 (CVE-2019-17596)
Golang 1.12.12
-------------------------------

go1.12.12 (released 2019/10/17) includes fixes to the go command, runtime,
syscall and net packages. See the Go 1.12.12 milestone on our issue tracker for
details.

https://github.com/golang/go/issues?q=milestone%3AGo1.12.12

Golang 1.12.11 (CVE-2019-17596)
-------------------------------

go1.12.11 (released 2019/10/17) includes security fixes to the crypto/dsa
package. See the Go 1.12.11 milestone on our issue tracker for details.
https://github.com/golang/go/issues?q=milestone%3AGo1.12.11

[security] Go 1.13.2 and Go 1.12.11 are released

Hi gophers,

We have just released Go 1.13.2 and Go 1.12.11 to address a recently reported
security issue. We recommend that all affected users update to one of these
releases (if you're not sure which, choose Go 1.13.2).

Invalid DSA public keys can cause a panic in dsa.Verify. In particular, using
crypto/x509.Verify on a crafted X.509 certificate chain can lead to a panic,
even if the certificates don't chain to a trusted root. The chain can be
delivered via a crypto/tls connection to a client, or to a server that accepts
and verifies client certificates. net/http clients can be made to crash by an
HTTPS server, while net/http servers that accept client certificates will
recover the panic and are unaffected.

Moreover, an application might crash invoking
crypto/x509.(*CertificateRequest).CheckSignature on an X.509 certificate
request, parsing a golang.org/x/crypto/openpgp Entity, or during a
golang.org/x/crypto/otr conversation. Finally, a golang.org/x/crypto/ssh client
can panic due to a malformed host key, while a server could panic if either
PublicKeyCallback accepts a malformed public key, or if IsUserAuthority accepts
a certificate with a malformed public key.

The issue is CVE-2019-17596 and Go issue golang.org/issue/34960.

Thanks to Daniel Mandragona for discovering and reporting this issue. We'd also
like to thank regilero for a previous disclosure of CVE-2019-16276.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f9eab1b87b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-20 18:01:09 +02:00
docker-unir[bot] 5707b8da0a
Merge pull request #388 from tiborvass/19.03-buildx-update
Merged with https://github.com/seemethere/unir
2019-09-27 22:15:57 +00:00
Andrew Hsu f9fbad369b
Merge pull request #386 from thaJeztah/19.03_backport_bump_golang_1.12.10
[19.03 backport] bump golang 1.12.10 (CVE-2019-16276)
2019-09-27 11:19:24 -07:00
Tibor Vass 46178072a3 plugins: pin buildx to v0.3.1
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 41dfc516cd)
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-09-27 18:06:30 +00:00
Sebastiaan van Stijn efd4275efe
bump golang 1.12.10 (CVE-2019-16276)
full diff: https://github.com/golang/go/compare/go1.12.9...go1.12.10

```
Hi gophers,

We have just released Go 1.13.1 and Go 1.12.10 to address a recently reported security issue. We recommend that all affected users update to one of these releases (if you're not sure which, choose Go 1.13.1).

net/http (through net/textproto) used to accept and normalize invalid HTTP/1.1 headers with a space before the colon, in violation of RFC 7230. If a Go server is used behind an uncommon reverse proxy that accepts and forwards but doesn't normalize such invalid headers, the reverse proxy and the server can interpret the headers differently. This can lead to filter bypasses or request smuggling, the latter if requests from separate clients are multiplexed onto the same upstream connection by the proxy. Such invalid headers are now rejected by Go servers, and passed without normalization to Go client applications.

The issue is CVE-2019-16276 and Go issue golang.org/issue/34540.

Thanks to Andrew Stucki, Adam Scarr (99designs.com), and Jan Masarik (masarik.sh) for discovering and reporting this issue.

Downloads are available at https://golang.org/dl for all supported platforms.

Alla prossima,
Filippo on behalf of the Go team
```

From the patch: 6e6f4aaf70

```
net/textproto: don't normalize headers with spaces before the colon

RFC 7230 is clear about headers with a space before the colon, like

X-Answer : 42

being invalid, but we've been accepting and normalizing them for compatibility
purposes since CL 5690059 in 2012.

On the client side, this is harmless and indeed most browsers behave the same
to this day. On the server side, this becomes a security issue when the
behavior doesn't match that of a reverse proxy sitting in front of the server.

For example, if a WAF accepts them without normalizing them, it might be
possible to bypass its filters, because the Go server would interpret the
header differently. Worse, if the reverse proxy coalesces requests onto a
single HTTP/1.1 connection to a Go server, the understanding of the request
boundaries can get out of sync between them, allowing an attacker to tack an
arbitrary method and path onto a request by other clients, including
authentication headers unknown to the attacker.

This was recently presented at multiple security conferences:
https://portswigger.net/blog/http-desync-attacks-request-smuggling-reborn

net/http servers already reject header keys with invalid characters.
Simply stop normalizing extra spaces in net/textproto, let it return them
unchanged like it does for other invalid headers, and let net/http enforce
RFC 7230, which is HTTP specific. This loses us normalization on the client
side, but there's no right answer on the client side anyway, and hiding the
issue sounds worse than letting the application decide.
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7847c12a44)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-27 17:17:07 +02:00
docker-unir[bot] 8489bbbc5e
Merge pull request #384 from zelahi/backport-plugins-dir-change
Merged with https://github.com/seemethere/unir
2019-09-26 14:42:12 +00:00
Zuhayr Elahi 9703ea748d
realpath for plugins directory
Signed-off-by: Zuhayr Elahi <elahi.zuhayr@gmail.com>
2019-09-25 14:45:37 -07:00
Eli Uriegas fc942130a1
[19.03 backport] Pin buildx plugin to v0.3.0, and allow overridi… (#382)
[19.03 backport] Pin buildx plugin to v0.3.0, and allow overriding
2019-09-25 08:48:40 -07:00
docker-unir[bot] 21096e8a01
Merge pull request #380 from thaJeztah/19.03_backport_bump_go_1.12.9
Merged with https://github.com/seemethere/unir
2019-09-25 15:48:12 +00:00
Eli Uriegas 146a09e4a1
[19.03 backport] RPM spec: remove -ce suffix from distribution_b… (#379)
[19.03 backport] RPM spec: remove -ce suffix from distribution_based_engine JSON
2019-09-25 08:47:50 -07:00
Sebastiaan van Stijn 5c81ea3060
Pin buildx plugin to v0.3.0, and allow overriding
Commit 9a5aabdaff removed the fixed
version for this plugin, and changed it to install from "master",
which made the build non-reproducible.

This patch pins the plugin to a specific tag/release again, but allow
overriding by setting the `BUILDX_COMMIT` env-var.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ffee8a345b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-24 13:28:20 +02:00
Jintao Zhang a67e30e824
Bump Golang 1.12.9
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
(cherry picked from commit cc3b9fb951)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-16 16:48:33 +02:00
Sebastiaan van Stijn c621124f33
Makefile: realpath engine-, cli-dir
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2929c9b1e8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-16 16:47:49 +02:00
Sebastiaan van Stijn 14beb3692f
Makefile: use include for common variables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit fe23576b64)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-16 16:47:36 +02:00
Sebastiaan van Stijn 7789c00ded
Makefile: set STATIC_VERSION only if empty
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3b8cc28c3f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-16 16:47:24 +02:00
zelahi 524b348030
FIX pathing issue with cli dir
(cherry picked from commit 0df1091054)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-16 16:43:18 +02:00
zelahi 0ca225ae71
FIXED retrieving GO_VERSION from the CLI dir
Signed-off-by: zelahi <elahi.zuhayr@gmail.com>
(cherry picked from commit 5f1afbb139)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-16 16:41:43 +02:00
Sebastiaan van Stijn 41debafef5
Revert "FIX pathing issue with cli dir"
This reverts commit a1419a7ed5.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-16 16:40:59 +02:00
Sebastiaan van Stijn 2dd0ad1454
RPM spec: remove -ce suffix from distribution_based_engine JSON
Noticed this failing in internal e2e tests on CentOS:

```
sudo docker engine activate --license /tmp/docker.lic
unable to determine the installed engine version. Specify which engine image to update with --engine-image: open /var/lib/docker-engine/distribution_based_engine.json: no such file or directory
```

Looks lik 09b3ac888d changed the name of this
file from `distribution_based_engine-ce.json` to `distribution_based_engine.json`
(without `-ce` suffix) for the `.deb` packages, but did not update
the RPM packages accordingly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 77878ffa48)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-10 14:50:59 +02:00
docker-unir[bot] 69a80d69c6
Merge pull request #376 from seemethere/cherry_pick_pathing
Merged with https://github.com/seemethere/unir
2019-08-15 22:30:07 +00:00
zelahi a1419a7ed5
FIX pathing issue with cli dir
(cherry picked from commit 0df1091054)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2019-08-15 21:53:44 +00:00
docker-unir[bot] b2d11e82bd
Merge pull request #371 from thaJeztah/19.03_backport_bump_golang_1.12.8
Merged with https://github.com/seemethere/unir
2019-08-14 19:18:48 +00:00
Sebastiaan van Stijn 75cd53f9aa
Bump golang 1.12.8 (CVE-2019-9512, CVE-2019-9514)
go1.12.8 (released 2019/08/13) includes security fixes to the net/http and net/url packages.
See the Go 1.12.8 milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.12.8

- net/http: Denial of Service vulnerabilities in the HTTP/2 implementation
  net/http and golang.org/x/net/http2 servers that accept direct connections from untrusted
  clients could be remotely made to allocate an unlimited amount of memory, until the program
  crashes. Servers will now close connections if the send queue accumulates too many control
  messages.
  The issues are CVE-2019-9512 and CVE-2019-9514, and Go issue golang.org/issue/33606.
  Thanks to Jonathan Looney from Netflix for discovering and reporting these issues.
  This is also fixed in version v0.0.0-20190813141303-74dc4d7220e7 of golang.org/x/net/http2.
  net/url: parsing validation issue
- url.Parse would accept URLs with malformed hosts, such that the Host field could have arbitrary
  suffixes that would appear in neither Hostname() nor Port(), allowing authorization bypasses
  in certain applications. Note that URLs with invalid, not numeric ports will now return an error
  from url.Parse.
  The issue is CVE-2019-14809 and Go issue golang.org/issue/29098.
  Thanks to Julian Hector and Nikolai Krein from Cure53, and Adi Cohen (adico.me) for discovering
  and reporting this issue.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9f5da37431)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-14 03:16:48 +02:00
Sebastiaan van Stijn 1fd1357036
Pin Golang images to debian stretch variant
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1310e3974e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-14 03:16:38 +02:00
Sebastiaan van Stijn fd776cdf69
Bump Golang 1.12.6
go1.12.6 (released 2019/06/11) includes fixes to the compiler, the linker,
the go command, and the `crypto/x509`, `net/http`, and `os` packages. See
the Go 1.12.6 milestone on our issue tracker for details:
https://github.com/golang/go/issues?q=milestone%3AGo1.12.6

full diff: https://github.com/golang/go/compare/go1.12.5...go1.12.6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 01ba39e597)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-14 03:15:01 +02:00
Eli Uriegas f2f6cd8836
[19.03 backport] Add Raspbian buster (#361)
[19.03 backport] Add Raspbian buster
2019-07-09 12:33:12 -10:00
Nick Danyluk 8dd5998568
switched docker build image to balenalib/rpi-raspbian
(cherry picked from commit 2e38922ed6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-08 10:28:04 +02:00
Nick Danyluk 42d8cc1da4
Fixed duplicates of ubuntu, debian, & raspbian
(cherry picked from commit e6445e38ed)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-08 10:27:54 +02:00
Nick Danyluk a2d120da17
add raspbian buster
(cherry picked from commit 2cbd93cf0d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-08 10:27:50 +02:00
Sebastiaan van Stijn e0e796aa5c
Revert "switch to balenalib/rpi-raspbian because resin/rpi-raspbian is deprecated"
This reverts commit 4581a41a76.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-08 10:27:45 +02:00
Eli Uriegas e27d681dae
[19.03 backport][TAR-849] ADDED Dockerfile for fedora-31 (#362)
[19.03 backport][TAR-849] ADDED Dockerfile for fedora-31
2019-07-06 07:49:36 -10:00
Eli Uriegas 4dc517616a
[19.03] switch to balenalib/rpi-raspbian because resin/rpi-raspb… (#360)
[19.03] switch to balenalib/rpi-raspbian because resin/rpi-raspbian is deprecated
2019-07-06 07:48:33 -10:00
docker-unir[bot] bdcef5cf22
Merge pull request #358 from kolyshkin/19.03-backport-man-fix
Merged with https://github.com/seemethere/unir
2019-07-06 17:48:08 +00:00
zelahi d2f17a65b5
ADDED Dockerfile for fedora-31
(cherry picked from commit 161876db49)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-03 01:04:31 +02:00
Sebastiaan van Stijn 4581a41a76
switch to balenalib/rpi-raspbian because resin/rpi-raspbian is deprecated
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-03 00:54:52 +02:00
Sebastiaan van Stijn 8007c3ea8d TAR-875 Fix man-pages showing "minimized" message
The dh_installman script calls "man" and captures its output to convert manpages
to utf8:

8523120dcc/dh_installman (L298-L316)

however, on minimized Ubuntu systems, man is overridden by a script that outputs
a warning message ("This  system  has been minimized by removing packages and
content ..").

As a result, all man-pages were be overwritten by that message.

This patch restores the actual `man` command before building to
work around this issue.

addresses docker/for-linux#639

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e52fa49844)
2019-07-02 14:49:59 -07:00
Eli Uriegas 7d50c4bb06
[19.03 backport] Sync RPM Spec with downstream EE packaging (#348)
[19.03 backport] Sync RPM Spec with downstream EE packaging
2019-07-02 06:18:45 -10:00
Eli Uriegas fd2fe14139
[19.03 backport] require container-selinux >= 2.74 (#351)
[19.03 backport] require container-selinux >= 2.74
2019-07-02 06:18:23 -10:00
Eli Uriegas 574e120c4e
[19.03 port] Bump containerd.io dep >= 1.2.2-3 (CVE-2019-5736) (#354)
[19.03 port] Bump containerd.io dep >= 1.2.2-3 (CVE-2019-5736)
2019-07-02 06:18:07 -10:00
Eli Uriegas bc3a9b242b
Bump containerd.io dep >= 1.2.2-3 (CVE-2019-5736)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 06b649e2b0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-26 00:54:17 +02:00
Sebastiaan van Stijn b65daefe49
require container-selinux >= 2.74
version 2.9 is really old; this sets the same minimal version
as is used for the containerd.io package

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a246b19b07)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-26 00:47:37 +02:00
Sebastiaan van Stijn 12b807d90a
Remove the pre and posttrans, they weren't useful
On some distros we were encountering errors where `$1` was not being populated
for the 'pre' and 'posttrans' rpm macros, upon closer inspection it
isn't exactly clear why the pre and posttrans macro scripts were exactly
useful since the `%systemd_postun_with_restart` does exactly what those
scripts were doing.

I've tidied up the systemd macros to use `docker.service` instead of
`docker` which seems to function as we'd expect.

taken from downstream commit 62d8413b550659a0b5318346ee2e3d7e4a50bfe1

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit bece037752)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-25 22:27:13 +02:00
Sebastiaan van Stijn 12d40535d5
Sync RPM Spec with EE
- systemd-units -> systemd (taken from 8bb1f0a7a395dfd979cd410b26ef47e55433de32)
- some wording changes (taken from a8c522a7c22c34dc354e91941377a4aadc3ddc4c)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ffcd2256e4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-25 22:27:05 +02:00
Eli Uriegas 734c2e2133
Merge pull request #346 from thaJeztah/19.03_backport_cleanup
[19.03 backport] Removed some unused files, no longer necessary
2019-06-25 09:58:46 -10:00
Eli Uriegas cb016d45ab
Removed some unused files, no longer necessary
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
(cherry picked from commit 701500fafc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-06-25 12:03:43 +02:00
Andrew Hsu a4d4c18505
Merge pull request #338 from thaJeztah/19.03_bump_golang_1.12.5
[19.03 backport] Bump Go 1.12.5
2019-06-11 20:04:31 -07:00
Eli Uriegas faa0a35fd7
[19.03] Bump docker-app to v0.8.0 (#341)
[19.03] Bump docker-app to v0.8.0
2019-06-11 14:32:26 -07:00
Silvin Lubecki d0f93bd00a Bump docker-app to v0.8.0
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2019-06-11 18:22:17 +02:00
Sebastiaan van Stijn a9771e37cf
Bump Go 1.12.5
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0abbdec692)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-27 23:16:29 +03:00
Eli Uriegas 00955cf747
[19.03] Bump docker-app to v0.8.0-rc1 (#335)
[19.03] Bump docker-app to v0.8.0-rc1
2019-05-24 16:27:58 -05:00
Eli Uriegas 54345e398f
Merge pull request #336 from tiborvass/buildx-19.03
[19.03] Add buildx plugin as experimental
2019-05-24 14:49:42 -05:00
Tibor Vass 93bad6c9b6 Add buildx plugin as experimental
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-05-24 17:49:05 +00:00
Silvin Lubecki 47a17b7b01 Bump docker-app to v0.8.0-rc1
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
2019-05-24 18:32:41 +02:00
Andrew Hsu ae606e20a1
Merge pull request #329 from andrewhsu/app
[19.03] Bump docker app to v0.8.0-beta2
2019-05-13 22:32:44 -07:00
Silvin Lubecki dd85ec9dc1 Bump docker app to v0.8.0-beta2
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
(cherry picked from commit 5134bad09f)
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
2019-05-14 05:29:23 +00:00
17 changed files with 161 additions and 135 deletions

View File

@ -1,17 +1,8 @@
SHELL:=/bin/bash
ENGINE_DIR:=$(CURDIR)/../engine
CLI_DIR:=$(CURDIR)/../cli
VERSION?=0.0.0-dev
DOCKER_GITCOMMIT:=abcdefg
ARCH=$(shell uname -m)
STATIC_VERSION=$(shell static/gen-static-ver $(ENGINE_DIR) $(VERSION))
GO_VERSION:=1.12.4
DEFAULT_PRODUCT_LICENSE:=Community Engine
PLATFORM=Docker Engine - Community
BUILDTIME=$(shell date -u -d "@$${SOURCE_DATE_EPOCH:-$$(date +%s)}" --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
export DEFAULT_PRODUCT_LICENSE
export PLATFORM
export BUILDTIME
include common.mk
CLI_DIR:=$(realpath $(CURDIR)/../cli)
ENGINE_DIR:=$(realpath $(CURDIR)/../engine)
STATIC_VERSION:=$(shell static/gen-static-ver $(ENGINE_DIR) $(VERSION))
# Taken from: https://www.cmcrossroads.com/article/printing-value-makefile-variable
print-% : ; @echo $($*)

12
common.mk Normal file
View File

@ -0,0 +1,12 @@
ARCH=$(shell uname -m)
BUILDTIME=$(shell date -u -d "@$${SOURCE_DATE_EPOCH:-$$(date +%s)}" --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
DEFAULT_PRODUCT_LICENSE:=Community Engine
DOCKER_GITCOMMIT:=abcdefg
GO_VERSION:=1.12.12
PLATFORM=Docker Engine - Community
SHELL:=/bin/bash
VERSION?=0.0.0-dev
export BUILDTIME
export DEFAULT_PRODUCT_LICENSE
export PLATFORM

View File

@ -1,11 +0,0 @@
{
"image": "docker.io/${ENGINE_IMAGE}",
"imagePath": "/var/lib/docker-engine/engine.tar",
"namespace":"docker",
"args": [
"--containerd", "/run/containerd/containerd.sock",
"--default-runtime", "containerd",
"--add-runtime", "containerd=runc"
],
"scope": "${ENGINE_SCOPE}"
}

View File

@ -1,17 +0,0 @@
# Common things for containerd functionality
CONTAINERD_PROXY_COMMIT=35c543bd887878714213cf61ee14038499fd25b7
CONTAINERD_SHIM_PROCESS_IMAGE=docker.io/docker/containerd-shim-process:ff98a47
# If containerd is running use that socket instead
ifeq ("$(shell systemctl is-active containerd)", "active")
CONTAINERD_SOCK:=/var/run/containerd/containerd.sock
else
CONTAINERD_SOCK:=/var/run/docker/containerd/docker-containerd.sock
endif
CTR=docker run \
--rm -i \
-v $(CONTAINERD_SOCK):/ours/containerd.sock \
-v $(CURDIR)/artifacts:/artifacts \
docker:18.06.0-ce \
docker-containerd-ctr -a /ours/containerd.sock

View File

@ -1,15 +1,12 @@
include ../containerd.mk
include ../common.mk
SHELL:=/bin/bash
ARCH:=$(shell uname -m)
CLI_DIR:=$(CURDIR)/../../cli
ENGINE_DIR:=$(CURDIR)/../../engine
CLI_DIR:=$(realpath $(CURDIR)/../../cli)
ENGINE_DIR:=$(realpath $(CURDIR)/../../engine)
PLUGINS_DIR:=$(realpath $(CURDIR)/../plugins)
GITCOMMIT?=$(shell cd $(CLI_DIR) && git rev-parse --short HEAD)
VERSION?=0.0.0-dev
STATIC_VERSION=$(shell ../static/gen-static-ver $(ENGINE_DIR) $(VERSION))
STATIC_VERSION:=$(shell ../static/gen-static-ver $(ENGINE_DIR) $(VERSION))
GO_BASE_IMAGE=golang
GO_VERSION:=1.12.4
GO_IMAGE=$(GO_BASE_IMAGE):$(GO_VERSION)
GO_IMAGE=$(GO_BASE_IMAGE):$(GO_VERSION)-stretch
DEB_VERSION=$(shell ./gen-deb-ver $(CLI_DIR) "$(VERSION)")
CHOWN:=docker run --rm -v $(CURDIR):/v -w /v alpine chown
EPOCH?=5
@ -63,35 +60,28 @@ deb: ubuntu debian raspbian ## build all deb packages
ubuntu: ubuntu-bionic ubuntu-xenial ## build all ubuntu deb packages
.PHONY: debian
debian: debian-stretch ## build all debian deb packages
debian: debian-stretch debian-buster ## build all debian deb packages
.PHONY: raspbian
raspbian: raspbian-stretch ## build all raspbian deb packages
raspbian: raspbian-stretch raspbian-buster ## build all raspbian deb packages
.PHONY: ubuntu-%
ubuntu-%: ## build ubuntu deb packages
## build ubuntu deb packages
ubuntu-%: $(SOURCES)
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: debian-buster
debian-buster: ## build debian buster deb packages
debian-buster: $(SOURCES)
.PHONY: debian-%
## build debian deb packages
debian-%: $(SOURCES)
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: debian-stretch
debian-stretch: ## build debian stretch deb packages
debian-stretch: $(SOURCES)
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
.PHONY: raspbian-stretch
raspbian-stretch: ## build raspbian stretch deb packages
raspbian-stretch: $(SOURCES)
.PHONY: raspbian-%
## build raspbian deb packages
raspbian-%: $(SOURCES)
$(BUILD)
$(RUN)
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
@ -134,7 +124,7 @@ sources/engine-image:
sources/plugin-installers.tgz: $(wildcard ../plugins/*)
docker run --rm -i -w /v \
-v $(shell readlink -e ../plugins):/plugins \
-v $(PLUGINS_DIR):/plugins \
-v $(CURDIR)/sources:/v \
alpine \
tar -C / -c -z -f /v/plugin-installers.tgz --exclude .git plugins

View File

@ -27,7 +27,7 @@ Vcs-Git: git://github.com/docker/docker.git
Package: docker-ce
Architecture: linux-any
Depends: docker-ce-cli, containerd.io, iptables, libseccomp2 (>= 2.3.0), ${shlibs:Depends}
Depends: docker-ce-cli, containerd.io (>= 1.2.2-3), iptables, libseccomp2 (>= 2.3.0), ${shlibs:Depends}
Recommends: aufs-tools,
ca-certificates,
cgroupfs-mount | cgroup-lite,

View File

@ -0,0 +1,29 @@
ARG GO_IMAGE
ARG BUILD_IMAGE=balenalib/rpi-raspbian:buster
FROM ${GO_IMAGE} as golang
FROM ${BUILD_IMAGE}
RUN apt-get update && apt-get install -y curl devscripts equivs git
ARG GO_VERSION
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
ENV RUNC_BUILDTAGS apparmor seccomp selinux
ARG COMMON_FILES
COPY ${COMMON_FILES} /root/build-deb/debian
RUN mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/build-deb/debian/control
COPY sources/ /sources
ENV DISTRO raspbian
ENV SUITE buster
COPY --from=golang /usr/local/go /usr/local/go
WORKDIR /root/build-deb
COPY build-deb /root/build-deb/build-deb
ENTRYPOINT ["/root/build-deb/build-deb"]

View File

@ -1,5 +1,5 @@
ARG GO_IMAGE
ARG BUILD_IMAGE=resin/rpi-raspbian:stretch
ARG BUILD_IMAGE=balenalib/rpi-raspbian:stretch
FROM ${GO_IMAGE} as golang
FROM ${BUILD_IMAGE}

View File

@ -4,6 +4,12 @@ FROM ${GO_IMAGE} as golang
FROM ${BUILD_IMAGE}
# Remove diverted man binary to prevent man-pages being replaced with "minimized" message. See docker/for-linux#639
RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \
rm -f /usr/bin/man; \
dpkg-divert --quiet --remove --rename /usr/bin/man; \
fi
RUN apt-get update && apt-get install -y curl devscripts equivs git
ARG GO_VERSION

View File

@ -4,6 +4,12 @@ FROM ${GO_IMAGE} as golang
FROM ${BUILD_IMAGE}
# Remove diverted man binary to prevent man-pages being replaced with "minimized" message. See docker/for-linux#639
RUN if [ "$(dpkg-divert --truename /usr/bin/man)" = "/usr/bin/man.REAL" ]; then \
rm -f /usr/bin/man; \
dpkg-divert --quiet --remove --rename /usr/bin/man; \
fi
RUN apt-get update && apt-get install -y curl devscripts equivs git
ARG GO_VERSION

View File

@ -1,18 +1,13 @@
SHELL:=/bin/bash
ENGINE_DIR:=$(CURDIR)/../../engine
CLI_DIR:=$(CURDIR)/../../cli
VERSION?=0.0.0-dev
include ../common.mk
CLI_DIR:=$(realpath $(CURDIR)/../../cli)
ENGINE_DIR:=$(realpath $(CURDIR)/../../engine)
GO_BASE_IMAGE=golang
GO_VERSION:=1.12.4
ENGINE_GO_IMAGE=$(GO_BASE_IMAGE):$(GO_VERSION)
STATIC_VERSION=$(shell ../static/gen-static-ver $(ENGINE_DIR) $(VERSION))
ENGINE_GO_IMAGE=$(GO_BASE_IMAGE):$(GO_VERSION)-stretch
STATIC_VERSION:=$(shell ../static/gen-static-ver $(ENGINE_DIR) $(VERSION))
DOCKER_HUB_ORG?=dockereng
ARCH=$(shell uname -m)
ENGINE_IMAGE?=engine-community
CHOWN:=docker run --rm -v $(CURDIR):/v -w /v alpine chown
DEFAULT_PRODUCT_LICENSE?=Community Engine
PLATFORM?=Docker Engine - Community
BUILDTIME?=$(shell date -u -d "@$${SOURCE_DATE_EPOCH:-$$(date +%s)}" --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
IMAGE_WITH_TAG=$(DOCKER_HUB_ORG)/$(ENGINE_IMAGE):$(STATIC_VERSION)
ifdef BASE_IMAGE
# TODO: Clean this up to only set ENGINE_GO_IMAGE

View File

@ -6,7 +6,7 @@ source "$(dirname "$0")/.common"
GOPATH=$(go env GOPATH)
REPO=https://github.com/docker/app.git
COMMIT=v0.8.0-beta1
COMMIT=v0.8.0
DEST=${GOPATH}/src/github.com/docker/app
build() {

35
plugins/buildx.installer Normal file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -e
source "$(dirname "$0")/.common"
PKG=github.com/docker/buildx
GOPATH=$(go env GOPATH)
REPO=https://${PKG}.git
: "${BUILDX_COMMIT=v0.3.1}"
DEST=${GOPATH}/src/${PKG}
build() {
if [ ! -d "${DEST}" ]; then
git clone "${REPO}" "${DEST}"
fi
(
cd "${DEST}"
git fetch --all
git checkout -q "${BUILDX_COMMIT}"
local LDFLAGS
# TODO: unmark `-tp` when no longer a technical preview
LDFLAGS="-X ${PKG}/version.Version=$(git describe --match 'v[0-9]*' --always --tags)-tp-docker -X ${PKG}/version.Revision=$(git rev-parse HEAD) -X ${PKG}/version.Package=${PKG} -X main.experimental=1"
set -x
go build -o bin/docker-buildx -ldflags "${LDFLAGS}" ./cmd/buildx
)
}
install_plugin() {
(
cd "${DEST}"
install_binary bin/docker-buildx
)
}
build_or_install "$@"

View File

@ -1,14 +1,12 @@
include ../containerd.mk
include ../common.mk
ARCH=$(shell uname -m)
ENGINE_DIR:=$(CURDIR)/../../engine
CLI_DIR:=$(CURDIR)/../../cli
CLI_DIR:=$(realpath $(CURDIR)/../../cli)
ENGINE_DIR:=$(realpath $(CURDIR)/../../engine)
PLUGINS_DIR=$(realpath $(CURDIR)/../plugins)
GITCOMMIT=$(shell cd $(ENGINE_DIR) && git rev-parse --short HEAD)
VERSION?=0.0.0-dev
STATIC_VERSION=$(shell ../static/gen-static-ver $(ENGINE_DIR) $(VERSION))
STATIC_VERSION:=$(shell ../static/gen-static-ver $(ENGINE_DIR) $(VERSION))
GO_BASE_IMAGE=golang
GO_VERSION:=1.12.4
GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)
GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)-stretch
GEN_RPM_VER=$(shell ./gen-rpm-ver $(CLI_DIR) $(VERSION))
CHOWN=docker run --rm -i -v $(CURDIR):/v -w /v alpine chown
@ -63,7 +61,7 @@ clean: ## remove build artifacts
rpm: fedora centos ## build all rpm packages
.PHONY: fedora
fedora: fedora-30 fedora-29 fedora-28 ## build all fedora rpm packages
fedora: fedora-31 fedora-30 fedora-29 fedora-28 ## build all fedora rpm packages
.PHONY: centos
centos: centos-7 ## build all centos rpm packages
@ -122,7 +120,7 @@ rpmbuild/SOURCES/distribution_based_engine.json: rpmbuild/SOURCES/engine-image
rpmbuild/SOURCES/plugin-installers.tgz: $(wildcard ../plugins/*)
docker run --rm -i -w /v \
-v $(shell readlink -e ../plugins):/plugins \
-v $(PLUGINS_DIR):/plugins \
-v $(CURDIR)/rpmbuild/SOURCES:/v \
alpine \
tar -C / -c -z -f /v/plugin-installers.tgz --exclude .git plugins

View File

@ -16,12 +16,12 @@ Vendor: Docker
Packager: Docker <support@docker.com>
Requires: docker-ce-cli
Requires: container-selinux >= 2.9
Requires: container-selinux >= 2:2.74
Requires: libseccomp >= 2.3
Requires: systemd-units
Requires: systemd
Requires: iptables
Requires: libcgroup
Requires: containerd.io
Requires: containerd.io >= 1.2.2-3
Requires: tar
Requires: xz
@ -60,7 +60,7 @@ Obsoletes: docker-engine-selinux
Obsoletes: docker-engine
%description
Docker is is a product for you to build, ship and run any application as a
Docker is a product for you to build, ship and run any application as a
lightweight container.
Docker containers are both hardware-agnostic and platform-agnostic. This means
@ -74,6 +74,7 @@ depending on a particular stack or provider.
%setup -q -c -n src -a 0
%build
export DOCKER_GITCOMMIT=%{_gitcommit}
mkdir -p /go/src/github.com/docker
ln -s /root/rpmbuild/BUILD/src/engine /go/src/github.com/docker/docker
@ -103,7 +104,7 @@ install -D -m 0644 %{_topdir}/SOURCES/docker.service $RPM_BUILD_ROOT/%{_unitdir}
install -D -m 0644 %{_topdir}/SOURCES/docker.socket $RPM_BUILD_ROOT/%{_unitdir}/docker.socket
# install json for docker engine activate / upgrade
install -D -m 0644 %{_topdir}/SOURCES/distribution_based_engine.json $RPM_BUILD_ROOT/var/lib/docker-engine/distribution_based_engine-ce.json
install -D -m 0644 %{_topdir}/SOURCES/distribution_based_engine.json $RPM_BUILD_ROOT/var/lib/docker-engine/distribution_based_engine.json
%files
/%{_bindir}/dockerd
@ -111,44 +112,18 @@ install -D -m 0644 %{_topdir}/SOURCES/distribution_based_engine.json $RPM_BUILD_
/%{_bindir}/docker-init
/%{_unitdir}/docker.service
/%{_unitdir}/docker.socket
/var/lib/docker-engine/distribution_based_engine-ce.json
%pre
if [ $1 -gt 0 ] ; then
# package upgrade scenario, before new files are installed
# clear any old state
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
# check if docker service is running
if systemctl is-active docker > /dev/null 2>&1; then
systemctl stop docker > /dev/null 2>&1 || :
touch %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
fi
fi
/var/lib/docker-engine/distribution_based_engine.json
%post
%systemd_post docker
%systemd_post docker.service
if ! getent group docker > /dev/null; then
groupadd --system docker
fi
%preun
%systemd_preun docker
%systemd_preun docker.service
%postun
%systemd_postun_with_restart docker
%posttrans
if [ $1 -ge 0 ] ; then
# package upgrade scenario, after new files are installed
# check if docker was running before upgrade
if [ -f %{_localstatedir}/lib/rpm-state/docker-is-active ]; then
systemctl start docker > /dev/null 2>&1 || :
rm -f %{_localstatedir}/lib/rpm-state/docker-is-active > /dev/null 2>&1 || :
fi
fi
%systemd_postun_with_restart docker.service
%changelog

18
rpm/fedora-31/Dockerfile Normal file
View File

@ -0,0 +1,18 @@
ARG GO_IMAGE
ARG BUILD_IMAGE=fedora:31
FROM ${GO_IMAGE} as golang
FROM ${BUILD_IMAGE}
ENV DISTRO fedora
ENV SUITE 31
ENV GOPATH /go
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH 1
ENV DOCKER_BUILDTAGS seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
RUN dnf install -y rpm-build rpmlint dnf-plugins-core
COPY SPECS /root/rpmbuild/SPECS
RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec
COPY --from=golang /usr/local/go /usr/local/go
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]

View File

@ -1,14 +1,13 @@
SHELL:=/bin/bash
ENGINE_DIR:=$(CURDIR)/../../engine
CLI_DIR:=$(CURDIR)/../../cli
VERSION?=0.0.0-dev
STATIC_VERSION=$(shell ./gen-static-ver $(ENGINE_DIR) $(VERSION))
include ../common.mk
CLI_DIR:=$(realpath $(CURDIR)/../../cli)
ENGINE_DIR:=$(realpath $(CURDIR)/../../engine)
STATIC_VERSION:=$(shell ./gen-static-ver $(ENGINE_DIR) $(VERSION))
CHOWN=docker run --rm -v $(CURDIR):/v -w /v alpine chown
HASH_CMD=docker run -v $(CURDIR):/sum -w /sum debian:jessie bash hash_files
DIR_TO_HASH:=build/linux
DEFAULT_PRODUCT_LICENSE?=Community Engine
DOCKER_CLI_GOLANG_IMG=$(shell awk '$$1=="FROM"{split($$2,a,"-");print a[1];exit}' $(CLI_DIR)/dockerfiles/Dockerfile.dev)
GO_VERSION=$(shell grep "ARG GO_VERSION" $(CLI_DIR)/dockerfiles/Dockerfile.dev | awk -F'=' '{print $$2}')
DOCKER_CLI_GOLANG_IMG=golang:$(GO_VERSION)
.PHONY: help
help: ## show make targets