Git Product home page Git Product logo

babun-docker's Introduction

Hey! I'm @tiangolo (Sebastián Ramírez) 👋

I'm a software developer from Colombia. 🇨🇴

I currently live in Berlin, Germany. 🇩🇪

I have been building APIs and tools for Machine Learning and data systems, in Latin America, the Middle East, and now Europe, with different teams and organizations. 🌎

I created FastAPI, Typer and a bunch of other open source tools. 🚀

I like to build things with Deep Learning/Machine Learning, distributed systems, SQL and NoSQL databases, Docker, Python, TypeScript (and JavaScript), modern backend APIs, and modern frontend frameworks. 🤖

I'm currently dedicating a high percentage of my time to FastAPI, Typer, and my other open source projects. At the same time, I'm also helping a limited number of teams and organizations as an external consultant. If you would like to have my help with your team and product, feel free to contact me. 🤓

If my open source projects are useful for your product/company you can also sponsor my work on them. ☕

You can find me on:

babun-docker's People

Contributors

jason-cooke avatar jpraet avatar marcelotaube avatar murrayju avatar nfrigus avatar ptisserand avatar ronnypolley avatar tiangolo avatar unekinn avatar valmayaki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

babun-docker's Issues

docker:10: command not found: docker not found

STEPS FOLLOWED:

Open Babun terminal

 echo $0 

Output: ✅
-zsh

 curl -s https://raw.githubusercontent.com/tiangolo/babun-docker/master/setup.sh | source /dev/stdin 
 babun-docker-update 

Output: ✅
-- babun-docker: Updating babun-docker
Already up-to-date.

 docker ps 

Output: ❌
docker:10: command not found: docker not found

Line wrapping does not move to new line

Hi,
So I am having this issue on windows 7. If I docker exec -it or run a container and enter a long command the line-wraps somewhere in the middle of the terminal and instead of moving to the next line overwrites the existing line. Any ideas?

Unable to communicate with docker when proxy set

When http_proxy is set:
✓ (0) ~ $ docker ps

  • docker ps
  • [[ -z x ]]
  • [[ -z x ]]
  • IFS=
  • babun_docker_use_winpty=0
  • babun_docker_run_again=0
  • '/cygdrive/c/Program Files/Docker Toolbox/docker' ps
  • read -r line
  • echo 'error during connect: Get https://192.168.99.100:2376/v1.36/containers/json: Gateway Timeout'

The solution is to unset http_proxy before communicate with docker container.

diff --git a/bin/babun-docker.sh b/bin/babun-docker.sh
index 0efee21..01e8f0b 100644
--- a/bin/babun-docker.sh
+++ b/bin/babun-docker.sh
@@ -5,6 +5,9 @@ if [[ -z "$docker_bin" ]] ; then
   docker_bin=$(which docker) ;
 fi
 function docker {
+  # Remove proxy
+  PX=$http_proxy
+  unset http_proxy
   if [[ -z ${babun_docker_old_IFS+x} ]] ; then
     babun_docker_old_IFS=$IFS
   fi
@@ -79,4 +82,6 @@ function docker {
    docker $@
  fi
  IFS=$babun_docker_old_IFS
+  http_proxy=$PX
+  export http_proxy
 }

strange issue using winpty

hi,

from time to time i have this strange error message coming up :(

winpty

any ideas where and why ?

Thanks for this great tweak by the way

Volumes still not working

I let babun-docker set up the directory for my drives in VirtualBox, but when I attach the directory via docker run -v $(pwd):/some/directory -it image I still see an empty directory in /some/directory in my image. The drive seems to be properly listed in VirtualBox as a shared folder, so I'm not sure what's going wrong. :\

Problem connecting with winpty

When I launch docker run-it -v $(pwd):/c/Users/dev2/Projets\ web default bash it shows me that :

cannot enable tty mode on non tty input
babun-docker: Using winpty
Post http://127.0.0.1:2375/v1.20/containers/create: dial tcp 127.0.0.1:2375: ConnectEx tcp: Aucune connexion n'a pu être établie car l'ordinateur cible l'a expressément refusée..

  • Are you trying to connect to a TLS-enabled daemon without TLS?
  • Is your docker daemon up and running?

docker ps show me that :

Get http://127.0.0.1:2375/v1.20/containers/json: dial tcp 127.0.0.1:2375: ConnectEx tcp: Aucune connexion n’a pu être établie car l’ordinateur cible l’a expressément refusée..
babun-docker: Trying to start docker-machine default
Started machines may have new IP addresses. You may need to re-run the docker-machine env command.
babun-docker: Setting up docker-machine environment
open C:\Users\dev2.docker\machine\machines\default\server.pem: Le fichier spécifié est introuvable.
babun-docker: Running command again

I'm under Windows 8, Babun launched via ConEmu.

Add persistent mount support

Can you:

  1. Add some $babun_docker_persistent_volumes="c d" and insert mount command into /mnt/sda1/var/lib/boot2docker/profile
  2. Fix mount command to: sudo mount -t vboxsf -o "defaults,uid=id -u docker,gid=id -g docker,iocharset=utf8,rw"

docker-machine on babun gets different results than docker quickstart/cmd

When I first installed babun-docker, running docker-machine ls/start/stop behaved the same as the docker quickstart terminal. However, I upgraded docker toolbox (and virtualbox through the installer), and now when I try starting or stopping my default machine, if a docker-machine isn't already started, it starts one, but virtualbox shows the default box still offline. If one was started in the quickstart terminal, it goes through some work and then just says 'Machine "default" is already started/stopped.", and a docker-machine ps shows the state as Timeout. Starting a new machine goes through the process, I see all the commands of a machine starting, but no new machine starts up in the virtualbox interface. And if I start it in babun first, I can't start anything in quickstart terminal.

This is really frustrating, as it means I can't figure out what's starting my docker machines or where they live, or what settings are running. For now, I'm going to stop using docker with babun, which is frustrating, because it was great being able to use docker with babun.

docker run fail: cannot enable tty mode on non tty input

Hello, I use bubun and run below install command successfully, but after that when I run docker info I get error, see below logs:

{ ~ } » curl -s https://raw.githubusercontent.com/tiangolo/babun-docker/master/setup.sh | source /dev/stdin
--2016-04-24 12:26:07-- https://github.com/rprichard/winpty/releases/download/0.2.2/winpty-0.2.2-cygwin-2.4.1-ia32.tar.gz
Resolving github.com (github.com)... 127.8.0.1
Connecting to github.com (github.com)|127.8.0.1|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-cloud.s3.amazonaws.com/releases/3829192/1def7380-dc09-11e5-9d6b-b25fe84177fa.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160424%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160424T042635Z&X-Amz-Expires=300&X-Amz-Signature=3a12a9cc34c9e0b8595c1b0cda528eb9bd973a186e2d73cd52926574351e2bd7&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dwinpty-0.2.2-cygwin-2.4.1-ia32.tar.gz&response-content-type=application%2Foctet-stream [following]
--2016-04-24 12:26:36-- https://github-cloud.s3.amazonaws.com/releases/3829192/1def7380-dc09-11e5-9d6b-b25fe84177fa.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160424%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160424T042635Z&X-Amz-Expires=300&X-Amz-Signature=3a12a9cc34c9e0b8595c1b0cda528eb9bd973a186e2d73cd52926574351e2bd7&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dwinpty-0.2.2-cygwin-2.4.1-ia32.tar.gz&response-content-type=application%2Foctet-stream
Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 127.8.0.2
Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|127.8.0.2|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 738939 (722K) [application/octet-stream]
Saving to: ‘winpty-0.2.2-cygwin-2.4.1-ia32.tar.gz’

winpty-0.2.2-cygwin-2.4. 100%[====================================>] 721.62K 39.0KB/s in 66s s

2016-04-24 12:27:45 (10.9 KB/s) - ‘winpty-0.2.2-cygwin-2.4.1-ia32.tar.gz’ saved [738939/738939]

Cloning into '/home/sguo/.babun-docker'...
remote: Counting objects: 151, done.
remote: Total 151 (delta 0), reused 0 (delta 0), pack-reused 151
Receiving objects: 100% (151/151), 25.94 KiB | 7.00 KiB/s, done.
Resolving deltas: 100% (50/50), done.
Checking connectivity... done.
{ ~ } » docker info
Get http://127.0.0.1:2375/v1.19/info: EOF. Are you trying to connect to a TLS-enabled daemon without TLS?
{ ~ } » docker run -it ubuntu /bin/bash
cannot enable tty mode on non tty input
-- babun-docker: Using winpty
Post http://127.0.0.1:2375/v1.19/containers/create: EOF. Are you trying to connect to a TLS-enabled
daemon without TLS?
{ ~ } » bubun-docker-update
bash: bubun-docker-update: command not found

Any ideas?

Could not read CA certificate

I have the latest version of babun, babun-docker and Docker Toolbox for Windows installed.

The Docker Quickstart Terminal works as expected, when running a command such as docker run hello-world. When trying to run the same command in Babun, I reveieve the following message: Could not read CA certificate "C:\ca.pem": open C:%

Any thoughts on what the issue might be here?

Setup does not work when spaces are in PATH

/home/kun/.babun-docker/setup.sh:export:51: not valid in this context: Files/ConEmu:/cygdrive/c/Program

needed to manually put quotes around statement like:
export PATH="$PATH:$babun_docker_winpty_dir"

bash: console: command not found

Seems like there is some dependency on something called console?

$ docker run -it ubuntu bash
the input device is not a TTY.  If you are using mintty, try prefixing the command with 'winpty'
-- babun-docker: Using winpty
bash: console: command not found

docker exec not working with Docker for Windows Desktop

Hi,

I tried installing babun-docker to use docker w/ babun. Whenever I use docker commands, I get:

the input device is not a TTY.  If you are using mintty, try prefixing the command with 'winpty'
-- babun-docker: Using winpty

It also seems that the "console" alias is not set. It would be nice to use babun w/ docker but I'm about ready to give up. I've tried running babun-docker-update and updating babun itself but nothing seems to work.

Problems under bash

Cool project!

I use bash (unwilling to change). I followed the setup instructions, did curl and update. I had two issues...

First, the winpty binaries were never found by the shell even though the path you set looks correct. Very strange. I copied the winpty*.exe and winpty.dll to my ~/bin folder and then things worked.

Second, every time I run something that invokes babun-docker, I get this...

$ docker exec -it mycontainer ps
the input device is not a TTY.  If you are using mintty, try prefixing the command with 'winpty'
rm: remove regular file ‘/tmp/babun-docker-env-vars’? y
-- babun-docker: Using winpty
  PID TTY          TIME CMD
   70 ?        00:00:00 ps

It always prompts me to delete that "babun-docker-env-vars". I changed "babun-docker.sh" around line 70 to use rm -f when it deletes this file to avoid the prompt.

Hope this is helpful!

Cannot run setup on windows 10

Could not run neither of automatic nor manual setup on babun and have those errors instead;

Automatic

{ ~ }  » curl -s https://raw.githubusercontent.com/tiangolo/babun-docker/master/setup.sh | source /dev/stdin
bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
bash: bin/babun-docker.sh: line 7: syntax error near unexpected token `$'{\r''
'ash: bin/babun-docker.sh: line 7: `function docker {

Manual

{ .babun-docker } master » source ./setup.sh
bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
bash: ./setup.sh: line 78: syntax error near unexpected token `$'{\r''
'ash: ./setup.sh: line 78: `function babun-docker-update {

Docker exec isn't working for machines run outside VirtualBox

Problem is connected with docker machines run on other host like vSphere.

  app git:(develop) ✗ docker-machine ls
NAME      ACTIVE   DRIVER          STATE     URL                        SWARM   DOCKER        ERRORS
default   -        virtualbox      Stopped                                      Unknown
vm        *        vmwarevsphere   Running   tcp://192.168.1.213:2376           v17.04.0-ce

As it could be seen I have vm in started state. Then I wanted to docker exec one of my container.

Error response from daemon: No such container: app_php_1

By docker tutorial I need to do next actions.

➜  app git:(develop) ✗ docker-machine env vm
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.1.213:2376"
export DOCKER_CERT_PATH="C:\Users\name\.docker\machine\machines\vm"
export DOCKER_MACHINE_NAME="vm"
export COMPOSE_CONVERT_WINDOWS_PATHS="true"
# Run this command to configure your shell:
# eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env vm)

It suggested to run command above. After that everything would work in standard docker terminal.
I ran this command, but had to modify path I thought

 eval $("/cygdrive/c/Program Files/Docker Toolbox/docker-machine.exe" env vm)

At the end docker exec failed

➜  app git:(develop) ✗ docker exec -it app_php_1 bash
time="2017-04-14T16:47:52+05:00" level=info msg="Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows"
the input device is not a TTY.  If you are using mintty, try prefixing the command with 'winpty'
-- babun-docker: Using winpty
Could not start '"C:/Program Files/Git/cygdrive/c/Program Files/Docker Toolbox/docker" exec -it app_php_1 bash': Не удается найти указанный файл. (error 0x2)

It was not able to find specified path, which seemed incorrect.

Winpty not work

Cant see anything in console (
Commands are running, but not displayed.
image
image

docker login issue

I got this error from docker login; I actually want to uninstall babun-docker since it seems to take over my "normal" docker command, e.g.:

 ~/aws  docker login
Warning: failed to get default registry endpoint from daemon (An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.23/info: open //./pipe/docker_engine: The system cannot find the file specified.). Using system default: https://index.docker.io/v1/
-- babun-docker: Setting VirtualBox shared folder for drive c
VBoxManage.exe: error: The machine 'default' is already locked for a session (or being unlocked)
VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 1012 of file VBoxManageMisc.cpp
-- babun-docker: Trying to start docker-machine default
Starting "default"...
Machine "default" is already running.
-- babun-docker: Volumes, creating directory for drive: c
-- babun-docker: Volumes, mounting drive: c

Problem with volumes

Hi! First of all, thank you for making this. I have been scouring the web for solutions, waiting for this bugfix to appear.. and it did!

It almost all works as expected: I can start babun, then docker, then I get the tty error, then babun-docker springs to life and forwards the parameters to the docker binary.... BUT... I cannot mount any docker volumes with, for example, -v $(pwd)/src:/var/www/. The folders stay empty within the docker container.

Any ideas? I'm assuming it is a problem with winpty not understanding the paths.

Dave

How to uninstall?

Where is the uninstall script for babun-docker? I used docker toolbox but i will install docker for windows so I need to un install babun-docker.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.