Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
92deacd
initial commit
andrewhsu May 20, 2017
3e3c112
pass in git commit override when building deb
andrewhsu May 25, 2017
2b9e0d4
Add armhf dockerfiles for deb building (#4)
seemethere May 26, 2017
d131f60
generate man pages
andrewhsu Jun 6, 2017
d4c776b
Merge pull request #12 from andrewhsu/gen-man
andrewhsu Jun 6, 2017
205e00e
Add initial systemd scripts
seemethere Jun 6, 2017
e49e589
Use internal systemd scripts for RPM packaging
seemethere Jun 6, 2017
e829ca2
Use internal systemd scripts for DEB packaging
seemethere Jun 6, 2017
db12b9c
Merge pull request #13 from seemethere/add_systemd_files
andrewhsu Jun 15, 2017
c5e4d2e
Add conflicts with docker-ee
cpuguy83 Jun 18, 2017
bb606ad
also have deb pkg conflict docker-engine
andrewhsu Jun 20, 2017
652e262
Merge pull request #24 from andrewhsu/conflict
andrewhsu Jun 20, 2017
8d87fc8
Added the metrics plugin to the RPM/DEB packages
rogaha May 24, 2017
5960270
Have docker cli be compiled in GOPATH
seemethere Jul 21, 2017
6e808fa
Merge pull request #36 from seemethere/fix_manpage_generation
andrewhsu Jul 21, 2017
1f93d8c
Change make -C to a cd command
seemethere Jul 21, 2017
d42bbfd
Merge pull request #3 from rogaha/add_metrics_plugin
andrewhsu Jul 21, 2017
0455145
Merge pull request #37 from seemethere/change_deb_rules_to_cd
andrewhsu Jul 21, 2017
e1ed09a
Revert "Added the metrics plugin to the RPM/DEB packages"
seemethere Jul 24, 2017
e496387
Removes engine VERSION dependency
seemethere Sep 1, 2017
f01acd1
Add pigz to recommended packages
sargun Jan 18, 2018
48e12c8
deb/common/rules: fix uncommenting TasksMax
kolyshkin Jan 19, 2018
7e4b45b
Merge pull request #78 from kolyshkin/tasks-max
seemethere Jan 24, 2018
4cd84c8
CE package conversion
May 18, 2018
566d7ba
Address review comments on PR #128
Aug 2, 2018
bac222a
Add RPM package building for docker-ce-cli
seemethere Aug 6, 2018
7acd91e
Add containerd-proxy building
seemethere Aug 14, 2018
9dbf88f
Add containerd-shim-process installation
seemethere Aug 14, 2018
8fc0f60
Remove rpmlint checks, add BuildRequires
seemethere Aug 14, 2018
309642f
Add systemd files, add containerd-proxy config
seemethere Aug 14, 2018
9a4542d
Round out systemd for RPM packaging
seemethere Aug 15, 2018
883d7d0
Revive pre / post steps, update offline location
seemethere Aug 15, 2018
e90bb56
Some changes to get this working on CentOS 7
seemethere Aug 16, 2018
5ee0b7c
Merge pull request #131 from seemethere/rpm_new
docker-unir[bot] Aug 16, 2018
6bf46f0
Intial deb package split for 18.09.x
seemethere Aug 16, 2018
61019f7
Do not conflict with docker-ee-cli
seemethere Aug 16, 2018
b0b864f
Merge pull request #140 from seemethere/deb_new
docker-unir[bot] Aug 16, 2018
94147ba
Do offline bundles for engine installs
seemethere Aug 20, 2018
57ffb0c
Merge pull request #149 from seemethere/offline_engine
seemethere Aug 20, 2018
70b7cd6
Set containerd to be a systemd bind for docker
seemethere Aug 20, 2018
95fc939
Merge pull request #150 from seemethere/require
seemethere Aug 20, 2018
d97dda0
Merge pull request #151 from docker/develop
seemethere Aug 21, 2018
1f43044
Add post-stop
crosbymichael Aug 28, 2018
b6764f8
added RestartSec
andrewhsu Aug 24, 2018
cb4a1c7
Merge pull request #169 from andrewhsu/sync
andrewhsu Aug 28, 2018
70c8388
Merge pull request #168 from crosbymichael/prestart
docker-unir[bot] Aug 28, 2018
0472d68
add requires container-selinux to spec
andrewhsu Aug 29, 2018
76735ad
Merge pull request #174 from andrewhsu/mse
andrewhsu Aug 29, 2018
da40458
systemd: no limit on core size
thaJeztah Aug 31, 2018
4f68287
systemd: set Limit* to infinity
thaJeztah Aug 31, 2018
51458fd
systemd: don't limit tasks
thaJeztah Aug 31, 2018
bdd344a
systemd: add "Delegate=yes" to docker's service file
thaJeztah Aug 31, 2018
5bcd0eb
systemd: set systemd KillMode
thaJeztah Aug 31, 2018
2d2c305
systemd: add support for reloading daemon configuration through systemd
thaJeztah Aug 31, 2018
4afaf57
systemd: set start burst limits
thaJeztah Aug 31, 2018
79b661c
Fix docker-ce-cli replacing files
seemethere Sep 6, 2018
de2b5d5
Merge pull request #189 from seemethere/replace_conflict_deb
seemethere Sep 6, 2018
04158db
Remove offline installer to install shim-process
seemethere Sep 7, 2018
f055bad
Merge pull request #191 from seemethere/no_offline_installer
seemethere Sep 10, 2018
e2c36f7
Bump packaging epoch
Sep 10, 2018
8c21e2a
Merge pull request #194 from dhiltgen/bump_epoch_master
docker-unir[bot] Sep 10, 2018
02bd7fb
s/abufs-tools/aufs-tools/
xmikus01 Sep 13, 2018
032bae3
Add `/usr/sbin` to our path variable for systemd
seemethere Sep 17, 2018
994645a
Merge pull request #213 from seemethere/iptables_fix
docker-unir[bot] Sep 17, 2018
51fc5cb
change home page link for deb pkgs
thaJeztah Sep 20, 2018
e0b4dd3
change some wording in package description
thaJeztah Sep 20, 2018
f0a663b
systemd/docker.service: fix PATH
kolyshkin Sep 20, 2018
91aa7e2
Merge pull request #231 from kolyshkin/fix-path
seemethere Sep 20, 2018
aa6dca4
Merge pull request #224 from thaJeztah/update_package_description
seemethere Sep 20, 2018
68ae4ee
more updates to package descriptions
thaJeztah Sep 20, 2018
020dc7a
Merge pull request #232 from thaJeztah/more_updates_to_package_descri…
seemethere Sep 20, 2018
61ca4e3
Use image artifacts as daemon and dependencies
seemethere Sep 19, 2018
778693c
Merge pull request #223 from seemethere/f
seemethere Sep 21, 2018
dcb71ed
Remove Environment, not needed anymore
seemethere Sep 26, 2018
534331d
Fix debian package upgrade scenarios
seemethere Sep 26, 2018
7f9396b
Change metadata to be stored in docker-engine
seemethere Sep 26, 2018
22bc907
Merge pull request #243 from seemethere/upgrade
seemethere Sep 26, 2018
de925b2
Merge pull request #244 from seemethere/meta
seemethere Sep 28, 2018
c373b85
Restore `Type=notify` in Systemd unit
unshare Oct 8, 2018
c8bf9fa
Change replaces/breaks to have compat with nightly
seemethere Oct 15, 2018
3f4a96d
Merge pull request #250 from seemethere/compat
seemethere Oct 17, 2018
a149bfb
Merge pull request #249 from unshare/notify
seemethere Oct 18, 2018
55254c5
Add the docker.socket back in
seemethere Nov 8, 2018
95df4a5
Add explicit dependency for libseccomp2
Aug 29, 2018
765cdf3
Remove containerd dependency from CLI
thaJeztah Nov 28, 2018
798ebee
Merge pull request #262 from thaJeztah/master_backport_seccomp_dep
seemethere Nov 28, 2018
91cbb85
Add socket activation for RHEL based distributions
seemethere Nov 29, 2018
c5cd5af
Merge pull request #273 from seemethere/sockles
andrewhsu Nov 30, 2018
3e74370
Add docker.socket requirement for docker.service
seemethere Dec 3, 2018
ed59bc5
Merge pull request #275 from seemethere/failure_to_launch
andrewhsu Dec 3, 2018
201795a
Add libseccomp requirement for rpm packages
thaJeztah Nov 28, 2018
362215a
Restore SysVinit and Upstart support
paddy-hack Dec 23, 2018
6458a06
Merge pull request #287 from seemethere/restore_init
seemethere Dec 28, 2018
ba376d3
Merge pull request #285 from thaJeztah/master_add_seccomp_dependency
seemethere Jan 4, 2019
111ffa9
Require a containerd version >= 1.2.2
seemethere Jan 14, 2019
dbffd27
Merge pull request #289 from seemethere/require_containerd
andrewhsu Jan 14, 2019
3ce8155
Start docker.service after containerd.service
corbin-coleman Jan 14, 2019
0cc223f
Merge pull request #290 from corbin-coleman/start-dockerd-after-conta…
seemethere Jan 15, 2019
c25e4a9
Revert "Require a containerd.io version >= 1.2.2"
andrewhsu Jan 15, 2019
a0236bd
Merge pull request #291 from docker/revert-289-require_containerd
seemethere Jan 15, 2019
9c74455
Add back requirements that were removed in the migration
thaJeztah Nov 28, 2018
14c2d5c
systemd: set --containerd socket patch to prevent race-condition
thaJeztah Feb 11, 2019
8d51837
Merge pull request #296 from thaJeztah/master_restore_requires
seemethere Feb 13, 2019
63223f8
systemd: fix typo in TasksMax comment
mwhudson Feb 26, 2019
404b932
Merge pull request #304 from mwhudson/patch-1
seemethere Feb 27, 2019
e13da38
Add plugin installation for DEB and RPM
seemethere Mar 5, 2019
6c04fb2
Merge pull request #309 from seemethere/add_ploogins
seemethere Mar 8, 2019
e289154
RPM: build the daemon as part of the package
seemethere Mar 25, 2019
0af9768
DEB: build the daemon as part of the package
seemethere Mar 25, 2019
9320807
Merge pull request #314 from seemethere/restore
seemethere Mar 26, 2019
4d345d4
rpm lacks dependency to groupadd
PhilippHomann May 22, 2019
4a77834
require container-selinux >= 2.74
thaJeztah Jun 25, 2019
faaf0e2
Sync RPM Spec with EE
thaJeztah Jun 25, 2019
c8c1d55
Remove the pre and posttrans, they weren't useful
thaJeztah Jun 25, 2019
0b150d2
Merge pull request #345 from thaJeztah/bump_container_selinux
docker-unir[bot] Jun 25, 2019
0767e0a
Bump containerd.io dep >= 1.2.2-3 (CVE-2019-5736)
seemethere Feb 8, 2019
b8149df
RPM spec: remove -ce suffix from distribution_based_engine JSON
thaJeztah Sep 10, 2019
92fd110
deb: make "rules" executable
thaJeztah Oct 20, 2019
1a290d5
deb: make init and postinst files executable
thaJeztah Oct 20, 2019
b9b0a86
[master] deb: make init and postinst files executable (#402)
seemethere Oct 20, 2019
8ea09ed
deb: Only recommend aufs-tools on amd64
seemethere Oct 25, 2019
ba42025
Merge pull request #404 from seemethere/aufs_amd64
seemethere Oct 28, 2019
8f96807
Remove image-based build (for docker engine activate)
thaJeztah Dec 5, 2019
e0d798b
deb: remove unused DOCKER_GOPATH variable
thaJeztah Mar 4, 2020
35adc46
Merge pull request #440 from thaJeztah/remove_unused_variable
silvin-lubecki Mar 4, 2020
3b578eb
Don't disable socket activation when stopping docker service
thaJeztah Mar 4, 2020
1283be2
Merge pull request #441 from thaJeztah/socket_activation
silvin-lubecki Mar 12, 2020
48534d0
Fix CentOS 8 build
thaJeztah Mar 20, 2020
71bc446
Merge pull request #444 from thaJeztah/fix_centos8
thaJeztah Mar 23, 2020
e3912a9
rpm: fix double slashes in paths
thaJeztah Mar 23, 2020
006b710
rpm: use macros/env-vars instead of hard-coded paths
thaJeztah Mar 23, 2020
7df0b21
rpm: consistently use curly brackets for env-vars
thaJeztah Mar 23, 2020
5be4b95
Merge pull request #445 from thaJeztah/tweak_rpm
thaJeztah Mar 23, 2020
0df37a8
rpm: remove devicemapper requirement
thaJeztah Apr 1, 2020
e3c8496
deb: add missing format version
thaJeztah Apr 2, 2020
601744b
Merge pull request #448 from thaJeztah/add_format
silvin-lubecki Apr 2, 2020
fa36615
Replace the default common commit by a specific one for cli and engin…
glours Apr 2, 2020
b76884b
Replace the default common commit by a specific one for cli and engin…
glours Apr 3, 2020
1407d63
Merge pull request #449 from glours/split_debian_package
silvin-lubecki Apr 6, 2020
65930ba
Merge pull request #447 from thaJeztah/remove_devmapper_requires
tiborvass Apr 10, 2020
2b02603
RHEL8 iptables build fix (#410)
Nov 28, 2019
2ce7033
Merge pull request #463 from thaJeztah/master_rhel_iptables
tiborvass May 1, 2020
a2114bf
Downgrade "aufs-tools" and "cgroupfs-mount" to "Suggests"
tianon May 27, 2020
d197080
Merge pull request #472 from tianon/suggests
thaJeztah May 28, 2020
ffea7d1
Add docker-ce-rootless-extras deb
AkihiroSuda Jun 30, 2020
c4c6cbc
Add docker-ce-rootless-extras rpm
AkihiroSuda Jul 8, 2020
c96d426
Merge pull request #331 from PhilippHomann/master
thaJeztah Jul 21, 2020
ce074ca
deb: add apparmor as "recommends" on Debian as well
thaJeztah Jul 23, 2020
0caacf9
Merge pull request #487 from thaJeztah/debian_apparmor
thaJeztah Jul 23, 2020
d242198
systemd: add multi-user.target to After list
IsaiahGrace Jul 29, 2020
de39411
Merge pull request #488 from IsaiahGrace/master
thaJeztah Jul 30, 2020
07d42d4
deb: format deb/common/control with wrap-and-sort
thaJeztah Aug 3, 2020
a11f3eb
Merge pull request #489 from thaJeztah/sort_deps
silvin-lubecki Aug 3, 2020
2e84a4a
Update minimum containerd.io version to v1.3.0
thaJeztah Jul 15, 2020
b380e9a
Merge pull request #480 from thaJeztah/bump_containerd_version
tiborvass Sep 17, 2020
93d3d43
systemd: set OOMScoreAdjust for dockerd
thaJeztah Oct 5, 2020
fa917cc
Update minimum containerd.io version to v1.4.1
thaJeztah Oct 20, 2020
b2af2fb
Merge pull request #506 from thaJeztah/containerd_1.4
thaJeztah Oct 20, 2020
f0e1452
deb: set compat version to 10
thaJeztah Oct 20, 2020
10f20a0
Merge pull request #507 from thaJeztah/set_compat_version
thaJeztah Oct 20, 2020
99f44c9
Merge pull request #501 from thaJeztah/systemd_oom_score
thaJeztah Oct 20, 2020
b70133d
Do not "Bind" docker "To" containerd.
mihao Jul 9, 2019
e611f1c
Merge pull request #508 from thaJeztah/carry_365
thaJeztah Nov 5, 2020
f5a1445
Add "procps" to daemon "Recommends" (for "docker top")
tianon Nov 19, 2020
9c85e28
Revert "systemd: add multi-user.target to After list"
thaJeztah Dec 10, 2020
b1d2709
Merge pull request #514 from thaJeztah/revert_after_multiuser
tiborvass Dec 10, 2020
2890b73
deb: make dh-systemd dependency optional as it's deprecated
thaJeztah Jan 11, 2021
4d4a8bc
deb: change rootless-extras to "enhance", not "depend" on docker-ce
thaJeztah Mar 12, 2021
0a2ec70
Merge pull request #509 from tianon/cli-deps
thaJeztah Mar 24, 2021
26a527b
deb: build separate deb for docker-scan
thaJeztah Mar 30, 2021
5b23db5
deb: separate docker-scan-plugin version from other versions
thaJeztah Mar 31, 2021
d4d33f8
Always require iptables for libnetwork
Feb 4, 2021
bd8190e
Merge pull request #526 from makotom/patch-1
tiborvass Apr 2, 2021
441d0ca
Add libarchive build-dep to fix missing archive_write_add_filter_zstd
thaJeztah Jun 30, 2021
4038b05
Merge pull request #558 from thaJeztah/20.10_backport_add_libarchive
fredericdalleau Jul 9, 2021
25e67f3
[20.10] fix systemd startup order
thaJeztah Sep 2, 2021
afb12ef
deb: force dpkg-build to use xz compression instead of zstd
thaJeztah Oct 19, 2021
0e58a43
Require `dbus-user-session` for rootless
AkihiroSuda Aug 27, 2021
91fbb06
Merge pull request #575 from thaJeztah/20.10_fix_systemd_startup_order
thaJeztah Dec 23, 2021
3acd62e
Add workaround for CentOS 7 not working without GOPROXY
thaJeztah Sep 6, 2021
1022b16
Merge pull request #619 from thaJeztah/20.10_backport_fix_rootlesskit…
thaJeztah Feb 8, 2022
0a5bbcc
CentOS 7: use go-proxy to work around old git version
thaJeztah Mar 7, 2022
4bf7cb7
Merge pull request #636 from thaJeztah/20.10_backport_centos_module_fix
thaJeztah Mar 7, 2022
aba38f9
Add checks for binary versions set through build-time variables
thaJeztah Jun 2, 2021
6a6cf79
Fix binary version checks masking failure exit code
thaJeztah Jul 3, 2021
66e4367
Merge pull request #637 from thaJeztah/20.10_backport_add_version_checks
thaJeztah Mar 7, 2022
1e8e8dc
rpmlint: fix "E: description-line-too-long"
thaJeztah Mar 8, 2022
cd3de18
Merge pull request #641 from thaJeztah/20.10_backport_fix_rpmlint_war…
thaJeztah Mar 8, 2022
4bd4b85
deb: add docker-compose-plugin package
thaJeztah Jul 3, 2021
12f8e6a
Merge pull request #638 from thaJeztah/20.10_backport_add_compose_cli…
thaJeztah Mar 8, 2022
8e961c6
Build for CentOS 9.
Romain-Geissler-1A Mar 7, 2022
0626262
deb, rpm: inline go build for compose
thaJeztah Aug 20, 2022
50edf0d
Merge pull request #746 from thaJeztah/20.10_backport_fix_compose_build
thaJeztah Aug 20, 2022
a70902a
Update GOPROXY to use default with fallback
thaJeztah Aug 20, 2022
65e78c3
Merge pull request #747 from thaJeztah/20.10_backport_less_goproxy_hacks
thaJeztah Aug 20, 2022
596c664
compose: use updated makefile
thaJeztah Aug 23, 2022
0aa6a8f
Merge pull request #757 from thaJeztah/20.10_backport_update_compose_…
thaJeztah Aug 28, 2022
70d8bbf
Merge remote-tracking branch 'docker-ce-packaging-pick/20.10' into do…
crazy-max Sep 4, 2022
9d4f365
docker-engine package
crazy-max Sep 4, 2022
5780b98
docker-engine: fix broken libsystemd-dev and libdevmapper-dev pkgs on…
crazy-max Sep 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
fail-fast: false
matrix:
name:
- docker-engine
- docker-cli
- buildx
- compose
Expand Down
2 changes: 2 additions & 0 deletions common/vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ export GO_IMAGE_VARIANT ?= buster
export PKG_VENDOR ?= Docker
export PKG_PACKAGER ?= Docker <support@docker.com>

export DOCKER_ENGINE_REPO ?= https://github.com/docker/docker.git
export DOCKER_CLI_REPO ?= https://github.com/docker/cli.git
export BUILDX_REPO ?= https://github.com/docker/buildx.git
export COMPOSE_REPO ?= https://github.com/docker/compose.git
export CREDENTIAL_HELPERS_REPO ?= https://github.com/docker/docker-credential-helpers.git

export DOCKER_ENGINE_VERSION ?= v20.10.17
export DOCKER_CLI_VERSION ?= v20.10.17
export BUILDX_VERSION ?= v0.9.1
export COMPOSE_VERSION ?= v2.10.2
Expand Down
1 change: 1 addition & 0 deletions pkg/docker-engine/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin
1 change: 1 addition & 0 deletions pkg/docker-engine/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin
339 changes: 339 additions & 0 deletions pkg/docker-engine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,339 @@
# syntax=docker/dockerfile:1

# Copyright 2022 Docker Packaging authors
#
# 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.

ARG XX_VERSION="1.1.2"
ARG ALPINE_VERSION="3.16"
ARG DEBIAN_FRONTEND="noninteractive"

# go
ARG GO_IMAGE="golang"
ARG GO_VERSION="1.18.5"
ARG GO_IMAGE_VARIANT="buster"

# pkg matrix
ARG PKG_RELEASE="debian11"
ARG PKG_TYPE="deb"
ARG PKG_DISTRO="debian"
ARG PKG_SUITE="bullseye"
ARG PKG_BASE_IMAGE="debian:bullseye"

# deb specific
ARG PKG_DEB_EPOCH="5"
ARG PKG_DEB_REVISION="0"

# rpm specific
ARG PKG_RPM_RELEASE="1"

# cross compilation helper
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx

# osxcross contains the MacOSX SDK for xx
FROM dockercore/golang-cross:xx-sdk-extras AS osxsdk

# go base image to retrieve /usr/local/go
FROM --platform=$BUILDPLATFORM ${GO_IMAGE}:${GO_VERSION}-${GO_IMAGE_VARIANT} AS go

# dummy stage for unsupported platforms
FROM --platform=$BUILDPLATFORM busybox AS builder-dummy
RUN mkdir -p /out
FROM scratch AS build-dummy
COPY --from=builder-dummy /out /out

# base stage for fetching sources and create final release
FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} AS base
RUN apk add --no-cache bash curl file git zip tar

FROM base AS src
WORKDIR /src
ARG DOCKER_ENGINE_REPO
RUN git init . && git remote add origin "${DOCKER_ENGINE_REPO}"
ARG DOCKER_ENGINE_VERSION
RUN git fetch origin "${DOCKER_ENGINE_VERSION}" +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* && git checkout -q FETCH_HEAD

FROM base AS src-tgz
RUN --mount=from=src,source=/src,target=/engine \
mkdir /out && tar -C / -zcf /out/engine.tgz --exclude .git engine

# deb
FROM --platform=$BUILDPLATFORM ${PKG_BASE_IMAGE} AS build-base-deb
COPY --from=xx / /
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install -y bash curl devscripts equivs git
ENV GOPROXY="https://proxy.golang.org|direct"
ENV GOPATH="/go"
ENV GO111MODULE="off"
ENV PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
ENV RUNC_BUILDTAGS apparmor seccomp selinux
ARG PKG_RELEASE
RUN <<EOT
case "$PKG_RELEASE" in
ubuntu1804)
# FIXME: https://github.com/docker/docker-ce-packaging/issues/758
apt-get install --allow-downgrades -y libudev1=237-3ubuntu10.53 libsystemd0=237-3ubuntu10.53
;;
ubuntu2004|ubuntu2204)
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
;;
esac
EOT

FROM build-base-deb AS build-deb
COPY deb /root/package/debian
ARG TARGETPLATFORM
ARG DEBIAN_FRONTEND
ARG PKG_RELEASE
RUN mk-build-deps -t "xx-apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y" -i /root/package/debian/control
WORKDIR /root/package
COPY --from=src /src ./engine
ARG DOCKER_ENGINE_VERSION
ARG PKG_DISTRO
ARG PKG_SUITE
ARG PKG_PACKAGER
ARG PKG_DEB_REVISION
ARG PKG_DEB_EPOCH
ARG SOURCE_DATE_EPOCH
RUN --mount=source=common,target=/common \
--mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go \
--mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/go/pkg/mod <<EOT
set -e
mkdir -p /out
if [ "$(xx-info arch)" != "$(TARGETPLATFORM= xx-info arch)" ]; then
echo "$(xx-info arch) architecture is not supported"
exit 0
fi
export DOCKER_ENGINE_REVISION=$(git --git-dir ./engine/.git rev-parse --short HEAD)
debVersion=${DOCKER_ENGINE_VERSION#v}
debVersion=$(echo $debVersion | sed "s/-/~/")
cat > "debian/changelog" <<-EOF
docker-ce (${PKG_DEB_EPOCH}$([ -n "$PKG_DEB_EPOCH" ] && echo ":")${debVersion}-${PKG_DEB_REVISION}) $PKG_SUITE; urgency=low
* Version: $DOCKER_ENGINE_VERSION
-- $(awk -F ': ' '$1 == "Maintainer" { print $2; exit }' debian/control) $(date --rfc-2822)
EOF
xx-go --wrap
set -x
chmod -x debian/compat debian/control debian/docs
dpkg-buildpackage -us -uc
pkgoutput="/out/${PKG_DISTRO}/${PKG_SUITE}/$(xx-info arch)"
if [ -n "$(xx-info variant)" ]; then
pkgoutput="${pkgoutput}/$(xx-info variant)"
fi
mkdir -p "${pkgoutput}"
cp /root/docker* ${pkgoutput}/
EOT

FROM build-dummy AS builder-deb-darwin
FROM build-deb AS builder-deb-linux
FROM build-dummy AS builder-deb-windows
FROM builder-deb-${TARGETOS} AS builder-deb

# rpm
FROM --platform=$BUILDPLATFORM ${PKG_BASE_IMAGE} AS build-base-rpm
COPY --from=xx / /
ENV GOPROXY="https://proxy.golang.org|direct"
ENV GOPATH="/go"
ENV GO111MODULE="off"
ENV PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"
ENV DOCKER_BUILDTAGS seccomp selinux
ENV RUNC_BUILDTAGS seccomp selinux
ARG PKG_RELEASE
RUN <<EOT
case "$PKG_RELEASE" in
centos7)
[ -f /etc/yum.repos.d/CentOS-Sources.repo ] && sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo
yum install -y git rpm-build rpmlint
;;
centos8)
[ -f /etc/yum.repos.d/CentOS-Stream-Sources.repo ] && sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Stream-Sources.repo
[ -f /etc/yum.repos.d/CentOS-Stream-PowerTools.repo ] && sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-Stream-PowerTools.repo
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
dnf install -y rpm-build git rpmlint dnf-plugins-core
;;
centos9)
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
dnf install -y rpm-build git rpmlint dnf-plugins-core
dnf config-manager --set-enabled crb
;;
oraclelinux7)
[ -f /etc/yum.repos.d/CentOS-Sources.repo ] && sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Sources.repo
yum install -y git rpm-build rpmlint
yum-config-manager --enable ol7_addons --enable ol7_optional_latest
;;
oraclelinux8)
dnf install -y git rpm-build rpmlint dnf-plugins-core
dnf config-manager --enable ol8_addons --enable ol8_codeready_builder
;;
oraclelinux9)
dnf install -y git rpm-build rpmlint dnf-plugins-core
dnf config-manager --enable ol9_addons --enable ol9_codeready_builder
;;
fedora*)
dnf install -y git rpm-build rpmlint dnf-plugins-core
;;
esac
EOT

FROM build-base-rpm AS build-rpm
COPY rpm /root/rpmbuild/SPECS
ARG TARGETPLATFORM
RUN <<EOT
set -e
case "$PKG_RELEASE" in
centos7)
yum-builddep -y /root/rpmbuild/SPECS/*.spec
;;
oraclelinux7)
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/*.spec
;;
centos*|oraclelinux*)
dnf builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/*.spec
;;
*)
dnf builddep -y /root/rpmbuild/SPECS/*.spec
;;
esac
EOT
WORKDIR /root/rpmbuild
COPY --from=src-tgz /out/engine.tgz ./SOURCES/
ARG DOCKER_ENGINE_VERSION
ARG PKG_RELEASE
ARG PKG_DISTRO
ARG PKG_SUITE
ARG PKG_PACKAGER
ARG PKG_RPM_RELEASE
ARG SOURCE_DATE_EPOCH
RUN --mount=source=common,target=/common \
--mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go \
--mount=type=bind,from=src,source=/src,target=/usr/local/src/engine \
--mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/go/pkg/mod <<EOT
set -e
mkdir -p /out
if [ "$(xx-info arch)" != "$(TARGETPLATFORM= xx-info arch)" ]; then
echo "$(xx-info arch) architecture is not supported"
exit 0
fi
cp /common/systemd/* ./SOURCES/
rpmVersion=${DOCKER_ENGINE_VERSION#v}
rpmVersion=$(echo $rpmVersion | sed "s/-/~/")
xx-go --wrap
set -x
rpmDefine=(
--define "_version ${rpmVersion}"
--define "_origversion ${DOCKER_ENGINE_VERSION#v}"
--define "_release $PKG_RPM_RELEASE"
--define "_commit $(git --git-dir /usr/local/src/engine/.git rev-parse --short HEAD)"
)
case "$PKG_RELEASE" in
centos8|centos9|oraclelinux*)
rpmDefine+=(--define "_without_btrfs 1")
export DOCKER_BUILDTAGS="exclude_graphdriver_btrfs $DOCKER_BUILDTAGS"
;;
esac
rpmbuild -ba "${rpmDefine[@]}" /root/rpmbuild/SPECS/*.spec
pkgoutput="/out/${PKG_DISTRO}/${PKG_SUITE}/$(xx-info arch)"
if [ -n "$(xx-info variant)" ]; then
pkgoutput="${pkgoutput}/$(xx-info variant)"
fi
mkdir -p "${pkgoutput}"
cp ./RPMS/*/*.* ./SRPMS/* ${pkgoutput}/
EOT

FROM build-dummy AS builder-rpm-darwin
FROM build-rpm AS builder-rpm-linux
FROM build-dummy AS builder-rpm-windows
FROM builder-rpm-${TARGETOS} AS builder-rpm

# static
FROM --platform=$BUILDPLATFORM ${PKG_BASE_IMAGE} AS build-base-static
COPY --from=xx / /
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install -y --no-install-recommends clang dpkg-dev file git lld llvm pkg-config
ENV GOPROXY="https://proxy.golang.org|direct"
ENV GOPATH="/go"
ENV PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"
ENV GO111MODULE="off"
ARG TARGETPLATFORM
RUN xx-apt-get install -y \
bash \
binutils \
ca-certificates \
cmake \
curl \
gcc \
g++ \
libbtrfs-dev \
libc6-dev \
libdevmapper-dev \
libgcc-10-dev \
libltdl-dev \
pkg-config
FROM build-base-static AS build-static
ARG TARGETPLATFORM
ARG DOCKER_ENGINE_VERSION
ARG GO_LINKMODE=static
ARG DOCKER_BUILDTAGS="apparmor seccomp"
WORKDIR /go/src/github.com/docker/docker
RUN --mount=type=bind,from=src,source=/src,target=.,rw \
--mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go,rw \
--mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/go/pkg/mod <<EOT
set -ex
xx-go --wrap
mkdir -p /out/docker
VERSION=${DOCKER_ENGINE_VERSION} ./hack/make.sh binary
mv $(readlink -e ./bundles/binary-daemon/dockerd) /out/docker/dockerd
PREFIX=/out/docker TMP_GOPATH="/go" hack/dockerfile/install/install.sh tini
PREFIX=/out/docker TMP_GOPATH="/go" hack/dockerfile/install/install.sh proxy
xx-verify --static /out/docker/dockerd
xx-verify --static /out/docker/docker-proxy
xx-verify --static /out/docker/docker-init
EOT

FROM build-base-static AS builder-static
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install -y --no-install-recommends bash file zip tar
WORKDIR /build
ARG DOCKER_ENGINE_VERSION
ARG TARGETPLATFORM
RUN --mount=type=bind,from=src,source=/src,target=/src \
--mount=type=bind,from=build-static,source=/out,target=/build <<EOT
set -e
pkgoutput="/out/static/$(xx-info os)/$(xx-info arch)"
if [ -n "$(xx-info variant)" ]; then
pkgoutput="${pkgoutput}/$(xx-info variant)"
fi
mkdir -p "${pkgoutput}"
for pkgname in *; do
workdir=$(mktemp -d -t docker-packaging.XXXXXXXXXX)
mkdir -p "$workdir/${pkgname}"
(set -x ; cp ${pkgname}/* /src/LICENSE /src/README.md "$workdir/${pkgname}/")
if [ "$(xx-info os)" = "windows" ]; then
(set -x ; cd "$workdir" ; zip -r "${pkgoutput}/${pkgname}_${DOCKER_ENGINE_VERSION#v}.zip" ${pkgname})
else
(set -x ; tar -czf "${pkgoutput}/${pkgname}_${DOCKER_ENGINE_VERSION#v}.tgz" -C "$workdir" ${pkgname})
fi
done
EOT

FROM builder-${PKG_TYPE} AS build-pkg

FROM scratch AS pkg
COPY --from=build-pkg /out /
Loading