Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (58 sloc) 1.95 KB
SCRIPTPATH=$(dirname $0)
# Install docker on Oracle Linux.
# @author: Martien van den Akker, Darwin-IT Professionals.
function prop {
grep "${1}" $SCRIPTPATH/|cut -d'=' -f2
DOCKER_USER=$(prop 'docker.user')
echo 1. Install Docker Engine
echo . add ol7_addons and ol7_optional_latest repos.
sudo yum-config-manager --enable ol7_addons
sudo yum-config-manager --enable ol7_optional_latest
echo . install docker-engine
sudo yum install -q -y docker-engine
echo 2. Install curl
sudo yum install -q -y curl
echo 3. Add ${DOCKER_GROUP} group to ${DOCKER_USER}
sudo usermod -aG ${DOCKER_GROUP} ${DOCKER_USER}
echo 4. Check Docker install
docker --version
sudo systemctl start docker
sudo systemctl status docker
echo 5. Change docker default folder
# According to oracle-base you should create a filesystem, preferably using BTRFS, for the container-home.
# But let's stick with ext4.
## Adapted from
echo 5.1. Find Storage Driver
GREP_STRG_DRVR=$(sudo docker info |grep "Storage Driver")
echo "Storage Driver: ${DOCKER_STORAGE_DRVR}"
echo 5.2. Stop docker
sudo systemctl stop docker
echo 5.3. Add reference to data folders for storage.
echo mkdir -p ${DOCKER_DATA_HOME}
sudo mkdir ${DOCKER_DATA_HOME}
echo disable selinux enforcing
sudo setenforce 0
sudo sh -c "echo 'DOCKER_STORAGE_OPTIONS = --graph=\"${DOCKER_DATA_HOME}\" --storage-driver=${DOCKER_STORAGE_DRVR}' >> ${DOCKER_STORAGE_CFG}"
echo 5.4 Reload deamon
sudo systemctl daemon-reload
echo 5.5 Start docker again
sudo systemctl start docker