Add install on Ubuntu steps

This commit is contained in:
2018-02-14 09:54:55 +01:00
parent f226d71cee
commit 9c465f0ad2
2 changed files with 32 additions and 4 deletions

View File

@@ -20,6 +20,13 @@
# Import settings
. ./settings.sh
created_network=false
if ! docker network ls | grep -q ${MIP_PRIVATE_NETWORK}
then
docker network create ${MIP_PRIVATE_NETWORK}
created_network=true
fi
# 1. Create all the DB at once
echo "Create databases..."
db_id=$(docker run --rm -d \
@@ -75,3 +82,8 @@ do
done
docker stop ${db_id}
if ${created_network}
then
docker network rm ${MIP_PRIVATE_NETWORK}
fi

View File

@@ -20,13 +20,32 @@
# Import settings
. ./settings.sh
# Install docker, for ubuntu
sudo apt update
sudo apt install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt update
sudo apt install docker-ce
# Install docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# If requested, setup portainer:
if ${PORTAINER_ENABLED}
then
# Permanent storage for Portainer
mkdir -p ${PORTAINER_DATA}
docker run -d -p ${PORTAINER_PORT}:9000 \
sudo docker run -d -p ${PORTAINER_PORT}:9000 \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock:rw \
-v ${PORTAINER_DATA}:/data:rw \
@@ -44,6 +63,3 @@ mkdir -p ${MESOS_MASTER_LOGS}
mkdir -p ${MESOS_MASTER_TMP}
mkdir -p ${MESOS_SLAVE_LOGS}
mkdir -p ${MESOS_SLAVE_TMP}
# Preload the databases
./load_data.sh