This script is part of the Docker product,
and no longer maintained in this repository.
The script has been updated to install Docker CE
packages from https://download.docker.com, and is
now located in the https://github.com/docker/docker-install
repository.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -18,14 +18,6 @@ Generates AUTHORS; a file with all the names and corresponding emails of |
| 18 | 18 |
individual contributors. AUTHORS can be found in the home directory of |
| 19 | 19 |
this repository. |
| 20 | 20 |
|
| 21 |
-## Install (install.sh) |
|
| 22 |
- |
|
| 23 |
-Executable install script for installing Docker. If updates to this are |
|
| 24 |
-desired, please use hack/release.sh during a normal release. The following |
|
| 25 |
-one-liner may be used for script hotfixes: |
|
| 26 |
- |
|
| 27 |
-- `aws s3 cp --acl public-read hack/install.sh s3://get.docker.com/index` |
|
| 28 |
- |
|
| 29 | 21 |
## Make |
| 30 | 22 |
|
| 31 | 23 |
There are two make files, each with different extensions. Neither are supposed |
| 32 | 24 |
deleted file mode 100644 |
| ... | ... |
@@ -1,544 +0,0 @@ |
| 1 |
-#!/bin/sh |
|
| 2 |
-set -e |
|
| 3 |
-# |
|
| 4 |
-# This script is meant for quick & easy install via: |
|
| 5 |
-# 'curl -sSL https://get.docker.com/ | sh' |
|
| 6 |
-# or: |
|
| 7 |
-# 'wget -qO- https://get.docker.com/ | sh' |
|
| 8 |
-# |
|
| 9 |
-# For test builds (ie. release candidates): |
|
| 10 |
-# 'curl -fsSL https://test.docker.com/ | sh' |
|
| 11 |
-# or: |
|
| 12 |
-# 'wget -qO- https://test.docker.com/ | sh' |
|
| 13 |
-# |
|
| 14 |
-# For experimental builds: |
|
| 15 |
-# 'curl -fsSL https://experimental.docker.com/ | sh' |
|
| 16 |
-# or: |
|
| 17 |
-# 'wget -qO- https://experimental.docker.com/ | sh' |
|
| 18 |
-# |
|
| 19 |
-# Docker Maintainers: |
|
| 20 |
-# To update this script on https://get.docker.com, |
|
| 21 |
-# use hack/release.sh during a normal release, |
|
| 22 |
-# or the following one-liner for script hotfixes: |
|
| 23 |
-# aws s3 cp --acl public-read hack/install.sh s3://get.docker.com/index |
|
| 24 |
-# |
|
| 25 |
- |
|
| 26 |
-url="https://get.docker.com/" |
|
| 27 |
-apt_url="https://apt.dockerproject.org" |
|
| 28 |
-yum_url="https://yum.dockerproject.org" |
|
| 29 |
- |
|
| 30 |
-docker_key="-----BEGIN PGP PUBLIC KEY BLOCK----- |
|
| 31 |
-Version: GnuPG v1 |
|
| 32 |
- |
|
| 33 |
-mQINBFWln24BEADrBl5p99uKh8+rpvqJ48u4eTtjeXAWbslJotmC/CakbNSqOb9o |
|
| 34 |
-ddfzRvGVeJVERt/Q/mlvEqgnyTQy+e6oEYN2Y2kqXceUhXagThnqCoxcEJ3+KM4R |
|
| 35 |
-mYdoe/BJ/J/6rHOjq7Omk24z2qB3RU1uAv57iY5VGw5p45uZB4C4pNNsBJXoCvPn |
|
| 36 |
-TGAs/7IrekFZDDgVraPx/hdiwopQ8NltSfZCyu/jPpWFK28TR8yfVlzYFwibj5WK |
|
| 37 |
-dHM7ZTqlA1tHIG+agyPf3Rae0jPMsHR6q+arXVwMccyOi+ULU0z8mHUJ3iEMIrpT |
|
| 38 |
-X+80KaN/ZjibfsBOCjcfiJSB/acn4nxQQgNZigna32velafhQivsNREFeJpzENiG |
|
| 39 |
-HOoyC6qVeOgKrRiKxzymj0FIMLru/iFF5pSWcBQB7PYlt8J0G80lAcPr6VCiN+4c |
|
| 40 |
-NKv03SdvA69dCOj79PuO9IIvQsJXsSq96HB+TeEmmL+xSdpGtGdCJHHM1fDeCqkZ |
|
| 41 |
-hT+RtBGQL2SEdWjxbF43oQopocT8cHvyX6Zaltn0svoGs+wX3Z/H6/8P5anog43U |
|
| 42 |
-65c0A+64Jj00rNDr8j31izhtQMRo892kGeQAaaxg4Pz6HnS7hRC+cOMHUU4HA7iM |
|
| 43 |
-zHrouAdYeTZeZEQOA7SxtCME9ZnGwe2grxPXh/U/80WJGkzLFNcTKdv+rwARAQAB |
|
| 44 |
-tDdEb2NrZXIgUmVsZWFzZ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d+bNCcG1CdOYY+ZXVOcsjl73UYvtJrO0Rl/NpYERkZ5d/tzw4jZ6FCXgggA |
|
| 88 |
-/Zxcjk6Y1ZvIm8Mt8wLRFH9Nww+FVsCtaCXJLP8DlJLASMD9rl5QS9Ku3u7ZNrr5 |
|
| 89 |
-HWXPHXITX660jglyshch6CWeiUATqjIAzkEQom/kEnOrvJAtkypRJ59vYQOedZ1s |
|
| 90 |
-FVELMXg2UCkD/FwojfnVtjzYaTCeGwFQeqzHmM241iuOmBYPeyTY5veF49aBJA1g |
|
| 91 |
-EJOQTvBR8Q== |
|
| 92 |
-=Yhur |
|
| 93 |
-" |
|
| 94 |
- |
|
| 95 |
-mirror='' |
|
| 96 |
-while [ $# -gt 0 ]; do |
|
| 97 |
- case "$1" in |
|
| 98 |
- --mirror) |
|
| 99 |
- mirror="$2" |
|
| 100 |
- shift |
|
| 101 |
- ;; |
|
| 102 |
- *) |
|
| 103 |
- echo "Illegal option $1" |
|
| 104 |
- ;; |
|
| 105 |
- esac |
|
| 106 |
- shift $(( $# > 0 ? 1 : 0 )) |
|
| 107 |
-done |
|
| 108 |
- |
|
| 109 |
-case "$mirror" in |
|
| 110 |
- AzureChinaCloud) |
|
| 111 |
- apt_url="https://mirror.azure.cn/docker-engine/apt" |
|
| 112 |
- yum_url="https://mirror.azure.cn/docker-engine/yum" |
|
| 113 |
- ;; |
|
| 114 |
- Aliyun) |
|
| 115 |
- apt_url="https://mirrors.aliyun.com/docker-engine/apt" |
|
| 116 |
- yum_url="https://mirrors.aliyun.com/docker-engine/yum" |
|
| 117 |
- ;; |
|
| 118 |
-esac |
|
| 119 |
- |
|
| 120 |
-command_exists() {
|
|
| 121 |
- command -v "$@" > /dev/null 2>&1 |
|
| 122 |
-} |
|
| 123 |
- |
|
| 124 |
-echo_docker_as_nonroot() {
|
|
| 125 |
- if command_exists docker && [ -e /var/run/docker.sock ]; then |
|
| 126 |
- ( |
|
| 127 |
- set -x |
|
| 128 |
- $sh_c 'docker version' |
|
| 129 |
- ) || true |
|
| 130 |
- fi |
|
| 131 |
- your_user=your-user |
|
| 132 |
- [ "$user" != 'root' ] && your_user="$user" |
|
| 133 |
- # intentionally mixed spaces and tabs here -- tabs are stripped by "<<-EOF", spaces are kept in the output |
|
| 134 |
- cat <<-EOF |
|
| 135 |
- |
|
| 136 |
- If you would like to use Docker as a non-root user, you should now consider |
|
| 137 |
- adding your user to the "docker" group with something like: |
|
| 138 |
- |
|
| 139 |
- sudo usermod -aG docker $your_user |
|
| 140 |
- |
|
| 141 |
- Remember that you will have to log out and back in for this to take effect! |
|
| 142 |
- |
|
| 143 |
- WARNING: Adding a user to the "docker" group will grant the ability to run |
|
| 144 |
- containers which can be used to obtain root privileges on the |
|
| 145 |
- docker host. |
|
| 146 |
- Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface |
|
| 147 |
- for more information. |
|
| 148 |
- |
|
| 149 |
- EOF |
|
| 150 |
-} |
|
| 151 |
- |
|
| 152 |
-# Check if this is a forked Linux distro |
|
| 153 |
-check_forked() {
|
|
| 154 |
- |
|
| 155 |
- # Check for lsb_release command existence, it usually exists in forked distros |
|
| 156 |
- if command_exists lsb_release; then |
|
| 157 |
- # Check if the `-u` option is supported |
|
| 158 |
- set +e |
|
| 159 |
- lsb_release -a -u > /dev/null 2>&1 |
|
| 160 |
- lsb_release_exit_code=$? |
|
| 161 |
- set -e |
|
| 162 |
- |
|
| 163 |
- # Check if the command has exited successfully, it means we're in a forked distro |
|
| 164 |
- if [ "$lsb_release_exit_code" = "0" ]; then |
|
| 165 |
- # Print info about current distro |
|
| 166 |
- cat <<-EOF |
|
| 167 |
- You're using '$lsb_dist' version '$dist_version'. |
|
| 168 |
- EOF |
|
| 169 |
- |
|
| 170 |
- # Get the upstream release info |
|
| 171 |
- lsb_dist=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'id' | cut -d ':' -f 2 | tr -d '[[:space:]]') |
|
| 172 |
- dist_version=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'codename' | cut -d ':' -f 2 | tr -d '[[:space:]]') |
|
| 173 |
- |
|
| 174 |
- # Print info about upstream distro |
|
| 175 |
- cat <<-EOF |
|
| 176 |
- Upstream release is '$lsb_dist' version '$dist_version'. |
|
| 177 |
- EOF |
|
| 178 |
- else |
|
| 179 |
- if [ -r /etc/debian_version ] && [ "$lsb_dist" != "ubuntu" ] && [ "$lsb_dist" != "raspbian" ]; then |
|
| 180 |
- # We're Debian and don't even know it! |
|
| 181 |
- lsb_dist=debian |
|
| 182 |
- dist_version="$(cat /etc/debian_version | sed 's/\/.*//' | sed 's/\..*//')" |
|
| 183 |
- case "$dist_version" in |
|
| 184 |
- 9) |
|
| 185 |
- dist_version="stretch" |
|
| 186 |
- ;; |
|
| 187 |
- 8|'Kali Linux 2') |
|
| 188 |
- dist_version="jessie" |
|
| 189 |
- ;; |
|
| 190 |
- 7) |
|
| 191 |
- dist_version="wheezy" |
|
| 192 |
- ;; |
|
| 193 |
- esac |
|
| 194 |
- fi |
|
| 195 |
- fi |
|
| 196 |
- fi |
|
| 197 |
-} |
|
| 198 |
- |
|
| 199 |
-semverParse() {
|
|
| 200 |
- major="${1%%.*}"
|
|
| 201 |
- minor="${1#$major.}"
|
|
| 202 |
- minor="${minor%%.*}"
|
|
| 203 |
- patch="${1#$major.$minor.}"
|
|
| 204 |
- patch="${patch%%[-.]*}"
|
|
| 205 |
-} |
|
| 206 |
- |
|
| 207 |
-do_install() {
|
|
| 208 |
- architecture=$(uname -m) |
|
| 209 |
- case $architecture in |
|
| 210 |
- # officially supported |
|
| 211 |
- amd64|x86_64) |
|
| 212 |
- ;; |
|
| 213 |
- # unofficially supported with available repositories |
|
| 214 |
- armv6l|armv7l) |
|
| 215 |
- ;; |
|
| 216 |
- # unofficially supported without available repositories |
|
| 217 |
- aarch64|arm64|ppc64le|s390x) |
|
| 218 |
- cat 1>&2 <<-EOF |
|
| 219 |
- Error: This install script does not support $architecture, because no |
|
| 220 |
- $architecture package exists in Docker's repositories. |
|
| 221 |
- |
|
| 222 |
- Other install options include checking your distribution's package repository |
|
| 223 |
- for a version of Docker, or building Docker from source. |
|
| 224 |
- EOF |
|
| 225 |
- exit 1 |
|
| 226 |
- ;; |
|
| 227 |
- # not supported |
|
| 228 |
- *) |
|
| 229 |
- cat >&2 <<-EOF |
|
| 230 |
- Error: $architecture is not a recognized platform. |
|
| 231 |
- EOF |
|
| 232 |
- exit 1 |
|
| 233 |
- ;; |
|
| 234 |
- esac |
|
| 235 |
- |
|
| 236 |
- if command_exists docker; then |
|
| 237 |
- version="$(docker -v | cut -d ' ' -f3 | cut -d ',' -f1)" |
|
| 238 |
- MAJOR_W=1 |
|
| 239 |
- MINOR_W=10 |
|
| 240 |
- |
|
| 241 |
- semverParse $version |
|
| 242 |
- |
|
| 243 |
- shouldWarn=0 |
|
| 244 |
- if [ $major -lt $MAJOR_W ]; then |
|
| 245 |
- shouldWarn=1 |
|
| 246 |
- fi |
|
| 247 |
- |
|
| 248 |
- if [ $major -le $MAJOR_W ] && [ $minor -lt $MINOR_W ]; then |
|
| 249 |
- shouldWarn=1 |
|
| 250 |
- fi |
|
| 251 |
- |
|
| 252 |
- cat >&2 <<-'EOF' |
|
| 253 |
- Warning: the "docker" command appears to already exist on this system. |
|
| 254 |
- |
|
| 255 |
- If you already have Docker installed, this script can cause trouble, which is |
|
| 256 |
- why we're displaying this warning and provide the opportunity to cancel the |
|
| 257 |
- installation. |
|
| 258 |
- |
|
| 259 |
- If you installed the current Docker package using this script and are using it |
|
| 260 |
- EOF |
|
| 261 |
- |
|
| 262 |
- if [ $shouldWarn -eq 1 ]; then |
|
| 263 |
- cat >&2 <<-'EOF' |
|
| 264 |
- again to update Docker, we urge you to migrate your image store before upgrading |
|
| 265 |
- to v1.10+. |
|
| 266 |
- |
|
| 267 |
- You can find instructions for this here: |
|
| 268 |
- https://github.com/docker/docker/wiki/Engine-v1.10.0-content-addressability-migration |
|
| 269 |
- EOF |
|
| 270 |
- else |
|
| 271 |
- cat >&2 <<-'EOF' |
|
| 272 |
- again to update Docker, you can safely ignore this message. |
|
| 273 |
- EOF |
|
| 274 |
- fi |
|
| 275 |
- |
|
| 276 |
- cat >&2 <<-'EOF' |
|
| 277 |
- |
|
| 278 |
- You may press Ctrl+C now to abort this script. |
|
| 279 |
- EOF |
|
| 280 |
- ( set -x; sleep 20 ) |
|
| 281 |
- fi |
|
| 282 |
- |
|
| 283 |
- user="$(id -un 2>/dev/null || true)" |
|
| 284 |
- |
|
| 285 |
- sh_c='sh -c' |
|
| 286 |
- if [ "$user" != 'root' ]; then |
|
| 287 |
- if command_exists sudo; then |
|
| 288 |
- sh_c='sudo -E sh -c' |
|
| 289 |
- elif command_exists su; then |
|
| 290 |
- sh_c='su -c' |
|
| 291 |
- else |
|
| 292 |
- cat >&2 <<-'EOF' |
|
| 293 |
- Error: this installer needs the ability to run commands as root. |
|
| 294 |
- We are unable to find either "sudo" or "su" available to make this happen. |
|
| 295 |
- EOF |
|
| 296 |
- exit 1 |
|
| 297 |
- fi |
|
| 298 |
- fi |
|
| 299 |
- |
|
| 300 |
- curl='' |
|
| 301 |
- if command_exists curl; then |
|
| 302 |
- curl='curl -sSL' |
|
| 303 |
- elif command_exists wget; then |
|
| 304 |
- curl='wget -qO-' |
|
| 305 |
- elif command_exists busybox && busybox --list-modules | grep -q wget; then |
|
| 306 |
- curl='busybox wget -qO-' |
|
| 307 |
- fi |
|
| 308 |
- |
|
| 309 |
- # check to see which repo they are trying to install from |
|
| 310 |
- if [ -z "$repo" ]; then |
|
| 311 |
- repo='main' |
|
| 312 |
- if [ "https://test.docker.com/" = "$url" ]; then |
|
| 313 |
- repo='testing' |
|
| 314 |
- elif [ "https://experimental.docker.com/" = "$url" ]; then |
|
| 315 |
- repo='experimental' |
|
| 316 |
- fi |
|
| 317 |
- fi |
|
| 318 |
- |
|
| 319 |
- # perform some very rudimentary platform detection |
|
| 320 |
- lsb_dist='' |
|
| 321 |
- dist_version='' |
|
| 322 |
- if command_exists lsb_release; then |
|
| 323 |
- lsb_dist="$(lsb_release -si)" |
|
| 324 |
- fi |
|
| 325 |
- if [ -z "$lsb_dist" ] && [ -r /etc/lsb-release ]; then |
|
| 326 |
- lsb_dist="$(. /etc/lsb-release && echo "$DISTRIB_ID")" |
|
| 327 |
- fi |
|
| 328 |
- if [ -z "$lsb_dist" ] && [ -r /etc/debian_version ]; then |
|
| 329 |
- lsb_dist='debian' |
|
| 330 |
- fi |
|
| 331 |
- if [ -z "$lsb_dist" ] && [ -r /etc/fedora-release ]; then |
|
| 332 |
- lsb_dist='fedora' |
|
| 333 |
- fi |
|
| 334 |
- if [ -z "$lsb_dist" ] && [ -r /etc/oracle-release ]; then |
|
| 335 |
- lsb_dist='oracleserver' |
|
| 336 |
- fi |
|
| 337 |
- if [ -z "$lsb_dist" ] && [ -r /etc/centos-release ]; then |
|
| 338 |
- lsb_dist='centos' |
|
| 339 |
- fi |
|
| 340 |
- if [ -z "$lsb_dist" ] && [ -r /etc/redhat-release ]; then |
|
| 341 |
- lsb_dist='redhat' |
|
| 342 |
- fi |
|
| 343 |
- if [ -z "$lsb_dist" ] && [ -r /etc/photon-release ]; then |
|
| 344 |
- lsb_dist='photon' |
|
| 345 |
- fi |
|
| 346 |
- if [ -z "$lsb_dist" ] && [ -r /etc/os-release ]; then |
|
| 347 |
- lsb_dist="$(. /etc/os-release && echo "$ID")" |
|
| 348 |
- fi |
|
| 349 |
- |
|
| 350 |
- lsb_dist="$(echo "$lsb_dist" | tr '[:upper:]' '[:lower:]')" |
|
| 351 |
- |
|
| 352 |
- # Special case redhatenterpriseserver |
|
| 353 |
- if [ "${lsb_dist}" = "redhatenterpriseserver" ]; then
|
|
| 354 |
- # Set it to redhat, it will be changed to centos below anyways |
|
| 355 |
- lsb_dist='redhat' |
|
| 356 |
- fi |
|
| 357 |
- |
|
| 358 |
- case "$lsb_dist" in |
|
| 359 |
- |
|
| 360 |
- ubuntu) |
|
| 361 |
- if command_exists lsb_release; then |
|
| 362 |
- dist_version="$(lsb_release --codename | cut -f2)" |
|
| 363 |
- fi |
|
| 364 |
- if [ -z "$dist_version" ] && [ -r /etc/lsb-release ]; then |
|
| 365 |
- dist_version="$(. /etc/lsb-release && echo "$DISTRIB_CODENAME")" |
|
| 366 |
- fi |
|
| 367 |
- ;; |
|
| 368 |
- |
|
| 369 |
- debian|raspbian) |
|
| 370 |
- dist_version="$(cat /etc/debian_version | sed 's/\/.*//' | sed 's/\..*//')" |
|
| 371 |
- case "$dist_version" in |
|
| 372 |
- 9) |
|
| 373 |
- dist_version="stretch" |
|
| 374 |
- ;; |
|
| 375 |
- 8) |
|
| 376 |
- dist_version="jessie" |
|
| 377 |
- ;; |
|
| 378 |
- 7) |
|
| 379 |
- dist_version="wheezy" |
|
| 380 |
- ;; |
|
| 381 |
- esac |
|
| 382 |
- ;; |
|
| 383 |
- |
|
| 384 |
- oracleserver) |
|
| 385 |
- # need to switch lsb_dist to match yum repo URL |
|
| 386 |
- lsb_dist="oraclelinux" |
|
| 387 |
- dist_version="$(rpm -q --whatprovides redhat-release --queryformat "%{VERSION}\n" | sed 's/\/.*//' | sed 's/\..*//' | sed 's/Server*//')"
|
|
| 388 |
- ;; |
|
| 389 |
- |
|
| 390 |
- fedora|centos|redhat) |
|
| 391 |
- dist_version="$(rpm -q --whatprovides ${lsb_dist}-release --queryformat "%{VERSION}\n" | sed 's/\/.*//' | sed 's/\..*//' | sed 's/Server*//' | sort | tail -1)"
|
|
| 392 |
- ;; |
|
| 393 |
- |
|
| 394 |
- "vmware photon") |
|
| 395 |
- lsb_dist="photon" |
|
| 396 |
- dist_version="$(. /etc/os-release && echo "$VERSION_ID")" |
|
| 397 |
- ;; |
|
| 398 |
- |
|
| 399 |
- *) |
|
| 400 |
- if command_exists lsb_release; then |
|
| 401 |
- dist_version="$(lsb_release --codename | cut -f2)" |
|
| 402 |
- fi |
|
| 403 |
- if [ -z "$dist_version" ] && [ -r /etc/os-release ]; then |
|
| 404 |
- dist_version="$(. /etc/os-release && echo "$VERSION_ID")" |
|
| 405 |
- fi |
|
| 406 |
- ;; |
|
| 407 |
- |
|
| 408 |
- |
|
| 409 |
- esac |
|
| 410 |
- |
|
| 411 |
- # Check if this is a forked Linux distro |
|
| 412 |
- check_forked |
|
| 413 |
- |
|
| 414 |
- # Run setup for each distro accordingly |
|
| 415 |
- case "$lsb_dist" in |
|
| 416 |
- ubuntu|debian|raspbian) |
|
| 417 |
- export DEBIAN_FRONTEND=noninteractive |
|
| 418 |
- |
|
| 419 |
- did_apt_get_update= |
|
| 420 |
- apt_get_update() {
|
|
| 421 |
- if [ -z "$did_apt_get_update" ]; then |
|
| 422 |
- ( set -x; $sh_c 'sleep 3; apt-get update' ) |
|
| 423 |
- did_apt_get_update=1 |
|
| 424 |
- fi |
|
| 425 |
- } |
|
| 426 |
- |
|
| 427 |
- if [ "$lsb_dist" != "raspbian" ]; then |
|
| 428 |
- # aufs is preferred over devicemapper; try to ensure the driver is available. |
|
| 429 |
- if ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then |
|
| 430 |
- if uname -r | grep -q -- '-generic' && dpkg -l 'linux-image-*-generic' | grep -qE '^ii|^hi' 2>/dev/null; then |
|
| 431 |
- kern_extras="linux-image-extra-$(uname -r) linux-image-extra-virtual" |
|
| 432 |
- |
|
| 433 |
- apt_get_update |
|
| 434 |
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q '"$kern_extras" ) || true |
|
| 435 |
- |
|
| 436 |
- if ! grep -q aufs /proc/filesystems && ! $sh_c 'modprobe aufs'; then |
|
| 437 |
- echo >&2 'Warning: tried to install '"$kern_extras"' (for AUFS)' |
|
| 438 |
- echo >&2 ' but we still have no AUFS. Docker may not work. Proceeding anyways!' |
|
| 439 |
- ( set -x; sleep 10 ) |
|
| 440 |
- fi |
|
| 441 |
- else |
|
| 442 |
- echo >&2 'Warning: current kernel is not supported by the linux-image-extra-virtual' |
|
| 443 |
- echo >&2 ' package. We have no AUFS support. Consider installing the packages' |
|
| 444 |
- echo >&2 ' "linux-image-virtual" and "linux-image-extra-virtual" for AUFS support.' |
|
| 445 |
- ( set -x; sleep 10 ) |
|
| 446 |
- fi |
|
| 447 |
- fi |
|
| 448 |
- fi |
|
| 449 |
- |
|
| 450 |
- # install apparmor utils if they're missing and apparmor is enabled in the kernel |
|
| 451 |
- # otherwise Docker will fail to start |
|
| 452 |
- if [ "$(cat /sys/module/apparmor/parameters/enabled 2>/dev/null)" = 'Y' ]; then |
|
| 453 |
- if command -v apparmor_parser >/dev/null 2>&1; then |
|
| 454 |
- echo 'apparmor is enabled in the kernel and apparmor utils were already installed' |
|
| 455 |
- else |
|
| 456 |
- echo 'apparmor is enabled in the kernel, but apparmor_parser is missing. Trying to install it..' |
|
| 457 |
- apt_get_update |
|
| 458 |
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q apparmor' ) |
|
| 459 |
- fi |
|
| 460 |
- fi |
|
| 461 |
- |
|
| 462 |
- if [ ! -e /usr/lib/apt/methods/https ]; then |
|
| 463 |
- apt_get_update |
|
| 464 |
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q apt-transport-https ca-certificates' ) |
|
| 465 |
- fi |
|
| 466 |
- if [ -z "$curl" ]; then |
|
| 467 |
- apt_get_update |
|
| 468 |
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q curl ca-certificates' ) |
|
| 469 |
- curl='curl -sSL' |
|
| 470 |
- fi |
|
| 471 |
- if ! command -v gpg > /dev/null; then |
|
| 472 |
- apt_get_update |
|
| 473 |
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q gnupg2 || apt-get install -y -q gnupg' ) |
|
| 474 |
- fi |
|
| 475 |
- |
|
| 476 |
- # dirmngr is a separate package in ubuntu yakkety; see https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1634464 |
|
| 477 |
- if ! command -v dirmngr > /dev/null; then |
|
| 478 |
- apt_get_update |
|
| 479 |
- ( set -x; $sh_c 'sleep 3; apt-get install -y -q dirmngr' ) |
|
| 480 |
- fi |
|
| 481 |
- |
|
| 482 |
- ( |
|
| 483 |
- set -x |
|
| 484 |
- echo "$docker_key" | $sh_c 'apt-key add -' |
|
| 485 |
- $sh_c "mkdir -p /etc/apt/sources.list.d" |
|
| 486 |
- $sh_c "echo deb \[arch=$(dpkg --print-architecture)\] ${apt_url}/repo ${lsb_dist}-${dist_version} ${repo} > /etc/apt/sources.list.d/docker.list"
|
|
| 487 |
- $sh_c 'sleep 3; apt-get update; apt-get install -y -q docker-engine' |
|
| 488 |
- ) |
|
| 489 |
- echo_docker_as_nonroot |
|
| 490 |
- exit 0 |
|
| 491 |
- ;; |
|
| 492 |
- |
|
| 493 |
- fedora|centos|redhat|oraclelinux|photon) |
|
| 494 |
- if [ "${lsb_dist}" = "redhat" ]; then
|
|
| 495 |
- # we use the centos repository for both redhat and centos releases |
|
| 496 |
- lsb_dist='centos' |
|
| 497 |
- fi |
|
| 498 |
- $sh_c "cat >/etc/yum.repos.d/docker-${repo}.repo" <<-EOF
|
|
| 499 |
- [docker-${repo}-repo]
|
|
| 500 |
- name=Docker ${repo} Repository
|
|
| 501 |
- baseurl=${yum_url}/repo/${repo}/${lsb_dist}/${dist_version}
|
|
| 502 |
- enabled=1 |
|
| 503 |
- gpgcheck=1 |
|
| 504 |
- gpgkey=${yum_url}/gpg
|
|
| 505 |
- EOF |
|
| 506 |
- if [ "$lsb_dist" = "fedora" ] && [ "$dist_version" -ge "22" ]; then |
|
| 507 |
- ( |
|
| 508 |
- set -x |
|
| 509 |
- $sh_c 'sleep 3; dnf -y -q install docker-engine' |
|
| 510 |
- ) |
|
| 511 |
- elif [ "$lsb_dist" = "photon" ]; then |
|
| 512 |
- ( |
|
| 513 |
- set -x |
|
| 514 |
- $sh_c 'sleep 3; tdnf -y install docker-engine' |
|
| 515 |
- ) |
|
| 516 |
- else |
|
| 517 |
- ( |
|
| 518 |
- set -x |
|
| 519 |
- $sh_c 'sleep 3; yum -y -q install docker-engine' |
|
| 520 |
- ) |
|
| 521 |
- fi |
|
| 522 |
- echo_docker_as_nonroot |
|
| 523 |
- exit 0 |
|
| 524 |
- ;; |
|
| 525 |
- esac |
|
| 526 |
- |
|
| 527 |
- # intentionally mixed spaces and tabs here -- tabs are stripped by "<<-'EOF'", spaces are kept in the output |
|
| 528 |
- cat >&2 <<-'EOF' |
|
| 529 |
- |
|
| 530 |
- Either your platform is not easily detectable, is not supported by this |
|
| 531 |
- installer script (yet - PRs welcome! [hack/install.sh]), or does not yet have |
|
| 532 |
- a package for Docker. Please visit the following URL for more detailed |
|
| 533 |
- installation instructions: |
|
| 534 |
- |
|
| 535 |
- https://docs.docker.com/engine/installation/ |
|
| 536 |
- |
|
| 537 |
- EOF |
|
| 538 |
- exit 1 |
|
| 539 |
-} |
|
| 540 |
- |
|
| 541 |
-# wrapped up in a function so that we have some protection against only getting |
|
| 542 |
-# half the file during "curl | sh" |
|
| 543 |
-do_install |
| 544 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,63 +0,0 @@ |
| 1 |
-#!/usr/bin/env bash |
|
| 2 |
-set -e |
|
| 3 |
- |
|
| 4 |
-# This script modifies the install.sh script for domains and keys other than |
|
| 5 |
-# those used by the primary opensource releases. |
|
| 6 |
-# |
|
| 7 |
-# You can provide `url`, `yum_url`, `apt_url` and optionally `gpg_fingerprint` |
|
| 8 |
-# or `GPG_KEYID` as environment variables, or the defaults for open source are used. |
|
| 9 |
-# |
|
| 10 |
-# The lower-case variables are substituted into install.sh. |
|
| 11 |
-# |
|
| 12 |
-# gpg_fingerprint and GPG_KEYID are optional, defaulting to the opensource release |
|
| 13 |
-# key ("releasedocker"). Other GPG_KEYIDs will require you to mount a volume with
|
|
| 14 |
-# the correct contents to /root/.gnupg. |
|
| 15 |
-# |
|
| 16 |
-# It outputs the modified `install.sh` file to $DOCKER_RELEASE_DIR (default: $DEST) |
|
| 17 |
-# |
|
| 18 |
-# Example usage: |
|
| 19 |
-# |
|
| 20 |
-# docker run \ |
|
| 21 |
-# --rm \ |
|
| 22 |
-# --privileged \ |
|
| 23 |
-# -e "GPG_KEYID=deadbeef" \ |
|
| 24 |
-# -e "GNUPGHOME=/root/.gnupg" \ |
|
| 25 |
-# -v $HOME/.gnupg:/root/.gnupg \ |
|
| 26 |
-# -v $(pwd):/go/src/github.com/docker/docker/bundles \ |
|
| 27 |
-# "$IMAGE_DOCKER" \ |
|
| 28 |
-# hack/make.sh install-script |
|
| 29 |
- |
|
| 30 |
-: ${DOCKER_RELEASE_DIR:=$DEST}
|
|
| 31 |
-: ${GPG_KEYID:=releasedocker}
|
|
| 32 |
- |
|
| 33 |
-DEFAULT_URL="https://get.docker.com/" |
|
| 34 |
-DEFAULT_APT_URL="https://apt.dockerproject.org" |
|
| 35 |
-DEFAULT_YUM_URL="https://yum.dockerproject.org" |
|
| 36 |
-DEFAULT_GPG_FINGERPRINT="58118E89F3A912897C070ADBF76221572C52609D" |
|
| 37 |
- |
|
| 38 |
-: ${url:=$DEFAULT_URL}
|
|
| 39 |
-: ${apt_url:=$DEFAULT_APT_URL}
|
|
| 40 |
-: ${yum_url:=$DEFAULT_YUM_URL}
|
|
| 41 |
-if [[ "$GPG_KEYID" == "releasedocker" ]] ; then |
|
| 42 |
- : ${gpg_fingerprint:=$DEFAULT_GPG_FINGERPRINT}
|
|
| 43 |
-fi |
|
| 44 |
- |
|
| 45 |
-DEST_FILE="$DOCKER_RELEASE_DIR/install.sh" |
|
| 46 |
- |
|
| 47 |
-bundle_install_script() {
|
|
| 48 |
- mkdir -p "$DOCKER_RELEASE_DIR" |
|
| 49 |
- |
|
| 50 |
- if [[ -z "$gpg_fingerprint" ]] ; then |
|
| 51 |
- # NOTE: if no key matching key is in /root/.gnupg, this will fail |
|
| 52 |
- gpg_fingerprint=$(gpg --with-fingerprint -k "$GPG_KEYID" | grep "Key fingerprint" | awk -F "=" '{print $2};' | tr -d ' ')
|
|
| 53 |
- fi |
|
| 54 |
- |
|
| 55 |
- cp hack/install.sh "$DEST_FILE" |
|
| 56 |
- sed -i.bak 's#^url=".*"$#url="'"$url"'"#' "$DEST_FILE" |
|
| 57 |
- sed -i.bak 's#^apt_url=".*"$#apt_url="'"$apt_url"'"#' "$DEST_FILE" |
|
| 58 |
- sed -i.bak 's#^yum_url=".*"$#yum_url="'"$yum_url"'"#' "$DEST_FILE" |
|
| 59 |
- sed -i.bak 's#^gpg_fingerprint=".*"$#gpg_fingerprint="'"$gpg_fingerprint"'"#' "$DEST_FILE" |
|
| 60 |
- rm "${DEST_FILE}.bak"
|
|
| 61 |
-} |
|
| 62 |
- |
|
| 63 |
-bundle_install_script |
| 64 | 1 |
deleted file mode 100755 |
| ... | ... |
@@ -1,71 +0,0 @@ |
| 1 |
-#!/usr/bin/env bash |
|
| 2 |
-# This script is used for testing install.sh and that it works for |
|
| 3 |
-# each of component of our apt and yum repos |
|
| 4 |
-set -e |
|
| 5 |
- |
|
| 6 |
-: ${DEB_DIR:="$(pwd)/bundles/$(cat VERSION)/build-deb"}
|
|
| 7 |
- |
|
| 8 |
-if [[ ! -d "${DEB_DIR}" ]]; then
|
|
| 9 |
- echo "you must first run `make deb` or hack/make/build-deb" |
|
| 10 |
- exit 1 |
|
| 11 |
-fi |
|
| 12 |
- |
|
| 13 |
-test_deb_install(){
|
|
| 14 |
- # test for each Dockerfile in contrib/builder |
|
| 15 |
- |
|
| 16 |
- builderDir="contrib/builder/deb/${PACKAGE_ARCH}"
|
|
| 17 |
- pkgs=( $(find "${builderDir}/"*/ -type d) )
|
|
| 18 |
- if [ ! -z "$DOCKER_BUILD_PKGS" ]; then |
|
| 19 |
- pkgs=() |
|
| 20 |
- for p in $DOCKER_BUILD_PKGS; do |
|
| 21 |
- pkgs+=( "$builderDir/$p" ) |
|
| 22 |
- done |
|
| 23 |
- fi |
|
| 24 |
- for dir in "${pkgs[@]}"; do
|
|
| 25 |
- [ -d "$dir" ] || { echo >&2 "skipping nonexistent $dir"; continue; }
|
|
| 26 |
- local from="$(awk 'toupper($1) == "FROM" { print $2; exit }' "$dir/Dockerfile")"
|
|
| 27 |
- local dir=$(basename "$dir") |
|
| 28 |
- |
|
| 29 |
- if [[ ! -d "${DEB_DIR}/${dir}" ]]; then
|
|
| 30 |
- echo "No deb found for ${dir}"
|
|
| 31 |
- exit 1 |
|
| 32 |
- fi |
|
| 33 |
- |
|
| 34 |
- local script=$(mktemp /tmp/install-XXXXXXXXXX.sh) |
|
| 35 |
- cat <<-EOF > "${script}"
|
|
| 36 |
- #!/bin/bash |
|
| 37 |
- set -e |
|
| 38 |
- set -x |
|
| 39 |
- |
|
| 40 |
- apt-get update && apt-get install -y apparmor |
|
| 41 |
- |
|
| 42 |
- dpkg -i /root/debs/*.deb || true |
|
| 43 |
- |
|
| 44 |
- apt-get install -yf |
|
| 45 |
- |
|
| 46 |
- /etc/init.d/apparmor start |
|
| 47 |
- |
|
| 48 |
- # this will do everything _except_ load the profile into the kernel |
|
| 49 |
- ( |
|
| 50 |
- cd /etc/apparmor.d |
|
| 51 |
- /sbin/apparmor_parser --skip-kernel-load docker-engine |
|
| 52 |
- ) |
|
| 53 |
- EOF |
|
| 54 |
- |
|
| 55 |
- chmod +x "${script}"
|
|
| 56 |
- |
|
| 57 |
- echo "testing deb install for ${from}"
|
|
| 58 |
- docker run --rm -i --privileged \ |
|
| 59 |
- -v ${DEB_DIR}/${dir}:/root/debs \
|
|
| 60 |
- -v ${script}:/install.sh \
|
|
| 61 |
- ${from} /install.sh
|
|
| 62 |
- |
|
| 63 |
- rm -f ${script}
|
|
| 64 |
- done |
|
| 65 |
-} |
|
| 66 |
- |
|
| 67 |
-( |
|
| 68 |
- bundle .integration-daemon-start |
|
| 69 |
- test_deb_install |
|
| 70 |
- bundle .integration-daemon-stop |
|
| 71 |
-) 2>&1 | tee -a "$DEST/test.log" |
| 72 | 1 |
deleted file mode 100755 |
| ... | ... |
@@ -1,31 +0,0 @@ |
| 1 |
-#!/usr/bin/env bash |
|
| 2 |
-# This script is used for testing install.sh and that it works for |
|
| 3 |
-# each of component of our apt and yum repos |
|
| 4 |
-set -e |
|
| 5 |
- |
|
| 6 |
-test_install_script(){
|
|
| 7 |
- # these are equivalent to main, testing, experimental components |
|
| 8 |
- # in the repos, but its the url that will do the conversion |
|
| 9 |
- components=( experimental test get ) |
|
| 10 |
- |
|
| 11 |
- for component in "${components[@]}"; do
|
|
| 12 |
- # change url to specific component for testing |
|
| 13 |
- local test_url=https://${component}.docker.com
|
|
| 14 |
- local script=$(mktemp /tmp/install-XXXXXXXXXX.sh) |
|
| 15 |
- sed "s,url='https://get.docker.com/',url='${test_url}/'," hack/install.sh > "${script}"
|
|
| 16 |
- |
|
| 17 |
- chmod +x "${script}"
|
|
| 18 |
- |
|
| 19 |
- # test for each Dockerfile in contrib/builder |
|
| 20 |
- for dir in contrib/builder/*/*/; do |
|
| 21 |
- local from="$(awk 'toupper($1) == "FROM" { print $2; exit }' "$dir/Dockerfile")"
|
|
| 22 |
- |
|
| 23 |
- echo "running install.sh for ${component} with ${from}"
|
|
| 24 |
- docker run --rm -i -v ${script}:/install.sh ${from} /install.sh
|
|
| 25 |
- done |
|
| 26 |
- |
|
| 27 |
- rm -f ${script}
|
|
| 28 |
- done |
|
| 29 |
-} |
|
| 30 |
- |
|
| 31 |
-test_install_script |
| ... | ... |
@@ -295,18 +295,10 @@ EOF |
| 295 | 295 |
fi |
| 296 | 296 |
} |
| 297 | 297 |
|
| 298 |
-# Upload the index script |
|
| 299 |
-release_index() {
|
|
| 300 |
- echo "Releasing index" |
|
| 301 |
- url="$(s3_url)/" hack/make.sh install-script |
|
| 302 |
- write_to_s3 "s3://$BUCKET_PATH/index" < "bundles/$VERSION/install-script/install.sh" |
|
| 303 |
-} |
|
| 304 |
- |
|
| 305 | 298 |
main() {
|
| 306 | 299 |
[ "$SKIP_RELEASE_BUILD" = '1' ] || build_all |
| 307 | 300 |
setup_s3 |
| 308 | 301 |
release_binaries |
| 309 |
- release_index |
|
| 310 | 302 |
} |
| 311 | 303 |
|
| 312 | 304 |
main |