Last active
October 19, 2016 10:00
-
-
Save clarenceb/1b72793451ebbe743b4e4ad91a410db8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| function welcome { | |
| cat <<-EOF | |
| ____ _ _____ _ _ _ | |
| | _ \ ___ ___| | _____ _ __ |_ _| _| |_ ___ _ __(_) __ _| | | |
| | | | |/ _ \ / __| |/ / _ \ '__| | || | | | __/ _ \| '__| |/ _\` | | | |
| | |_| | (_) | (__| < __/ | | || |_| | || (_) | | | | (_| | | | |
| |____/ \___/ \___|_|\_\___|_| |_| \__,_|\__\___/|_| |_|\__,_|_| | |
| EOF | |
| echo "Docker Tutorial Check Script" | |
| } | |
| welcome | |
| echo "Step 0 - Removing left over VM from previous run (if it exists)" | |
| docker-machine rm -y check-vm 2>&1 || true | |
| echo "Step 1 - Test create a docker-machine" | |
| docker-machine create \ | |
| --driver virtualbox \ | |
| --virtualbox-cpu-count "1" \ | |
| --virtualbox-memory "1024" \ | |
| --virtualbox-no-share \ | |
| check-vm | |
| docker-machine ls | |
| echo "Step 2 - Test SSH on a docker-machine" | |
| docker-machine ssh check-vm echo 'SSH onto docker machine passed.' | |
| echo "Step 3 - Test get docker-machine IP address" | |
| check_vm_ip="$(docker-machine ip check-vm)" | |
| echo "Get docker machine ip address (${check_vm_ip}) passed." | |
| echo "Step 4 - Test execute container via docker client" | |
| eval $(docker-machine env check-vm) | |
| docker info | |
| docker run --rm -ti busybox echo 'Run docker container passed.' | |
| echo "Step 5 - Test remove docker-machine" | |
| docker-machine rm -y check-vm | |
| echo "Completed Successfully." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment