File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ set -e
7575#
7676# $ sudo sh install-docker.sh --mirror AzureChinaCloud
7777#
78+ # --setup-repo
79+ #
80+ # Use the --setup-repo option to configure Docker's package repositories without
81+ # installing Docker packages. This is useful when you want to add the repository
82+ # but install packages separately:
83+ #
84+ # $ sudo sh install-docker.sh --setup-repo
85+ #
7886# ==============================================================================
7987
8088
110118
111119mirror=' '
112120DRY_RUN=${DRY_RUN:- }
121+ REPO_ONLY=${REPO_ONLY:- 0}
113122while [ $# -gt 0 ]; do
114123 case " $1 " in
115124 --channel)
@@ -127,6 +136,10 @@ while [ $# -gt 0 ]; do
127136 VERSION=" ${2# v} "
128137 shift
129138 ;;
139+ --setup-repo)
140+ REPO_ONLY=1
141+ shift
142+ ;;
130143 --* )
131144 echo " Illegal option $1 "
132145 ;;
@@ -519,6 +532,11 @@ do_install() {
519532 $sh_c " echo \" $apt_repo \" > /etc/apt/sources.list.d/docker.list"
520533 $sh_c ' apt-get -qq update >/dev/null'
521534 )
535+
536+ if [ " $REPO_ONLY " = " 1" ]; then
537+ exit 0
538+ fi
539+
522540 pkg_version=" "
523541 if [ -n " $VERSION " ]; then
524542 if is_dry_run; then
@@ -608,6 +626,11 @@ do_install() {
608626 $sh_c " yum makecache"
609627 fi
610628 )
629+
630+ if [ " $REPO_ONLY " = " 1" ]; then
631+ exit 0
632+ fi
633+
611634 pkg_version=" "
612635 if command_exists dnf; then
613636 pkg_manager=" dnf"
You can’t perform that action at this time.
0 commit comments