Skip to content
Merged
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ set -e
#
# $ sudo sh install-docker.sh --mirror AzureChinaCloud
#
# --setup-repo
#
# Use the --setup-repo option to configure Docker's package repositories without
# installing Docker packages. This is useful when you want to add the repository
# but install packages separately:
#
# $ sudo sh install-docker.sh --setup-repo
#
# ==============================================================================


Expand Down Expand Up @@ -110,6 +118,7 @@ fi

mirror=''
DRY_RUN=${DRY_RUN:-}
REPO_ONLY=${REPO_ONLY:-0}
while [ $# -gt 0 ]; do
case "$1" in
--channel)
Expand All @@ -127,6 +136,10 @@ while [ $# -gt 0 ]; do
VERSION="${2#v}"
shift
;;
--setup-repo)
REPO_ONLY=1
shift
;;
--*)
echo "Illegal option $1"
;;
Expand Down Expand Up @@ -519,6 +532,11 @@ do_install() {
$sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/docker.list"
$sh_c 'apt-get -qq update >/dev/null'
)

if [ "$REPO_ONLY" = "1" ]; then
exit 0
fi

pkg_version=""
if [ -n "$VERSION" ]; then
if is_dry_run; then
Expand Down Expand Up @@ -608,6 +626,11 @@ do_install() {
$sh_c "yum makecache"
fi
)

if [ "$REPO_ONLY" = "1" ]; then
exit 0
fi

pkg_version=""
if command_exists dnf; then
pkg_manager="dnf"
Expand Down