Docker Community Forums

Share and learn in the Docker community.

Trouble with installation


(Cartier) #1

I am brand new to docker. Running into an issue where the start .sh script will not run. Rather than executing, it simply opens in notepad. I have followed the installation instructions meticulously. Re-installing didn’t help.

Using Win 7, boot2docker 1.5.0 from https://github.com/boot2docker/windows-installer/releases/tag/v1.5.0.

Any suggestions would be greatly appreciated.

Thanks!


(Jerry Baker) #2

Hi Cartier,

This sounds like any file with the .sh extension is set to open with notepad. You can fix this by:

  • Clicking the start button and selecting Default Programs
  • On the Control Panel > All Control Panel Items > Default Programs window that comes up, click the Associate a file type or protocol with a program
  • In the list of file types you need to find and select the .sh extension
  • After you’ve selected .sh - Click the Change Program… button in the top right
  • You might have the sh.exe program listed in the Recommend Programs section - If so, select it, click OK, Click Close, and you should be good to go
  • If sh.exe isn’t listed you’re going to have to find it - Click the browse button and navigate to C:\Program Files (x86)\Git\Bin\ and select sh.exe - Click Open, Click OK, Click Close, then you should be set

Jerry


(Cartier) #3

Thank you for the detailed explanation Jerry. That worked to run the file. Now I am getting the following error when running the file:

line 5: clear: command not found

Here is the content of my start.sh:

#!/bin/bash
set -e

# clear the MSYS MOTD
clear

cd "$(dirname "$BASH_SOURCE")"

ISO="$HOME/.boot2docker/boot2docker.iso"

if [ ! -e "$ISO" ]; then
    echo 'copying initial boot2docker.iso (run "boot2docker.exe download" to update)'
    mkdir -p "$(dirname "$ISO")"
    cp ./boot2docker.iso "$ISO"
fi

echo 'initializing...'
./boot2docker.exe init
echo

echo 'starting...'
./boot2docker.exe start
echo

./boot2docker.exe ip

echo 'connecting...'
./boot2docker.exe ssh
echo

echo
echo '[Press any key to exit]'
read

(Jerry Baker) #4

Hi Cartier,

Could you open a terminal (Click start, type cmd, and press enter) - then run the command: echo %PATH%

In the text that is printed out, is the path to C:\Program Files\Boot2Docker for Windows in the list?

If not you can add it by running this command in the terminal: setx PATH “%PATH%;C:\Program Files\Boot2Docker for Windows”

Note: After adding that, you’ll need to close/reopen cmd before running echo %PATH% again.

If that path wasn’t there and you had to add it, does Boot2Docker run?


(Cartier) #5

Hi Jerry,

That path was not there, so I added it. Unfortunately, I am still getting that same error when running Boot2Docker:

line 5: clear: command not found


(Jerry Baker) #6

It seems like your install was corrupted. Do you remember any errors when you did it?

You could try to completely uninstall and the reinstall. Also, if you have any virus software running, you might disable it temporarily while you do the new install. - It could have possibly caused issues the first time.


(Cartier) #7

Hi Jerry,

I successfully loaded on a different machine. However, now I am getting an error when running the docker run hello-world example image.

Ran the command: docker run hello-world

and got back this error:

FATA[0000] Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
====

Any advice?


(Larry Cai) #8

It is due to the docker server is not started correctly

just restart the boot2docker vm or run sudo /etc/init.d/docker restart

In 1.5.0, it happens more frequent than before


(Larry Cai) #9

for the start.sh issues, it requires the “unix” environment to execute. It happens in clean Windows env often.

It could be the bug to be improved, I guess.