Skip to content

Instantly share code, notes, and snippets.

@sirkkalap
Created November 17, 2015 23:32
Show Gist options
  • Select an option

  • Save sirkkalap/7d84c18a1bb22709b489 to your computer and use it in GitHub Desktop.

Select an option

Save sirkkalap/7d84c18a1bb22709b489 to your computer and use it in GitHub Desktop.
Run a vanilla centos6 and mount current directory in it as /local
#!/bin/sh
BASEDIR=$(cd $(dirname $0); /bin/pwd)
if [ ! -z $DOCKER_MACHINE_NAME ]; then
ip=$(docker-machine ip $DOCKER_MACHINE_NAME)
docker run -i -t \
--name centos6 \
-v $BASEDIR:/local \
centos:6 \
bash
else
echo "docker-machine is needed."
echo "Check your environment for \$DOCKER_MACHINE_NAME"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment