Skip to content

Instantly share code, notes, and snippets.

@first087
Created December 29, 2016 02:21
Show Gist options
  • Save first087/2214c81114f190271d26c3e88da36104 to your computer and use it in GitHub Desktop.
Save first087/2214c81114f190271d26c3e88da36104 to your computer and use it in GitHub Desktop.
Script for attach drive D: into Docker Toolbox for Windows

How to use script

  1. Run Docker Toolbox from shortcut Docker Quickstart Terminal
  2. Shutdown boot2docker docker-machine stop
  3. Open VirtualBox and goto Settings of default machine
  4. At Shared Folders menu, click + icon, Select folder path to drive D: and set folder name is d, checked all options
  5. Copy attach-drive-d.sh script to Docker Toolbox folder (C:\Program Files\Docker Toolbox)
  6. Edit start.sh add command sh attach-drive-d.sh before finalize step
  7. Run Docker Toolbox from shortcut Docker Quickstart Terminal again
  8. Have fun!!!
#!/bin/bash
if [ "${VM}" == "default" ]; then
"${DOCKER_MACHINE}" ssh "${VM}" "sudo mkdir -p /d/"
"${DOCKER_MACHINE}" ssh "${VM}" "sudo mount -t vboxsf -o defaults,uid=\$(id -u docker),gid=\$(id -g docker) d /d/"
fi
# Add script before finalize step
sh attach-drive-d.sh
STEP="Finalize"
# ...
@first087
Copy link
Author

Test on Docker Toolbox 1.12.3 (boot2docker 1.12.5), can bypass step 5-6.

@hemanth23
Copy link

if it is c drive which i have to add, how do i do that? can i map it to C Drive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment