brikis98 / docker-osx-dev

A productive development environment with Docker on OS X
http://www.ybrikman.com/writing/2015/05/19/docker-osx-dev/
MIT License
1.43k stars 106 forks source link

SSH cmd error! empty dirname? #124

Closed rileylark closed 8 years ago

rileylark commented 8 years ago

I've just tried to use docker-osx-dev for the first time. Install went well w/o warnings, but here's my first run:

Rileys-MacBook-Pro-3:devTools rel$ docker-osx-dev
2015-10-23 16:00:34 [INFO] Using sync paths from command line args: /Users/rel/Documents/build-setup-example/src
/usr/local/bin/docker-osx-dev: line 935: greadlink: command not found
2015-10-23 16:00:34 [INFO] Complete list of paths to sync: 
2015-10-23 16:00:34 [INFO] Using default exclude paths: .git
2015-10-23 16:00:34 [INFO] Complete list of paths to exclude: .git
2015-10-23 16:00:34 [INFO] Complete list of paths to include: 
2015-10-23 16:00:34 [INFO] Starting docker-osx-dev file syncing
2015-10-23 16:00:34 [INFO] Initializing docker machine default
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
2015-10-23 16:00:35 [INFO] Installing rsync in the Docker Host image
2015-10-23 16:00:35 [INFO] Performing initial sync of paths: 
SSH cmd error!
command: sudo mkdir -p  && sudo chown -R docker 
err    : exit status 1
output : BusyBox v1.23.1 (2015-02-22 15:53:49 UTC) multi-call binary.

Usage: mkdir [OPTIONS] DIRECTORY...

Create DIRECTORY

    -m MODE Mode
    -p  No error if exists; make parent directories as needed

From the command it looks like sudo mkdir -p was planning to add a directory name, but the directory name is blank. Am I missing a required param somewhere?

Here's my docker-compose.yml file:

webdev:
  build: webDevServer
  ports:
    - "3000:3000"
  volumes:
    - ../src:/appSrc

I appreciate any help! Let me know if I can provide any other info.

brikis98 commented 8 years ago

The log shows the error that caused this: /usr/local/bin/docker-osx-dev: line 935: greadlink: command not found. That command is used to process paths and without it, you ended up with an empty path and this mkdir error.

There are two things that are odd about this:

  1. We use set -e at the top of the script, so I would've expected docker-osx-dev to exit as soon as it hit the greadlink error and not to keep running...
  2. greadlink should have been installed during the docker-osx-dev install process (it's part of the coreutils package). When you run brew list, does coreutils appear in the list? Were there any errors in the log output from running the install?
rileylark commented 8 years ago

So I did hit a few hiccups during installation, but nothing that seemed huge:

Rileys-MacBook-Pro-3:devTools rel$ chmod +x /usr/local/bin/docker-osx-dev
Rileys-MacBook-Pro-3:devTools rel$ docker-osx-dev install
2015-10-23 15:54:09 [INFO] Starting install of docker-osx-dev
2015-10-23 15:54:09 [INFO] Updating HomeBrew
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami):admin /usr/local
Rileys-MacBook-Pro-3:devTools rel$ sudo chown -R $(whoami):admin /usr/local
Password:
Rileys-MacBook-Pro-3:devTools rel$ docker-osx-dev install
2015-10-23 15:54:29 [INFO] Starting install of docker-osx-dev
2015-10-23 15:54:29 [INFO] Updating HomeBrew

and after that, installation seemed to go well.

But: brew list | grep coreutils shows no results. I just ran brew install coreutils, and now I get an initial sync run, but docker-osx-dev fails when it tries to watch, with:

/usr/local/bin/docker-osx-dev: line 771: fswatch: command not found

So, I naively ran brew install fswatch... and right now everything seems to be working! It definitely seems like an install script broke before getting to these dependencies, but didn't report the error.

Thanks again for the help! I probably don't have time this week to find the bug here but if I can I'll try to submit a PR about it~

brikis98 commented 8 years ago
Error: The /usr/local directory is not writable.

That's the issue right there. Most things will not install correctly because of that, including the coreutils and fswatch dependencies. You've installed those by hand, which is fine as a workaround.

That said, I'm confused why the docker-osx-dev script didn't fail right after that, as the set -e flag is set. If anyone has time to take a look and submit a PR, I'd be very appreciative :)

rileylark commented 8 years ago

Wow, fantastic. Thanks!