@@ -26,6 +26,9 @@ function verify() {
26
26
}
27
27
28
28
function verify_deb() {
29
+ # First install prerequisites for our script and dpkg and apt to run correctly.
30
+ # This list SHOULD NOT include dependencies of docker itself, otherwise we would
31
+ # not be able to verify that our packages specify all the required dependencies.
29
32
apt-get update
30
33
apt-get -y install --no-install-recommends \
31
34
apt-transport-https \
@@ -44,16 +47,6 @@ function verify_deb() {
44
47
# All local packages need to be prefixed with `./` or else apt-get doesn't understand where to pull from
45
48
packages=$( echo " ${packages} " | awk ' $0="./"$0' | xargs)
46
49
47
- # For apt-get install, we don't want to install docker-scan-plugin, as it would
48
- # downgrade the already installed local package with an older version from
49
- # download.docker.com.
50
- # We search for packages starting with "docker-ce", which excludes "docker-scan-plugin"
51
- # as it doesn't have the "docker-ce" prefix. We match on "docker-c" so that we also
52
- # match "docker-ce.deb"
53
- apt_packages=$( find " packaging/deb/debbuild/${DIST_ID} -${DIST_VERSION} /" -type f -name " docker-c*.deb" )
54
- # All local packages need to be prefixed with `./` or else apt-get doesn't understand where to pull from
55
- apt_packages=$( echo " ${apt_packages} " | awk ' $0="./"$0' | xargs)
56
-
57
50
(
58
51
set -x
59
52
# Install the locally built packages using 'dpkg' because installing with
@@ -64,16 +57,27 @@ function verify_deb() {
64
57
# packages we know to be missing at this stage, and '--force-depends' to
65
58
# only warn about any other missing dependency.
66
59
#
67
- # Afterwards, we run 'apt-get install' with the '--fix-broken' option to
68
- # trigger installation of the dependencies, which should succceed succesfully.
69
60
# shellcheck disable=SC2086
70
61
dpkg \
71
62
--ignore-depends=containerd.io,iptables,libdevmapper,libdevmapper1.02.1 \
72
63
--force-depends \
73
64
-i ${packages}
74
65
66
+ # After installing the local packages, we run 'apt-get install' with the
67
+ # '--fix-broken' option to trigger installation of the dependencies, which
68
+ # should succeed successfully. This step is to verify that not only the
69
+ # packages can be installed, but also that all dependencies (including
70
+ # containerd.io) can be resolved correctly for the distro that we built for,
71
+ # before going through the whole pipeline and publishing the packages.
72
+ #
73
+ # The '--no-upgrade' option is set to prevent apt from attempting to install
74
+ # packages from download(-stage).docker.com that we already installed using
75
+ # the local packages above. Without this, installing (e.g.) ./docker-ce-cli
76
+ # would result in apt installing "docker-ce" from the package repository and
77
+ # produce a "the following packages will be DOWNGRADED" error.
78
+ #
75
79
# shellcheck disable=SC2086
76
- apt-get -y install --no-install-recommends --no-upgrade --fix-broken ${apt_packages }
80
+ apt-get -y install --no-install-recommends --no-upgrade --fix-broken ${packages }
77
81
)
78
82
docker --version
79
83
# FIXME this tries to connect to the docker daemon, which isn't started
0 commit comments