Skip to content

Quick fix to use Docker Toolbox with Babun (Cygwin)

Notifications You must be signed in to change notification settings

xinity/babun-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

babun-docker

Description

Workaround / fix to allow using Docker Tooblox from Babun.

It could work for Cygwin with some little modifications, but if you are using Cygwin, you should be using Babun. It's an improved Cygwin.

This program installs winpty, sets the environment variables and creates a function to embed docker, and to allow non-tty connections.

It also checks if the default docker-machine is running, if not, it tries to start it and set the environment to use it.

After using this, you don't have to "use" another program. You can keep using the docker commands as normal.

Installation

  • Install Babun and start a terminal.
  • Run the following command:
curl -s https://raw.githubusercontent.com/tiangolo/babun-docker/master/setup.sh | source /dev/stdin

Note: the previous command will get a script from this repository and run it immediately, performing all the needed steps to install everything (the same steps described in "Manual installation"). If you don't want to run it, you can do a manual installation.

Updating

  • To update babun-docker, after following the installation instructions, run the command:
babun-docker-update

Docker Volumes with Babun

If you want to set up Docker Volumes with Babun, to allow using commands like:

docker run -it -v $(pwd):/var/www ubuntu bash

Read this Wiki entry: Docker Volumes with Babun.


Manual installation

  • Go to your home directory:
cd
  • clone this repo in the specific directory, like:
git clone https://github.com/tiangolo/babun-docker.git ./.babun-docker
  • Enter that directory:
cd ./.babun-docker
  • Source the setup:
source ./setup.sh

The setup will:

  • Download and install Winpty to allow using Docker commands that enter a container
  • Create a command (function) to update babun-docker, with babun-docker-update
  • Add itself to the ~/.zshrc file to run at startup
  • Run (source) the script to fix Docker, wrapping it

The wrapper script (function) will try to call docker, if it fails, it will check what was the failure, try to fix it and run again.

The wrapper / fix will:

  • auto-start the default docker machine
  • set the environment variables for that default docker-machine
  • use winpty (console) to connect to a tty session to avoid errors, as in:
docker exec -it my_container bash

About

Quick fix to use Docker Toolbox with Babun (Cygwin)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%