Skip to content

Commit

Permalink
Merge pull request shipping-docker#26 from cringer/windows-support
Browse files Browse the repository at this point in the history
Windows support for Git Bash and WSL
  • Loading branch information
fideloper authored Nov 16, 2017
2 parents d036ea2 + a8214da commit 533cc7d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,13 @@ If you want to see how this workflow was developed, check out [Shipping Docker](

## Supported Systems

Vessel requires Docker, and currently only works on Mac and Linux.
Vessel requires Docker, and currently only works on Windows, Mac and Linux.

> Window support may come in the future. It will require running Hyper-V.
> Windows requires running Hyper-V. Using Git Bash (MINGW64) and WSL are supported. Native
Windows is still under development.

| Mac | Linux | Windows |
| ------------- |:-------------:|:-------:|
| Install Docker on [Mac](https://docs.docker.com/docker-for-mac/install/) | Install Docker on [Debian](https://docs.docker.com/engine/installation/linux/docker-ce/debian/) | Not Currently Supported |
| Install Docker on [Mac](https://docs.docker.com/docker-for-mac/install/) | Install Docker on [Debian](https://docs.docker.com/engine/installation/linux/docker-ce/debian/) | Install Docker on [Windows](https://docs.docker.com/docker-for-windows/install/) |
| | Install Docker on [Ubuntu](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/) | |
| | Install Docker on [CentOS](https://docs.docker.com/engine/installation/linux/docker-ce/centos/) | |
19 changes: 13 additions & 6 deletions docker-files/vessel
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

UNAMEOUT="$(uname -s)"
case "${UNAMEOUT}" in
Linux*) MACHINE=linux;;
Darwin*) MACHINE=mac;;
*) MACHINE="UNKNOWN"
Linux*) MACHINE=linux;;
Darwin*) MACHINE=mac;;
MINGW64_NT-10.0*) MACHINE=mingw64;;
*) MACHINE="UNKNOWN"
esac

if [ "$MACHINE" == "UNKNOWN" ]; then
echo "Unsupported system type"
echo "System must be a Macintosh or Linux"
echo "System must be a Macintosh, Linux or Windows"
echo ""
echo "System detection determined via uname command"
echo "If the following is empty, could not find uname command: $(which uname)"
Expand All @@ -18,16 +19,22 @@ fi

# Set environment variables for dev
if [ "$MACHINE" == "linux" ]; then
export XDEBUG_HOST=$(/sbin/ifconfig docker0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1)
if grep -q Microsoft /proc/version; then # WSL
export XDEBUG_HOST=10.0.75.1
else
export XDEBUG_HOST=$(/sbin/ifconfig docker0 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1)
fi
SEDCMD="sed -i"
elif [ "$MACHINE" == "mac" ]; then
export XDEBUG_HOST=$(ipconfig getifaddr en0) # Ethernet

if [ -z "$XDEBUG_HOST" ]; then
export XDEBUG_HOST=$(ipconfig getifaddr en1) # Wifi
fi

SEDCMD="sed -i .bak"
elif [ "$MACHINE" == "mingw64" ]; then # Git Bash
export XDEBUG_HOST=10.0.75.1
SEDCMD="sed -i"
fi

export APP_PORT=${APP_PORT:-80}
Expand Down

0 comments on commit 533cc7d

Please sign in to comment.