Remove support for boot2docker

This commit is contained in:
Joe Beda
2016-08-10 15:51:23 -07:00
parent 889e976621
commit 17454a04ac
8 changed files with 18 additions and 57 deletions

View File

@@ -5,8 +5,8 @@ Building Kubernetes is easy if you take advantage of the containerized build env
## Requirements
1. Docker, using one of the two following configurations:
1. **Mac OS X** You can either use docker-machine or boot2docker. See installation instructions [here](https://docs.docker.com/installation/mac/).
**Note**: You will want to set the boot2docker vm to have at least 3GB of initial memory or building will likely fail. (See: [#11852]( http://issue.k8s.io/11852)) and do not `make quick-release` from `/tmp/` (See: [#14773]( https://github.com/kubernetes/kubernetes/issues/14773))
1. **Mac OS X** You can either use Docker for Mac or docker-machine. See installation instructions [here](https://docs.docker.com/installation/mac/).
**Note**: You will want to set the Docker VM to have at least 3GB of initial memory or building will likely fail. (See: [#11852]( http://issue.k8s.io/11852)) and do not `make quick-release` from `/tmp/` (See: [#14773]( https://github.com/kubernetes/kubernetes/issues/14773))
2. **Linux with local Docker** Install Docker according to the [instructions](https://docs.docker.com/installation/#installation) for your OS. The scripts here assume that they are using a local Docker server and that they can "reach around" docker and grab results directly from the file system.
2. [Python](https://www.python.org)
3. **Optional** [Google Cloud SDK](https://developers.google.com/cloud/sdk/)
@@ -29,8 +29,8 @@ The following scripts are found in the `build/` directory. Note that all scripts
* `build/run.sh make test`: Run all unit tests
* `build/run.sh make test-integration`: Run integration test
* `build/run.sh make test-cmd`: Run CLI tests
* `build/copy-output.sh`: This will copy the contents of `_output/dockerized/bin` from any remote Docker container to the local `_output/dockerized/bin`. Right now this is only necessary on Mac OS X with `boot2docker` when your git repo isn't under `/Users`.
* `build/make-clean.sh`: Clean out the contents of `_output/dockerized` and remove any local built container images.
* `build/copy-output.sh`: This will copy the contents of `_output/dockerized/bin` from any the Docker container to the local `_output/dockerized/bin`.
* `build/make-clean.sh`: Clean out the contents of `_output/dockerized`, remove any container images and the data container
* `build/shell.sh`: Drop into a `bash` shell in a build container with a snapshot of the current repo code.
* `build/release.sh`: Build everything, test it, and (optionally) upload the results to a GCS bucket.

View File

@@ -176,14 +176,12 @@ function kube::build::docker_available_on_osx() {
fi
kube::log::status "No docker host is set. Checking options for setting one..."
if [[ -z "$(which docker-machine)" && -z "$(which boot2docker)" ]]; then
kube::log::status "It looks like you're running Mac OS X, yet none of Docker for Mac, docker-machine or boot2docker are on the path."
if [[ -z "$(which docker-machine)" ]]; then
kube::log::status "It looks like you're running Mac OS X, yet neither Docker for Mac or docker-machine can be found."
kube::log::status "See: https://docs.docker.com/machine/ for installation instructions."
return 1
elif [[ -n "$(which docker-machine)" ]]; then
kube::build::prepare_docker_machine
elif [[ -n "$(which boot2docker)" ]]; then
kube::build::prepare_boot2docker
fi
fi
}
@@ -219,29 +217,6 @@ function kube::build::prepare_docker_machine() {
return 0
}
function kube::build::prepare_boot2docker() {
kube::log::status "boot2docker cli has been deprecated in favor of docker-machine."
kube::log::status "See: https://github.com/boot2docker/boot2docker-cli for more details."
if [[ $(boot2docker status) != "running" ]]; then
kube::log::status "boot2docker isn't running. We'll try to start it."
boot2docker up || {
kube::log::error "Can't start boot2docker."
kube::log::error "You may need to 'boot2docker init' to create your VM."
return 1
}
fi
# Reach over and set the clock. After sleep/resume the clock will skew.
kube::log::status "Setting boot2docker clock"
boot2docker ssh sudo date -u -D "%Y%m%d%H%M.%S" --set "$(date -u +%Y%m%d%H%M.%S)" >/dev/null
kube::log::status "Setting boot2docker env variables"
$(boot2docker shellinit)
kube::log::status "boot2docker-vm has been successfully started."
return 0
}
function kube::build::is_osx() {
[[ "$(uname)" == "Darwin" ]]
}
@@ -274,15 +249,15 @@ function kube::build::ensure_docker_daemon_connectivity {
echo
echo "Possible causes:"
echo " - On Mac OS X, DOCKER_HOST hasn't been set. You may need to: "
echo " - Create and start your VM using docker-machine or boot2docker: "
echo " - docker-machine create -d ${DOCKER_MACHINE_DRIVER} ${DOCKER_MACHINE_NAME}"
echo " - boot2docker init && boot2docker start"
echo " - Set your environment variables using: "
echo " - eval \$(docker-machine env ${DOCKER_MACHINE_NAME})"
echo " - \$(boot2docker shellinit)"
echo " - Update your Docker VM"
echo " - Error Message: 'Error response from daemon: client is newer than server (...)' "
echo " - docker-machine upgrade ${DOCKER_MACHINE_NAME}"
echo " - Set up Docker for Mac (https://docs.docker.com/docker-for-mac/)"
echo " - Or, set up docker-machine"
echo " - Create and start your VM using docker-machine: "
echo " - docker-machine create -d ${DOCKER_MACHINE_DRIVER} ${DOCKER_MACHINE_NAME}"
echo " - Set your environment variables using: "
echo " - eval \$(docker-machine env ${DOCKER_MACHINE_NAME})"
echo " - Update your Docker VM"
echo " - Error Message: 'Error response from daemon: client is newer than server (...)' "
echo " - docker-machine upgrade ${DOCKER_MACHINE_NAME}"
echo " - On Linux, user isn't in 'docker' group. Add and relogin."
echo " - Something like 'sudo usermod -a -G docker ${USER-user}'"
echo " - RHEL7 bug and workaround: https://bugzilla.redhat.com/show_bug.cgi?id=1119282#c8"

View File

@@ -17,7 +17,7 @@
# Copies any built binaries off the Docker machine.
#
# This is a no-op on Linux when the Docker daemon is local. This is only
# necessary on Mac OS X with boot2docker.
# necessary on Mac OS X with docker-machine.
set -o errexit
set -o nounset
set -o pipefail

View File

@@ -56,7 +56,7 @@ MESOS_DOCKER_ADDON_TIMEOUT="${MESOS_DOCKER_ADDON_TIMEOUT:-180}"
# ${MESOS_DOCKER_WORK_DIR}/log - storage of component logs (written on deploy failure)
# ${MESOS_DOCKER_WORK_DIR}/auth - storage of SSL certs/keys/tokens
# ${MESOS_DOCKER_WORK_DIR}/<component>/mesos - storage of mesos slave work (e.g. task logs)
# If using docker-machine or boot2docker, should be under /Users (which is mounted from the host into the docker vm).
# If using docker-machine or Docker for Mac, should be under /Users (which is mounted from the host into the docker vm).
# If running in a container, $HOME should be resolved outside of the container.
MESOS_DOCKER_WORK_DIR="${MESOS_DOCKER_WORK_DIR:-${HOME}/tmp/kubernetes}"

View File

@@ -72,7 +72,7 @@ function cluster::mesos::docker::docker_compose_lazy_pull {
}
# Run kubernetes scripts inside docker.
# This bypasses the need to set up network routing when running docker in a VM (e.g. boot2docker).
# This bypasses the need to set up network routing when running docker in a VM (e.g. docker-machine).
# Trap signals and kills the docker container for better signal handing
function cluster::mesos::docker::run_in_docker_test {
local entrypoint="$1"

View File

@@ -39,7 +39,3 @@ docker:
docker-clean:
docker rmi clustering-seqdiag || true
docker images -q --filter "dangling=true" | xargs docker rmi
.PHONY: fix-clock-skew
fix-clock-skew:
boot2docker ssh sudo date -u -D "%Y%m%d%H%M.%S" --set "$(shell date -u +%Y%m%d%H%M.%S)"

View File

@@ -56,10 +56,6 @@ The first run will be slow but things should be fast after that.
To clean up the docker containers that are created (and other cruft that is left
around) you can run `make docker-clean`.
If you are using boot2docker and get warnings about clock skew (or if things
aren't building for some reason) then you can fix that up with
`make fix-clock-skew`.
## Automatically rebuild on file changes
If you have the fswatch utility installed, you can have it monitor the file

View File

@@ -144,12 +144,6 @@ readonly KUBE_TEST_SERVER_PLATFORMS=("${KUBE_SERVER_PLATFORMS[@]}")
# Gigabytes desired for parallel platform builds. 11 is fairly
# arbitrary, but is a reasonable splitting point for 2015
# laptops-versus-not.
#
# If you are using boot2docker, the following seems to work (note
# that 12000 rounds to 11G):
# boot2docker down
# VBoxManage modifyvm boot2docker-vm --memory 12000
# boot2docker up
readonly KUBE_PARALLEL_BUILD_MEMORY=11
readonly KUBE_ALL_TARGETS=(