From e2c017e4a4f618847e5e5b7dc37670868755c8dc Mon Sep 17 00:00:00 2001 From: peusterm Date: Wed, 7 Feb 2018 11:51:11 +0100 Subject: [PATCH] Fixes Docker installation of --vimemu installer. Fixes two issues recently reported on OSM_TECH. 1. Docker permission issue. 2. Docker internet access issue. Solved by enforcing a docker service restart. Change-Id: Ic297bfa2db02eae676c03127c09f291f55b736fd Signed-off-by: peusterm --- installers/install_osm.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/installers/install_osm.sh b/installers/install_osm.sh index 9b05dd05..d7c895ac 100755 --- a/installers/install_osm.sh +++ b/installers/install_osm.sh @@ -403,16 +403,19 @@ function install_from_lxdimages(){ function install_docker_ce() { # installs and configures Docker CE echo "Installing Docker CE ..." - sudo apt-get install apt-transport-https ca-certificates software-properties-common + sudo apt-get -qq update + sudo apt-get install -y apt-transport-https ca-certificates 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-get -qq update - sudo apt-get install docker-ce - # user management + sudo apt-get install -y docker-ce echo "Adding user to group 'docker'" - sudo groupadd docker + sudo groupadd -f docker sudo usermod -aG docker $USER echo "... Docker CE installation done" + sleep 2 + sudo service docker restart + echo "... restarted Docker service" } function install_vimemu() { @@ -423,13 +426,13 @@ function install_vimemu() { git clone https://osm.etsi.org/gerrit/osm/vim-emu.git # build vim-emu docker echo "Building vim-emu Docker container..." - docker build -t vim-emu-img -f vim-emu/Dockerfile vim-emu/ + sudo docker build -t vim-emu-img -f vim-emu/Dockerfile vim-emu/ # start vim-emu container as daemon echo "Starting vim-emu Docker container 'vim-emu' ..." - docker run --name vim-emu -t -d --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-img python examples/osm_default_daemon_topology_2_pop.py + sudo docker run --name vim-emu -t -d --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock vim-emu-img python examples/osm_default_daemon_topology_2_pop.py echo "Waiting for 'vim-emu' container to start ..." sleep 5 - export VIMEMU_HOSTNAME=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vim-emu) + export VIMEMU_HOSTNAME=$(sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vim-emu) echo "vim-emu running at $VIMEMU_HOSTNAME ..." echo -e "You might be interested in adding the following OSM client env variables to your .bashrc file:" echo " export OSM_HOSTNAME=${OSM_HOSTNAME}" -- 2.25.1