Files
devstack-plugin-container/devstack/plugin.sh
Hongbin Lu 69716eb42f Add docker installation script
There are several projects that tried to install docker in different
ways. This potentially lead to failure of more than one such services
were enabled. This commit consolidate docker installation into
a devstack plugin so that other services could depend on it.

The initial script was mainly from Kuryr-libnetwork. Kuryr, Fuxi,
and Zun might leverage this script to install Docker in the future.

Change-Id: I97dbff2f361acc98b12ec6f40ab115c8548477a3
2017-04-17 17:13:45 -04:00

38 lines
981 B
Bash

# container - Devstack extras script to install container engine
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set -o xtrace
echo_summary "container's plugin.sh was called..."
source $DEST/devstack-plugin-container/devstack/lib/docker
(set -o posix; set)
if is_service_enabled container; then
if [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing container engine"
if [[ ${CONTAINER_ENGINE} == "docker" ]]; then
check_docker || install_docker
fi
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring container engine"
if [[ ${CONTAINER_ENGINE} == "docker" ]]; then
configure_docker
fi
fi
if [[ "$1" == "unstack" ]]; then
if [[ ${CONTAINER_ENGINE} == "docker" ]]; then
stop_docker
fi
fi
if [[ "$1" == "clean" ]]; then
# nothing needed here
:
fi
fi
# Restore xtrace
$XTRACE