Last active
May 15, 2019 21:45
-
-
Save mikeslattery/c03bb551f33700f8b5b78ed60d699196 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# More seemless integration between git-bash/WSL/Cygwin and Docker for Windows | |
set -euo pipefail | |
( [ -d 'C:\'] && cygpath . > /dev/null; ) || \ | |
{ echo 'Must be run from GitBash, Msys or Cygwin'; exit 1; } | |
export MSYS_NO_PATHCONV=1 | |
USER="$(whoami)" | |
docker run \ | |
-v /host_mnt:/host_mnt -v /:/host \ | |
--rm alpine \ | |
sh " | |
mkdir -p /host/cygdrive /host/mnt /home | |
# MSys/Msys2/GitBash | |
ln -fs /host_mnt/c /host/c | |
ln -fs /host_mnt/c /host/C | |
# WSL | |
ln -fs /host_mnt/c /host/mnt/c | |
# Cygwin | |
ln -fs /host_mnt/c /host/cygdrive/c | |
ln -fs /host_mnt/c /host/cygdrive/C | |
if [ $HOME = /home/$USER ]; then | |
ln -fs $(cygpath -w "$HOME" | sed 's|^[cC]:|/host_mnt/c|; s|\\|/|g;') /host/home/$USER | |
fi | |
true" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I no longer like approach and I plan to delete. It's here for reference until thin.