16
16
#
17
17
# Git commit from https://github.com/docker/docker-install when
18
18
# the script was uploaded (Should only be modified by upload job):
19
- SCRIPT_COMMIT_SHA=6a2b5fd
19
+ SCRIPT_COMMIT_SHA=490beaa
20
20
21
21
22
22
# This value will automatically get changed for:
@@ -46,6 +46,8 @@ x86_64-ubuntu-zesty
46
46
s390x-ubuntu-xenial
47
47
s390x-ubuntu-yakkety
48
48
s390x-ubuntu-zesty
49
+ ppc64le-ubuntu-xenial
50
+ ppc64le-ubuntu-zesty
49
51
aarch64-ubuntu-xenial
50
52
armv6l-raspbian-jessie
51
53
armv7l-raspbian-jessie
@@ -60,13 +62,17 @@ armv7l-ubuntu-zesty
60
62
"
61
63
62
64
mirror=' '
65
+ DRY_RUN=${DRY_RUN:- }
63
66
while [ $# -gt 0 ]; do
64
67
case " $1 " in
65
68
--mirror)
66
69
mirror=" $2 "
67
70
shift
68
71
;;
69
- * )
72
+ --dry-run)
73
+ DRY_RUN=1
74
+ ;;
75
+ --* )
70
76
echo " Illegal option $1 "
71
77
;;
72
78
esac
@@ -152,6 +158,14 @@ command_exists() {
152
158
command -v " $@ " > /dev/null 2>&1
153
159
}
154
160
161
+ is_dry_run () {
162
+ if [ -z " $DRY_RUN " ]; then
163
+ return 1
164
+ else
165
+ return 0
166
+ fi
167
+ }
168
+
155
169
get_distribution () {
156
170
lsb_dist=" "
157
171
# Every system that we officially support has /etc/os-release
@@ -164,6 +178,9 @@ get_distribution() {
164
178
}
165
179
166
180
echo_docker_as_nonroot () {
181
+ if is_dry_run; then
182
+ return
183
+ fi
167
184
if command_exists docker && [ -e /var/run/docker.sock ]; then
168
185
(
169
186
set -x
@@ -253,7 +270,7 @@ ee_notice() {
253
270
}
254
271
255
272
do_install () {
256
- echo " Executing docker install script, commit: $SCRIPT_COMMIT_SHA "
273
+ echo " # Executing docker install script, commit: $SCRIPT_COMMIT_SHA "
257
274
258
275
if command_exists docker; then
259
276
version=" $( docker -v | cut -d ' ' -f3 | cut -d ' ,' -f1) "
@@ -319,6 +336,10 @@ do_install() {
319
336
fi
320
337
fi
321
338
339
+ if is_dry_run; then
340
+ sh_c=" echo"
341
+ fi
342
+
322
343
# perform some very rudimentary platform detection
323
344
lsb_dist=$( get_distribution )
324
345
lsb_dist=" $( echo " $lsb_dist " | tr ' [:upper:]' ' [:lower:]' ) "
@@ -349,10 +370,7 @@ do_install() {
349
370
esac
350
371
;;
351
372
352
- * )
353
- if command_exists lsb_release; then
354
- dist_version=" $( lsb_release --codename | cut -f2) "
355
- fi
373
+ centos)
356
374
if [ -z " $dist_version " ] && [ -r /etc/os-release ]; then
357
375
dist_version=" $( . /etc/os-release && echo " $VERSION_ID " ) "
358
376
fi
@@ -363,6 +381,15 @@ do_install() {
363
381
exit 1
364
382
;;
365
383
384
+ * )
385
+ if command_exists lsb_release; then
386
+ dist_version=" $( lsb_release --codename | cut -f2) "
387
+ fi
388
+ if [ -z " $dist_version " ] && [ -r /etc/os-release ]; then
389
+ dist_version=" $( . /etc/os-release && echo " $VERSION_ID " ) "
390
+ fi
391
+ ;;
392
+
366
393
esac
367
394
368
395
# Check if this is a forked Linux distro
@@ -400,16 +427,18 @@ do_install() {
400
427
fi
401
428
apt_repo=" deb [arch=$( dpkg --print-architecture) ] $DOWNLOAD_URL /linux/$lsb_dist $dist_version $CHANNEL "
402
429
(
403
- set -x
404
- $sh_c ' apt-get update'
405
- $sh_c " apt-get install -y -q $pre_reqs "
406
- curl " $DOWNLOAD_URL /linux/$lsb_dist /gpg" | $sh_c ' apt-key add -'
430
+ if ! is_dry_run; then
431
+ set -x
432
+ fi
433
+ $sh_c ' apt-get update -qq >/dev/null'
434
+ $sh_c " DEBIAN_FRONTEND=noninteractive apt-get install -y -qq -o Dpkg::Options::=--force-confold $pre_reqs >/dev/null"
435
+ $sh_c " curl -fsSL \" $DOWNLOAD_URL /linux/$lsb_dist /gpg\" | apt-key add -qq - >/dev/null"
407
436
$sh_c " echo \" $apt_repo \" > /etc/apt/sources.list.d/docker.list"
408
437
if [ " $lsb_dist " = " debian" ] && [ " $dist_version " = " wheezy" ]; then
409
438
$sh_c ' sed -i "/deb-src.*download\.docker/d" /etc/apt/sources.list.d/docker.list'
410
439
fi
411
- $sh_c ' apt-get update'
412
- $sh_c ' apt-get install -o Dpkg::Options::=" --force-confold" -y -q docker-ce'
440
+ $sh_c ' apt-get update -qq >/dev/null '
441
+ $sh_c ' DEBIAN_FRONTEND=noninteractive apt-get install -y -qq - o Dpkg::Options::=--force-confold docker-ce >/dev/null '
413
442
)
414
443
echo_docker_as_nonroot
415
444
exit 0
@@ -439,11 +468,12 @@ do_install() {
439
468
pre_reqs=" yum-utils"
440
469
fi
441
470
(
442
- set -x
471
+ if ! is_dry_run; then
472
+ set -x
473
+ fi
443
474
$sh_c " $pkg_manager install -y -q $pre_reqs "
444
475
$sh_c " $config_manager --add-repo $yum_repo "
445
476
if [ " $CHANNEL " != " stable" ]; then
446
- echo " Info: Enabling channel '$CHANNEL ' for docker-ce repo"
447
477
$sh_c " $config_manager $enable_channel_flag docker-ce-$CHANNEL "
448
478
fi
449
479
$sh_c " $pkg_manager makecache"
0 commit comments