Skip to content

Instantly share code, notes, and snippets.

@joshuacalloway
Created September 26, 2014 18:33
Show Gist options
  • Save joshuacalloway/51cc36160a009d3b01dc to your computer and use it in GitHub Desktop.
Save joshuacalloway/51cc36160a009d3b01dc to your computer and use it in GitHub Desktop.
simple docker copy directory doesn't work
mysqlidfull=$(docker run -e MYSQL_ROOT_PASSWORD=password -d mysql)
mysqlid=${mysqlidfull:0:4}
mysql=$(docker inspect $mysqlid | grep "Name" | grep "/" | sed 's/^.*\///g' | sed 's/".*$//g')
echo "mysql: ${mysql}"
docker cp ${mysql}:/var/lib/mysql .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment