i'm trying to get a working docker-installation following this tutorial: http://docs.docker.io/en/latest/installation/windows/
So far, I got the VM running with a manually downloaded repository (followed the github-link and downloaded as zip, because "git clone" didnt work behind my corporate proxy, even after setting up the proxy with "git conf --global http.proxy ..." - it kept asking me for authentification 407, although i entered my user & PW). Now I am in the state in which i should use "docker run busybox echo hello world" (Section "Running Docker"). When i do this, i first get told that docker is not installed (as shown at the bottom of the tutorial), and then, after i got it with apt-get install docker, i get "Segmentation Fault or critical error encountered. dumping core and aborting."
What to do now? Is this because i didnt use git clone or is something wrong with the docker installation? I read somewhere, that apt-get install docker doesnt install the docker i want, but some GNOME-Tool, can i maybe specify my apt-request to get the right tool?
Windows Boot2Docker behind corporate proxy
(Context: March 2015, Windows 7, behind corporate proxy)
TLDR; see GitHub project
VonC/b2d
:Clone it and:
..\env.bat
following theenv.bat.template
,profile
' file,senv.bat
thenb2d.bat
.You then are in a properly customized
boot2docker
environment with:docker search/pull
.apt-get update/install
and you type adocker build
.Installation and first steps
If you are admin of your workstation, you can run boot2docker install on your Windows.
It currently comes with:
Then, once installed:
c:\path\to\Boot2Docker For Windows\
in your%PATH%
boot2docker init
boot2docker start
boot2docker ssh
exit
to exit the ssh session, andboot2docker ssh
to go back in: the history of commands you just typed is preserved.boot2docker stop
You actually can see the VM start or stop if you open the Virtual Box GUI, and type in a DOS cmd session
boot2docker start
orstop
.Hosts & Proxy: Windows => Boot2Docker => Docker Containers
The main point to understand is that you will need to manage 2 HOSTS:
(
%HOME%\.boot2docker\boot2docker.iso
=>.
%USERPROFILE%\VirtualBox VMs\boot2docker-vm\boot2docker-vm.vmdk
),In term of proxy, that means:
HTTP_PROXY
,HTTPS_PROXY
andNO_PROXY
environment variable (you probably have them already, and they can be used for instance by the Virtual Box to detect new versions of Virtual Box)http_proxy
,https_proxy
andno_proxy
(note the case, lowercase in the Linux environment) for:docker search nginx
).If not set, the next
docker pull
will get you adial tcp: lookup index.docker.io: no such host
.This is set in a new file
/var/lib/boot2docker/profile
: it isprofile
, not.profile
./home/docker/.ashrc
), if you need to execute any other command (other than docker) which would require internet access)RUN apt-get update
will get you a, for example,Could not resolve 'http.debian.net'
).That means you must add the lines
ENV http_proxy http://...
first, before anyRUN
command requiring internet access.A good
no_proxy
to set is:(with '
.company
' the domain name of your company, for the internal sites)Data persistence? Use folder sharing
The other point to understand is that boot2docker uses Tiny Core, a... tiny Linux distribution (the .iso file is only 26 MB).
And Tiny Core offers no persistence (except for a few technical folders): if you modify your
~/.ashrc
with all your preferred settings and alias... the nextboot2docker stop / boot2docker start
will restore a pristine Linux environment, with your modification gone.You need to make sure the VirtualBox has the Oracle_VM_VirtualBox_Extension_Pack downloaded and added in the Virtual Box / File / Settings / Extension / add the
Oracle_VM_VirtualBox_Extension_Pack-4.x.yy-zzzzz.vbox-extpack
file).As documented in boot2docker, you will have access (from your Tiny Core ssh session) to
/c/Users/<yourLogin>
(ie the%USERPROFILE%
is shared by Virtual Box)Port redirection? For container and for VirtualBox VM
The final point to understand is that no port is exported by default:
-p 80:80
for example in order to expose the 80 port of the container to the 80 port of the Linux session)The connection was reset
".For the first point,
docker run -it --rm --name my-apache-app -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4
won't work without a-p 80:80
in it.For the second point, define an alias
doskey vbm="c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" $*
, and then: - if the Virtual Box 'boot2docker-vm
' is not yet started, usesvbm modifyvm
- if the Virtual Box 'boot2docker-vm
' is already started, usesvbm controlvm
Typically, if I realize, during a boot2docker session, that the port 80 is not accessible from Windows:
Then, and only then, I can access http://127.0.0.1
Persistent settings: copied to docker service and docker account
In order to use
boot2docker
easily:%USERPROFILE%\prog\b2d
.profile
in it (directly in Windows, in%USERPROFILE%\prog\b2d
), with your settings and alias.For example (I modified the original
/home/docker/.ashrc
):(192.168.59.103 is usually the ip returned by
boot2docker ip
)Putting everything together to start a boot2docker session:
b2d.bat
b2d.bat
script in your%PATH%
which will:boot2docker
docker
service (which is restarted) and for the/home/docker
user account.That is:
In order to enter a new boot2docker session, with your settings defined exactly as you want, simply type:
And you are good to go:
End result:
docker search xxx
will work (it will access internet)docker build
will work (it will access internet if theENV http_proxy
directives are there)%USERPROFILE%\prog\b2d
can be modified right from~/b2d
.Or you actually can write and modify those same files (like some Dockerfile) right from your Windows session, using your favorite editor (instead of
vi
)And all this, behind a corporate firewall.
Bonus: http only
Tuan adds in the comments:
boot2docker ssh
,kill the docker process and
export http_proxy=http://proxy.com
, thendocker -d --insercure-registry docker.io