From 4609cc83e6686b9b56bf944820d3e966f2058463 Mon Sep 17 00:00:00 2001 From: Andrzej Kuriata Date: Wed, 25 Nov 2015 09:16:38 +0100 Subject: [PATCH] Deleting files not needed anymore --- examples/linux_prep.sh | 64 ------------------------------------------ 1 file changed, 64 deletions(-) delete mode 100755 examples/linux_prep.sh diff --git a/examples/linux_prep.sh b/examples/linux_prep.sh deleted file mode 100755 index 8e89255c1..000000000 --- a/examples/linux_prep.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -#http://www.apache.org/licenses/LICENSE-2.0.txt -# -# -#Copyright 2015 Intel Corporation -# -#Licensed under the Apache License, Version 2.0 (the "License"); -#you may not use this file except in compliance with the License. -#You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -#Unless required by applicable law or agreed to in writing, software -#distributed under the License is distributed on an "AS IS" BASIS, -#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#See the License for the specific language governing permissions and -#limitations under the License. - -HOST_PUBLIC_KEY_FILE="/root/.ssh/id_rsa.pub" -DOCKER_IMAGE_NAME="snap_image_ssh_container" -DOCKER_CONTAINER_NAME="snap_ssh_container" -DOCKER_MACHINE_NAME="snapcontainer" - -# Copy host's public key file here. It will be used as authorized_key in docker container (see Dockerfile). -if [[ -f $HOST_PUBLIC_KEY_FILE ]] - then - cp $HOST_PUBLIC_KEY_FILE . - else - echo "Missing host's public key file. Paswordless communication with container wouldn't be possible. Exiting." - exit 1 -fi - -echo "Building Docker image ..." -DOCKER_IMAGE_PRESENT=`docker images | grep "$DOCKER_IMAGE_NAME" | wc -l` -if [ $DOCKER_IMAGE_PRESENT -eq 0 ] - then - docker build -t $DOCKER_IMAGE_NAME . || exit 1 - else - echo "Docker image: $DOCKER_IMAGE_NAME already present. Skipping." -fi - -echo "Starting Docker container ..." -DOCKER_CONTAINER_RUNNING=`docker ps | grep "$DOCKER_CONTAINER_NAME" | wc -l` -if [ $DOCKER_CONTAINER_RUNNING -eq 0 ] - then - docker run -d -P --name $DOCKER_CONTAINER_NAME $DOCKER_IMAGE_NAME || exit 1 - else - echo "Docker container: $DOCKER_CONTAINER_NAME already running. Skipping." -fi - -# Host's public key no longer needed here. -rm ./id_rsa.pub - -echo "Building new docker-machine ..." -DOCKER_MACHINE_RUNNING=`docker-machine ls | grep "$DOCKER_MACHINE_NAME" | wc -l` -if [ $DOCKER_MACHINE_RUNNING -eq 0 ] - then - SSH_MAPPING_PORT=`docker port $DOCKER_CONTAINER_NAME 22 | cut -f2 -d":"` - docker-machine -D create -d generic --generic-ip-address=localhost --generic-ssh-port=$SSH_MAPPING_PORT $DOCKER_MACHINE_NAME - echo "Container name: $DOCKER_MACHINE_NAME" - else - echo "Docker machine: $DOCKER_MACHINE_NAME already running. Skipping." -fi