All Projects → jmaxwilson → Wsl Docker Git Setup

jmaxwilson / Wsl Docker Git Setup

Licence: mit
Shell script to configure Windows Subsystem for Linux (WSL) & Ubuntu on Windows to use docker and docker-compose as well as a git-enabled prompt

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Wsl Docker Git Setup

wsl2exe
[TESTING]Use command in WSL from exe executable
Stars: ✭ 34 (+47.83%)
Mutual labels:  windows-10, wsl, windows-subsystem-linux
Wsl Programs
A community powered list of programs that work (and those that don't) on the Windows subsystem for Linux
Stars: ✭ 931 (+3947.83%)
Mutual labels:  wsl, windows-10, windows-subsystem-linux
Awesome Wsl
Awesome list dedicated to Windows Subsystem for Linux
Stars: ✭ 3,544 (+15308.7%)
Mutual labels:  wsl, windows-10, windows-subsystem-linux
Wslreverse
Experiments with hidden COM interface and LxBus IPC mechanism in WSL
Stars: ✭ 47 (+104.35%)
Mutual labels:  wsl, windows-10, windows-subsystem-linux
Archwsl
ArchLinux based WSL Distribution. Supports multiple install.
Stars: ✭ 3,667 (+15843.48%)
Mutual labels:  wsl, windows-10, windows-subsystem-linux
Wsl Ssh Pageant
A Pageant -> TCP bridge for use with WSL, allowing for Pageant to be used as an ssh-ageant within the WSL environment.
Stars: ✭ 381 (+1556.52%)
Mutual labels:  wsl, windows-10, windows-subsystem-linux
Wsldl
Advanced WSL launcher / installer. (Win10 FCU x64/arm64 or later.)
Stars: ✭ 782 (+3300%)
Mutual labels:  wsl, windows-10, windows-subsystem-linux
Wslinstall
Install any GNU/Linux userspace in WSL
Stars: ✭ 178 (+673.91%)
Mutual labels:  wsl, windows-10, windows-subsystem-linux
Alpinewsl
Alpine Linux based WSL distribution. Supports multi-install. Lightest WSL distribution.
Stars: ✭ 203 (+782.61%)
Mutual labels:  wsl, windows-10, windows-subsystem-linux
WSL-manager
unofficial gui manager for Windows Subsystem for Linux (WSL)
Stars: ✭ 25 (+8.7%)
Mutual labels:  windows-10, wsl, windows-subsystem-linux
Centwsl
[DISCONTINUED] CentOS based WSL distribution
Stars: ✭ 766 (+3230.43%)
Mutual labels:  wsl, windows-10, windows-subsystem-linux
Deploy Docker Swarm
Deploy scripts for docker-swarm.
Stars: ✭ 17 (-26.09%)
Mutual labels:  bash-script, docker-compose
wsl-agent-bridge
WSL compatibility bridge for ssh-agent on Windows
Stars: ✭ 17 (-26.09%)
Mutual labels:  windows-10, wsl
uniterm
🚧Universal Terminal Emulator, might be a great toy terminal front-end for geeks.
Stars: ✭ 22 (-4.35%)
Mutual labels:  wsl, windows-subsystem-linux
Weasel Pageant
Deprecated: An ssh-agent compatible helper for interacting with Pageant from processes running on the Windows Subsystem for Linux.
Stars: ✭ 256 (+1013.04%)
Mutual labels:  wsl, windows-subsystem-linux
Fedora Remix For Wsl
Fedora Remix for Windows Subsystem for Linux.
Stars: ✭ 284 (+1134.78%)
Mutual labels:  wsl, windows-10
Wsl Terminal
Terminal emulator for Windows Subsystem for Linux (WSL)
Stars: ✭ 3,120 (+13465.22%)
Mutual labels:  wsl, windows-subsystem-linux
webi-installers
Primary and community-submitted packages for webinstall.dev
Stars: ✭ 421 (+1730.43%)
Mutual labels:  windows-10, wsl
Wsl Ssh Agent
Helper to interface with Windows ssh-agent.exe service from Windows Subsystem for Linux (WSL)
Stars: ✭ 298 (+1195.65%)
Mutual labels:  wsl, windows-subsystem-linux
Lnmp
💻 🐳 🐘 🐬 🐧 🚀 Start Docker LNMP(LEMP) In less than 2 minutes Powered by Docker Compose. 让 PHP 开发者快速(一键)搭建基于容器技术(Docker、Kubernetes)的开发、测试、生产(CI/CD by Drone)环境.
Stars: ✭ 341 (+1382.61%)
Mutual labels:  wsl, docker-compose

wsl-docker-git-setup

This is a shell script that can be run in the Ubuntu for Windows Bash running on the Windows Subsystem for Linux (WSL) to configure Bash for development using commandline Docker and Git commands on Windows 10. This makes it much easier to run most of the same docker scripts on Windows that you do on Linux or Mac by using WSL and Ubuntu Bash instead of GitBash and Git for Windows.

Prerequisits and Configuration

  • Windows 10 Professional
  • Windows Subsystem for Linux (WSL)
  • Docker for Windows

Installing the Windows Subsystem For Linux

Instructions for installing the Windows Subsystem for Linux on Windows 10 and Ubuntu for Windows can be found at the official WSL website:

https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

(The installation may require a system restart)

Once installation is complete, you should be able to start Ubuntu for Windows from the start menu. This project also includes an example shortcut for starting Ubuntu Bash.

Installing and Configuring Docker for Windows

Instructions for installing Docker for Windows can be found at the official Docker website:

https://store.docker.com/editions/community/docker-ce-desktop-windows

(The installatiion may require a system restart to enable Hyper-V)

Once Docker for Windows has been installed, you will need to configure it so that it can be accessed from the WSL bash.

  • Right click the Docker Whale icon in system tray
  • Select "Settings..."
  • Under the "General" section
    • Check the option to "Expose daemon on tcp://localhost:2375 without TLS"
  • Under the "Shared Drives" section
    • Check the C Drive
  • Apply Changes (You may be prompted for your login credentials)

WSL Docker Git Setup Script

Git comes installed by default with Ubuntu for Windows. You can clone this repository immediately from your WSL Bash by running:

git clone https://github.com/jmaxwilson/wsl-docker-git-setup.git

Once the code has been cloned you can run wsl-setup.sh to configure your WSL Bash to be able to communicate with Docker for Windows and install a git-enabled commandline prompt that makes it easier to work with git from WSL.

cd wsl-docker-git-setup

./wsl-setup.sh

The interactive shell script:

  • Creates .bashrc_wsl file that is sourced from .bashrc for customizing the bash
  • Installs docker-ce and docker-compose and their dependencies for use on the commandline
  • Adds a DOCKER_HOST environment variable in .bashrc_wsl to allow docker to connect to Docker for Windows
  • Adds a symlink /c that points to the C drive shared by Docker for Windows (/mnt/c) so that docker paths will work properly
  • Adds a Git enabled prompt so that you can see Git branch information on the commandline
  • Sets the default directory when WSL Bash starts

Once the script has completed, you will need to exit bash and start it again for some of the changes to be applied.

You should be able to run docker and docker-compose commands from the WSL Ubuntu commandline on Windows as well as see git branch information in the command prompt.

You can test them by running:

docker info

docker-compose version

docker run hello-world

You can now run most of the same docker scripts on Windows that you do on Linux or Mac by using WSL and Ubuntu Bash.

Animated GIF of Docker running in Ubuntu Bash running on Windows WSL

Additional Customization and Install Scripts

This project also includes some additional scripts that are not run by the ./wsl-setup.sh script but that can be run individually for additional customization:

./create-aliases.sh - Creates aliases that override the default options for ls and tree

./dircolors.sh - Creates a ~/.dircolors file that overrides the display colors of directories

./git-dir-install.sh - Creates a git-dir function to make it easy to run git commands on directories

./golang-install.sh - Installs Go programming language support

./nodejs-install.sh - Installs NodeJS programming language support

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].