Giter Site home page Giter Site logo

dinghy's Introduction

dinghy

Docker on OS X with batteries included, aimed at making a more pleasant local development experience. Runs on top of docker-machine.

  • Faster volume sharing using NFS rather than built-in virtualbox/vmware file shares. A medium-sized Rails app boots in 5 seconds, rather than 30 seconds using vmware file sharing, or 90 seconds using virtualbox file sharing.
  • Filesystem events work on mounted volumes. Edit files on your host, and see guard/webpack/etc pick up the changes immediately.
  • Easy access to running containers using built-in DNS and HTTP proxy.

Dinghy creates its own VM using docker-machine, it will not modify your existing docker-machine VMs.

Dinghy runs as a wrapper around docker-machine, shelling out to create the VM and using daemons to start the various services such as NFS and DNS.

PROJECT STATUS

TL;DR I am still actively maintaining Dinghy, making small improvements and fixing issues. But it's unlikely that there will be any large new development efforts unless somebody else wants to step up and take them on. Docker for Mac is a great option for most, if not all, people.

When we started the Dinghy project, Docker for Mac did not exist and there wasn't a great option for using Docker on MacOS easily with high-performance file sharing.

These days, Dinghy still has a performance advantage over Docker for Mac in some use cases where you are sharing lots of files from a host volume. But for the most part, you are fine just using Docker for Mac, you don't necessarily need Dinghy. There is a lot of discussion around the pros and cons in this issue.

Dinghy also includes a HTTP(S) proxy and DNS server that can make developing web apps easier, especially if you switch between projects frequently. This proxy can now be used without Dinghy on top of Docker for Mac, see the instructions in the dinghy-http-proxy README.

FAQ and solutions to common problems

Before filing an issue, see the FAQ.

upgrading from vagrant

If you previously used a version of Dinghy that ran on top of Vagrant, read this.

install

First the prerequisites:

  1. OS X Yosemite (10.10) or higher
  2. Homebrew
  3. Docker and Docker Machine. These can either be installed with Homebrew (brew install docker docker-machine), or using a package such as the Docker Toolbox.
  4. A Virtual Machine provider for Docker Machine. Currently supported options are:

Then:

$ brew tap codekitchen/dinghy
$ brew install dinghy

You will need to install docker and docker-machine as well, either via Homebrew or the official Docker package downloads. To install with Homebrew:

$ brew install docker docker-machine

You can specify provider (xhyve, virtualbox, vmware or parallels), memory and CPU options when creating the VM. See available options:

$ dinghy help create

Then create the VM and start services with:

$ dinghy create --provider xhyve

Once the VM is up, you'll get instructions to add some Docker-related environment variables, so that your Docker client can contact the Docker server inside the VM. I'd suggest adding these to your .bashrc or equivalent.

Sanity check!

$ docker run --rm hello-world

CLI Usage

$ dinghy help
Commands:
  dinghy create          # create the docker-machine VM
  dinghy destroy         # stop and delete all traces of the VM
  dinghy halt            # stop the VM and services
  dinghy help [COMMAND]  # Describe available commands or one specific command
  dinghy ip              # get the VM's IP address
  dinghy restart         # restart the VM and services
  dinghy shellinit       # returns env variables to set, should be run like $(dinghy shellinit)
  dinghy ssh [args...]   # ssh to the VM
  dinghy status          # get VM and services status
  dinghy up              # start the Docker VM and services
  dinghy upgrade         # upgrade the boot2docker VM to the newest available
  dinghy version         # display dinghy version

DNS

Dinghy installs a DNS server listening on the private interface, which resolves *.docker to the Dinghy VM. For instance, if you have a running container that exposes port 3000 to the host, and you like to call it myrailsapp, you can connect to it at myrailsapp.docker port 3000, e.g. http://myrailsapp.docker:3000/ or telnet myrailsapp.docker 3000.

You can also connect back to your host OS X machine from within a docker container using the hostname hostmachine.docker. This connects to the virtual network interface, so any services running on the host machine that you want reachable from docker will have to be listening on this interface.

HTTP proxy

Dinghy will run a HTTP proxy inside a docker container in the VM, giving you easy access to web apps running in other containers.

For docker-compose projects, hostnames will be automatically generated based on the project and service names. For instance, a "web" service in a "myapp" docker-compose project will be automatically made available at http://web.myapp.docker

Hostnames can also be manually defined, by setting the VIRTUAL_HOST environment variable on a container.

The proxy has basic SSL support as well.

See the dinghy-http-proxy documentation for more details on how to configure and use the proxy.

Advanced proxy configuration can be placed in a file at HOME/.dinghy/proxy.conf. Details can be found in jwilder's nginx-proxy project.

Preferences

Dinghy creates a preferences file under HOME/.dinghy/preferences.yml, which can be used to override default options. This is an example of the default generated preferences:

:preferences:
  :proxy_disabled: false
  :fsevents_disabled: false
  :create:
    provider: virtualbox

If you want to override the Dinghy machine name (e.g. to change it to 'default' so it can work with Kitematic), it can be changed here. First, destroy your current dinghy VM and then add the following to your preferences.yml file:

:preferences:
.
.
.
  :machine_name: default

Same goes for the default Dinghy dns resolver '*.docker' it can be changed to '*.dev' for example:

:preferences:
.
.
.
  :dinghy_domain: dev

A note on NFS sharing

Dinghy shares your home directory (/Users/<you>) over NFS, using a private network interface between your host machine and the Dinghy Docker Host. This sharing is done using a separate NFS daemon, not the system NFS daemon.

Be aware that there isn't a lot of security around NFSv3 file shares. We've tried to lock things down as much as possible (this NFS daemon doesn't even listen on other interfaces, for example).

Custom NFS Mount Location

You can change the shared folder by setting the DINGHY_HOST_MOUNT_DIR and DINGHY_GUEST_MOUNT_DIR environment variables before starting the dinghy VM. Usually you'll want to set both vars to the same value. For instance if you want to share /code/projects over NFS rather than /Users/<you>, in bash:

$ dinghy halt
$ export DINGHY_HOST_MOUNT_DIR=/code/projects
$ export DINGHY_GUEST_MOUNT_DIR=/code/projects
$ dinghy up

There is an open issue for persisting this in the ~/.dinghy/preferences.yml file, and allowing multiple dirs to be exported: #169

Custom certficate directory

You can change the default certificates directory ~/.dinghy/certs by setting the DINGHY_CERT_PATH environment variable before starting the dinghy VM. This is useful if you have a custom NFS Mount location and your home directory is no more shared, in bash:

$ dinghy halt
$ export DINGHY_CERT_PATH=/code/projects/certs
$ dinghy up

Upgrading

If you didn't originally install Dinghy as a tap, you'll need to switch to the tap to pull in the latest release:

$ brew tap codekitchen/dinghy

To update Dinghy itself, run:

$ dinghy halt
$ brew upgrade dinghy unfs3
$ dinghy up

To update the Docker VM, run:

$ dinghy upgrade

This will run docker-machine upgrade and then restart the dinghy services.

Prereleases

You can install Dinghy's master branch with:

$ dinghy halt
$ brew reinstall --HEAD dinghy
$ dinghy up

This branch may be less stable, so this isn't recommended in general.

Built on

dinghy's People

Contributors

aisipos avatar codekitchen avatar davedevelopment avatar farmdawgnation avatar fgrehm avatar ganguera avatar gordonknoppe avatar idleberg avatar ilkka avatar jscheel avatar juliend avatar justafish avatar kallin avatar lephuongbg avatar mickaelperrin avatar miguelpuyol avatar miquella avatar mziwisky avatar nbr avatar nicolasleger avatar nicwolff avatar nlarche avatar pianomansam avatar rosskevin avatar ryansch avatar timcurzon avatar timweprovide avatar trakos avatar uberjay avatar yenif 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  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

dinghy's Issues

store images/containers on the host?

Upsides:

  • You don't have to re-download base images if you destroy and re-create the VM
  • You aren't limited by the VM's disk size

Downsides:

  • Destroying the VM is no longer enough to clean up everything -- images will still take up space on the host
  • There's likely a performance penalty

So how does this relate to vagrant_vagrantfile

Ok - I think I am being incredibly stupid.

I have two Vagrantfiles - one for my Docker containers, and a parent VM with the dinghy vagrant box.

Is this all I need for "it" to work? What is "it" - is it just the DNS and Proxy and custom NFS? Is "it" the "dinghy up" command that I use in place of "vagrant up"?

Here are my two files:

The 'parent' Vagrantfile

Vagrant.require_version ">= 1.6.0"

Vagrant.configure("2") do |config|
  # Assign a friendly name to this host VM
  # config.vm.hostname = "docker-host"

  # Skip checking for an updated Vagrant box
  config.vm.box_check_update = false

  # Always use Vagrant's default insecure key
  config.ssh.insert_key = false

  # Spin up a "host box" for use with the Docker provider
  config.vm.box = "codekitchen/boot2docker"

  config.vm.synced_folder "../johnnymetrics", "/vagrant", type: "nfs", disabled: false
  config.vm.synced_folder "../data", "/data", type: "nfs", disabled: false

  config.vm.network "private_network", ip: "192.168.42.69"
end

And the one for my containers:

Vagrant.require_version ">= 1.6.0"
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'

Vagrant.configure("2") do |config|

  config.vm.synced_folder ".", "/vagrant", disabled: true

  # Perform one-time configuration of Docker provider to specify
  # location of Vagrantfile for host VM
  config.vm.provider "docker" do |docker|
    docker.vagrant_vagrantfile = "../vm/Vagrantfile"
  end

  config.vm.define "mongo-machine" do |machine|
    machine.vm.provider "docker" do |d|
      d.image = "mongo:3"
      d.ports = ['27017:27017']    # host:container
      # d.volumes = ["/data/mongodb:/data"]
      d.name = 'mongo'
    end
  end

  config.ssh.insert_key = false
end

remember if --proxy has been passed before

Once they've paid the cost to download the container the first time, enabling the http proxy is super cheap. We should remember if they've done it once, and then imply --proxy on all dinghy up calls after that.

client/server version mismatches are common

Since dinghy relies on homebrew to install the docker client on the host, and since homebrew doesn't allow you to specify what version of a dependency is required, it's common for the docker client to be incompatible with the server version running in the VM.

First step is for dinghy to detect this and show some useful information, but we might have to go outside of homebrew to install the docker client to fully fix it. Or maybe it's sufficient for dinghy to tell the user to run brew switch.

Issue installing with Homebrew

I start by running the following command:

brew install https://github.com/codekitchen/dinghy/raw/latest/dinghy.rb

It install a few dependencies with no issue, but then I get this error:

==> Cloning https://github.com/codekitchen/dinghy.git
Error: Failed to download resource "dinghy"
Failure while executing: git clone --depth 1 --branch v3.0.4 https://github.com/codekitchen/dinghy.git /Library/Caches/Homebrew/dinghy--git

Which is weird because I can run that command myself and it seems to clone it. Whats going on here?

I'm running OSx 10.9 with homebrew 0.9.5. Not sure if it is relevant but I run RVM, and ran it with 1.8 and 2.2 of ruby (though I think homebrew uses the default ruby that the mac came packaged with?)

docker 1.7

the boot2docker image is missing...can you create and upload this image?

Upgrading docker and docker-compose

Hey there - I got docker (and docker-compose) via your brew install for dinghy. Both docker and docker-compose have recently seen new releases ... What is the recommended way for me to upgrade these to the higher versions?

https proxy support

https://github.com/jwilder/nginx-proxy already has HTTPS support, it's just not seamless enough for a development environment. I'd like to make it unnecessary to manually generate a self-signed cert for each app. Maybe just a default cert for all apps, the domain mismatch isn't a huge deal if the cert will have to be manually accepted anyway.

Virtualbox 5 Support

I install Virtualbox version 5 via Caskroom to use as my dinghy vagrant provider, but when I do dinghy up, I see the following error:

❯ dinghy up -p virtualbox
The provider 'virtualbox' that was requested to back the machine
'dinghy' is reporting that it isn't usable on this system. The
reason is shown below:

Vagrant has detected that you have a version of VirtualBox installed
that is not supported. Please install one of the supported versions
listed below to use Vagrant:

4.0, 4.1, 4.2, 4.3
/usr/local/Cellar/dinghy/3.0.3/cli/dinghy/vagrant.rb:21:in `up': There was an error bringing up the Vagrant box. Dinghy cannot continue. (RuntimeError)
    from /usr/local/Cellar/dinghy/3.0.3/cli/cli.rb:33:in `up'
    from /usr/local/Cellar/dinghy/3.0.3/cli/thor/lib/thor/command.rb:27:in `run'
    from /usr/local/Cellar/dinghy/3.0.3/cli/thor/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/Cellar/dinghy/3.0.3/cli/thor/lib/thor.rb:359:in `dispatch'
    from /usr/local/Cellar/dinghy/3.0.3/cli/thor/lib/thor/base.rb:440:in `start'
    from /usr/local/bin/dinghy:5:in `<main>'

Installation on El Capitan failing

$ brew install https://github.com/codekitchen/dinghy/raw/latest/dinghy.rb                                                                                               9:34:53  ☁  docker ☂ 𝝙 ⚡ 𝝙
######################################################################## 100.0%
Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
==> Installing dependencies for dinghy: docker, unfs3, dnsmasq
==> Installing dinghy dependency: docker
==> Cloning https://github.com/docker/docker.git
Updating /Library/Caches/Homebrew/docker--git
==> Checking out tag v1.7.1
==> hack/make.sh dynbinary

---> Making bundle: dynbinary (in bundles/1.7.1/dynbinary)
Building: bundles/1.7.1/dynbinary/docker-1.7.1
# runtime/cgo
clang: error: no such sysroot directory: ''

READ THIS: https://git.io/brew-troubleshooting

These open issues may also help:
Fig / docker-compose fails with recent version https://github.com/Homebrew/homebrew/issues/41766
Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.

npm throws Operation not permitted

Using dinghy, when I try to npm install something, it complains:

npm ERR! Error: EPERM, chown '/shared/node_modules/gulp/package.json'
npm ERR!  { [Error: EPERM, chown '/shared/node_modules/gulp/package.json']
npm ERR!   errno: 50,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/shared/node_modules/gulp/package.json',
npm ERR!   fstream_finish_call: 'chown',
npm ERR!   fstream_type: 'File',
npm ERR!   fstream_path: '/shared/node_modules/gulp/package.json',
npm ERR!   fstream_class: 'FileWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/lib/nodejs/fstream/lib/writer.js:305:19',
npm ERR!      '/usr/lib/nodejs/graceful-fs/polyfills.js:143:7',
npm ERR!      'Object.oncomplete (evalmachine.<anonymous>:107:15)' ] }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.18.11-tinycore64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "gulp"
npm ERR! cwd /shared
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /shared/node_modules/gulp/package.json
npm ERR! fstream_path /shared/node_modules/gulp/package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call chown
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, chown '/shared/node_modules/gulp/package.json'
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:305:19
npm ERR! fstream_stack /usr/lib/nodejs/graceful-fs/polyfills.js:143:7
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /shared/npm-debug.log
npm ERR! not ok code 0

It used to work well on boot2docker, even when using nfs.

Problems with unfs

This may very well be an issue with the unfs native lib and not dinghy per se, but having some issues with dinghy up.

Waiting for NFS daemon...
/usr/local/Cellar/dinghy/3.0.2/cli/dinghy/unfs.rb:18:in `sleep': execution expired (Timeout::Error)
    from /usr/local/Cellar/dinghy/3.0.2/cli/dinghy/unfs.rb:18:in `block in wait_for_unfs'
    from /usr/local/Cellar/dinghy/3.0.2/cli/dinghy/unfs.rb:15:in `wait_for_unfs'
    from /usr/local/Cellar/dinghy/3.0.2/cli/dinghy/unfs.rb:11:in `up'
    from /usr/local/Cellar/dinghy/3.0.2/cli/cli.rb:34:in `up'
    from /usr/local/Cellar/dinghy/3.0.2/cli/thor/lib/thor/command.rb:27:in `run'
    from /usr/local/Cellar/dinghy/3.0.2/cli/thor/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/Cellar/dinghy/3.0.2/cli/thor/lib/thor.rb:359:in `dispatch'
    from /usr/local/Cellar/dinghy/3.0.2/cli/thor/lib/thor/base.rb:440:in `start'
    from /usr/local/bin/dinghy:5:in `<main>’

Any ideas? Thanks!

EOF errors

╰─± dinghy up --no-proxy
Bringing machine 'dinghy' up with 'virtualbox' provider...
==> dinghy: Checking if box 'codekitchen/boot2docker' is up to date...
==> dinghy: Clearing any previously set forwarded ports...
==> dinghy: Fixed port collision for 2375 => 2375. Now on port 2200.
==> dinghy: Fixed port collision for 2376 => 2376. Now on port 2201.
==> dinghy: Fixed port collision for 22 => 2222. Now on port 2202.
==> dinghy: Clearing any previously set network interfaces...
==> dinghy: Preparing network interfaces based on configuration...
    dinghy: Adapter 1: nat
    dinghy: Adapter 2: hostonly
    dinghy: Adapter 3: hostonly
==> dinghy: Forwarding ports...
    dinghy: 2375 => 2200 (adapter 1)
    dinghy: 2376 => 2201 (adapter 1)
    dinghy: 22 => 2202 (adapter 1)
==> dinghy: Running 'pre-boot' VM customizations...
==> dinghy: Booting VM...
==> dinghy: Waiting for machine to boot. This may take a few minutes...
    dinghy: SSH address: 127.0.0.1:2202
    dinghy: SSH username: docker
    dinghy: SSH auth method: private key
    dinghy: Warning: Connection timeout. Retrying...
==> dinghy: Machine booted and ready!
==> dinghy: Checking for guest additions in VM...
==> dinghy: Checking for host entries
==> dinghy: Configuring and enabling network interfaces...
==> dinghy: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> dinghy: to force provisioning. Provisioners marked to run always will still run.
==> dinghy: Running provisioner: shell...
    dinghy: Running: inline script
==> dinghy: private interface is eth2
==> dinghy: route: SIOCDELRT: No such process
==> dinghy: nameserver 10.0.2.3
==> dinghy: Running provisioner: shell...
    dinghy: Running: inline script
==> dinghy: Running provisioner: shell...
    dinghy: Running: inline script
==> dinghy: Preparing /Users/noah NFS mount
Starting NFS daemon, this will require sudo
Waiting for NFS daemon...
Mounting NFS /Users/noah
Writing /Users/noah/.dinghy/certs/key.pem
Writing /Users/noah/.dinghy/certs/ca.pem
Writing /Users/noah/.dinghy/certs/cert.pem
Starting the DNS daemon
Your environment variables are already set correctly.

╰─± docker version
Client version: 1.3.2
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): 39fa2fa
OS/Arch (client): darwin/amd64
2015/05/31 11:31:47 Get https://127.0.0.1:2376/v1.15/version: EOF

╰─± docker-compose ps
SSL error: [Errno 8] _ssl.c:507: EOF occurred in violation of protocol

How to customize CPU and RAM?

Hi, first thank you this project is awesome.

It seems that the vagrant VM only uses 1 CPU. I wonder how I can customize the number of CPUs and the amount of RAM the vagrant can use? Ideally I would like to customize that once and have it applied every time I restart. Is it possible?

Thanks.

Sending build context to Docker daemon is slow

When I run a docker build the Sending build context to Docker daemon step is slow. It always loads a few MB then it stops for a few seconds before it starts loading the next few MBs.

OSX 10.10.3
Vagrant 1.7.2
VirtualBox 4.3.20
Docker version 1.5.0, build a8a31ef

failures seen on mavericks 10.9

unfs3 fails in some situations when performing a chmod on the NFS share, even when running as root. So far this has never been reproduced in Yosemite, only Mavericks. The error returned is stale NFS file handle.

NFS mount fails

Hi,

I installed dinghy on a fresh Yosemite. VM is running but mounting the NFS volume fails with a permission error:

Bringing machine 'dinghy' up with 'virtualbox' provider...
==> dinghy: Importing base box 'codekitchen/boot2docker'...
==> dinghy: Matching MAC address for NAT networking...
==> dinghy: Checking if box 'codekitchen/boot2docker' is up to date...
==> dinghy: Setting the name of the VM: vagrant_dinghy_1437550383953_7963
==> dinghy: Clearing any previously set network interfaces...
==> dinghy: Preparing network interfaces based on configuration...
    dinghy: Adapter 1: nat
    dinghy: Adapter 2: hostonly
    dinghy: Adapter 3: hostonly
==> dinghy: Forwarding ports...
    dinghy: 2375 => 2375 (adapter 1)
    dinghy: 2376 => 2376 (adapter 1)
    dinghy: 22 => 2222 (adapter 1)
==> dinghy: Running 'pre-boot' VM customizations...
==> dinghy: Booting VM...
==> dinghy: Waiting for machine to boot. This may take a few minutes...
    dinghy: SSH address: 127.0.0.1:2222
    dinghy: SSH username: docker
    dinghy: SSH auth method: private key
    dinghy: Warning: Connection timeout. Retrying...
    dinghy: Warning: Remote connection disconnect. Retrying...
==> dinghy: Machine booted and ready!
==> dinghy: Checking for guest additions in VM...
    dinghy: The guest additions on this VM do not match the installed version of
    dinghy: VirtualBox! In most cases this is fine, but in rare cases it can
    dinghy: prevent things such as shared folders from working properly. If you see
    dinghy: shared folder errors, please make sure the guest additions within the
    dinghy: virtual machine match the version of VirtualBox you have installed on
    dinghy: your host and reload your VM.
    dinghy: 
    dinghy: Guest Additions Version: 4.3.30 r101610
    dinghy: VirtualBox Version: 5.0
==> dinghy: Configuring and enabling network interfaces...
==> dinghy: Running provisioner: shell...
    dinghy: Running: inline script
==> dinghy: private interface is eth2
==> dinghy: route: SIOCDELRT: No such process
==> dinghy: nameserver 10.0.2.3
==> dinghy: Running provisioner: shell...
    dinghy: Running: inline script
==> dinghy: Running provisioner: shell...
    dinghy: Running: inline script
==> dinghy: Preparing /Users/testuser NFS mount
Starting NFS daemon, this will require sudo
Waiting for NFS daemon...
Mounting NFS /Users/testuser
mount: 192.168.42.1:/Users/testuser failed, reason given by server: Permission denied
mount: mounting 192.168.42.1:/Users/testuser on /Users/testuser failed: Bad file descriptor
/usr/local/Cellar/dinghy/3.0.2/cli/dinghy/vagrant.rb:40:in `ssh': Error executing command: sudo mount -t nfs 192.168.42.1:/Users/testuser /Users/testuser -o nfsvers=3,udp,mountport=19321,port=19321,nolock,hard,intr (RuntimeError)
    from /usr/local/Cellar/dinghy/3.0.2/cli/dinghy/vagrant.rb:59:in `mount'
    from /usr/local/Cellar/dinghy/3.0.2/cli/cli.rb:35:in `up'
    from /usr/local/Cellar/dinghy/3.0.2/cli/thor/lib/thor/command.rb:27:in `run'
    from /usr/local/Cellar/dinghy/3.0.2/cli/thor/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/Cellar/dinghy/3.0.2/cli/thor/lib/thor.rb:359:in `dispatch'
    from /usr/local/Cellar/dinghy/3.0.2/cli/thor/lib/thor/base.rb:440:in `start'
    from /usr/local/bin/dinghy:5:in `<main>

I tried to ssh into the VM an ran sudo mount -t ... manually, but this fails too.

Files owned by unknown user in container

Is there any way to map or mount a container volume's files to a user in the container (just locally--say "www-data")? Mounting my local project files to /var/www in my container and nginx can't write to it.

OS X 10.10.2 / Dinghy 2.2.2 / Docker 1.5.0 / Vagrant 1.7.2 / VirtualBox 4.3.26

VM seems slow to respond to shared filesystem changes

I've got some python apps running, using gunicorn with the --reload option. I had lots of other issues w/ boot2docker, but the apps always reloaded almost immediately after a change. I'm finding the dinghy VM responds very slowly. I'm also not seeing my Flask assets being rebuilt at the expected times w/ dinghy. I'm wondering if this is to be expected, or maybe there are some settings I can tweak?

Thanks.

Issue starting containers after so long

After dinghy VM is running for so long I end up getting this error when i go to restart / start a container:

zephyr:% fig run worker rails c
Cannot start container 923c78ef01a6d12515e903ec6f018985a8dd12835e0e753dbe018017952ad2d5: setup mount namespace stat /Users/context/src/[redact]: permission denied

dinghy up ; fig up ; do stuff, it works fine, restart containers, start new containers, works fine. After so long it stops working. I cannot pinpoint a specific time / event thats happening that causes this though. killing containers, restarting dinghy, bringing containers back up and everything works fine again.

Question about NFS shares

Hi guys,

Great work on this project! I've been fumbling around the past few days trying to get a faster network filesystem so that I can actually do local development.

So here's my question. I have dinghy installed and running. When I spin up a container, I was thinking that my home directory would be mounted in the container. However, I dont:

$ docker run -it redis bash
root@f8d07b419bc4:/data# cd /
root@f8d07b419bc4:/# ls -l
total 76
drwxr-xr-x   2 root  root  4096 Jul 13 17:41 bin
drwxr-xr-x   2 root  root  4096 Dec 24  2014 boot
drwxr-xr-x   2 redis redis 4096 Aug  6 13:49 data
drwxr-xr-x   5 root  root   380 Aug  6 13:49 dev
-rwxr-xr-x   1 root  root   109 Apr  1 17:26 entrypoint.sh
drwxr-xr-x  36 root  root  4096 Aug  6 13:49 etc
drwxr-xr-x   2 root  root  4096 Dec 24  2014 home
drwxr-xr-x   8 root  root  4096 Jul 18 00:18 lib
drwxr-xr-x   2 root  root  4096 Jul 13 17:42 lib64
drwxr-xr-x   2 root  root  4096 Jul 13 17:05 media
drwxr-xr-x   2 root  root  4096 Dec 24  2014 mnt
drwxr-xr-x   2 root  root  4096 Jul 13 17:05 opt
dr-xr-xr-x 129 root  root     0 Aug  6 13:49 proc
drwx------   4 root  root  4096 Jul 16 17:56 root
drwxr-xr-x   5 root  root  4096 Jul 14  2013 run
drwxr-xr-x   2 root  root  4096 Jul 13 17:42 sbin
drwxr-xr-x   2 root  root  4096 Jun 10  2012 selinux
drwxr-xr-x   2 root  root  4096 Jul 13 17:05 srv
dr-xr-xr-x  13 root  root     0 Aug  6 13:49 sys
drwxrwxrwt   2 root  root  4096 Jul 18 00:18 tmp
drwxr-xr-x  22 root  root  4096 Jul 18 00:18 usr
drwxr-xr-x  18 root  root  4096 Jul 18 00:17 var
root@f8d07b419bc4:/#

I noticed /Users is mounted on the host VM machine, so how do I let my containers gain access to /Users as well?

Thanks very much!

global port forwarding

In Kubernetes you can (beside http proxying) forward defined ports to specific container. would be great to have such thing too. maybe we can replace the nginx http proxy with haproxy (which can proxy everything)

would be really cool.

private network IP changes, breaking NFS

This might only be an issue under VMWare Fusion. I could fix it by configuring unfs to allow any IP in the private subnet, but I'd rather find out why the IP is changing. My theory is that udhcpc is periodically renewing in the background for each interface, and VMW is sending it a new IP. Maybe we should just kill udhcpc for this interface?

Vagrant tooling integration

Hey there - in your readme you say the following:

Dinghy is built on top of Vagrant, which makes Dinghy itself simpler and if you already use Vagrant, allows __integration with all of your current Vagrant tooling__.

Does this mean something other than that dinghy uses vagrant in the background to spin up a VM? If so - what other integrations are there? Still trying to fully get my head around it. This is a really great product!

Dinghy status fails if the NFS server isn't running

If you run dinghy status before dinghy up and the NFS server is not running, dinghy status stalls and prints a nasty error message:

ahigham-laptop :: ~/Projects/pandometer ‹docker_build*› % dinghy status                                                                                                                                                                127 ↵
  VM: not running
/usr/local/Cellar/dinghy/2.0.0/cli/dinghy/unfs.rb:25:in `initialize': Operation timed out - connect(2) (Errno::ETIMEDOUT)
    from /usr/local/Cellar/dinghy/2.0.0/cli/dinghy/unfs.rb:25:in `open'
    from /usr/local/Cellar/dinghy/2.0.0/cli/dinghy/unfs.rb:25:in `status'
    from /usr/local/Cellar/dinghy/2.0.0/cli/cli.rb:51:in `status'
    from /usr/local/Cellar/dinghy/2.0.0/cli/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/Cellar/dinghy/2.0.0/cli/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/Cellar/dinghy/2.0.0/cli/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/local/Cellar/dinghy/2.0.0/cli/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/bin/dinghy:5:in `<main>'

Perhaps a quicker timeout and/or rescueing from that?

The specified host network collides with a non-hostonly network!

Upon a fresh install of Vagrant and Dinghy, i'm receiving the following error when attempting to dinghy up for the first time:

The specified host network collides with a non-hostonly network!
This will cause your specified IP to be inaccessible. Please change
the IP or name of your host only network so that it no longer matches that of
a bridged or non-hostonly network.

My local IP range is 192.168.10.x, and i've confirmed than there are no host-only networks in that range on my machine (or in the 192.168.42.x range).

The full console output is as follows:

Bringing machine 'dinghy' up with 'virtualbox' provider...
==> dinghy: Checking if box 'codekitchen/boot2docker' is up to date...
==> dinghy: Clearing any previously set network interfaces...
The specified host network collides with a non-hostonly network!
This will cause your specified IP to be inaccessible. Please change
the IP or name of your host only network so that it no longer matches that of
a bridged or non-hostonly network.
/usr/local/Cellar/dinghy/3.0.4/cli/dinghy/vagrant.rb:21:in `up': There was an error bringing up the Vagrant box. Dinghy cannot continue. (RuntimeError)
    from /usr/local/Cellar/dinghy/3.0.4/cli/cli.rb:33:in `up'
    from /usr/local/Cellar/dinghy/3.0.4/cli/thor/lib/thor/command.rb:27:in `run'
    from /usr/local/Cellar/dinghy/3.0.4/cli/thor/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/Cellar/dinghy/3.0.4/cli/thor/lib/thor.rb:359:in `dispatch'
    from /usr/local/Cellar/dinghy/3.0.4/cli/thor/lib/thor/base.rb:440:in `start'
    from /usr/local/bin/dinghy:5:in `<main>'

Any help in diagnosing this issue would be much appreciated. Thanks!

Error: undefined method `head?' for nil:NilClass

I ran brew install https://github.com/codekitchen/dinghy/raw/latest/dinghy.rb and got this:

Error: undefined method `head?' for nil:NilClass
Please report this bug:
    https://git.io/brew-troubleshooting
/usr/local/Library/Homebrew/pkg_version.rb:16:in `initialize'
/usr/local/Library/Homebrew/formula.rb:305:in `new'
/usr/local/Library/Homebrew/formula.rb:305:in `installed_prefix'
/usr/local/Library/Homebrew/formula.rb:284:in `installed?'
/usr/local/Library/Homebrew/cmd/install.rb:72:in `block in install'
/usr/local/Library/Homebrew/cmd/install.rb:41:in `each'
/usr/local/Library/Homebrew/cmd/install.rb:41:in `install'
/usr/local/Library/brew.rb:127:in `<main>'

I'm on OS X El Capitan Beta (15A235d) and just installed Vagrant to use dinghy.

Server Error: too many redirects

I believe these two issues are related.

Upon restarting dinghy (after upgrade, etc), I get this error:

$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock --name dinghy_http_proxy codekitchen/dinghy-http-proxy
Unable to find image 'codekitchen/dinghy-http-proxy:latest' locally
Pulling repository codekitchen/dinghy-http-proxy
FATA[0001] Get https://index.docker.io/v1/repositories/codekitchen/dinghy-http-proxy/images: dial tcp: lookup index.docker.io on 10.0.2.3:53: too many redirects

And trying to execute a 'docker login':

$ docker login
Username: xxx
Password:
Email: xxx
FATA[0018] Error response from daemon: Server Error: Post https://index.docker.io/v1/users/: dial tcp: lookup index.docker.io on 10.0.2.3:53: too many redirects

Dinghy/Docker are both up and functional otherwise. Dinghy comes up with no errors after Mac reboot, however docker login always shows this same error.

Shared folders don't appear in VirtualBox

When I open VirtualBox 4.3.26 on Mac 10.9.5, I see "Shared folders: none" under vagrant_dingy_####.

image

╰─± dinghy up --proxy
Bringing machine 'dinghy' up with 'virtualbox' provider...
==> dinghy: Checking if box 'codekitchen/boot2docker' is up to date...
==> dinghy: Clearing any previously set forwarded ports...
==> dinghy: Clearing any previously set network interfaces...
==> dinghy: Preparing network interfaces based on configuration...
    dinghy: Adapter 1: nat
    dinghy: Adapter 2: hostonly
    dinghy: Adapter 3: hostonly
==> dinghy: Forwarding ports...
    dinghy: 2375 => 2375 (adapter 1)
    dinghy: 2376 => 2376 (adapter 1)
    dinghy: 22 => 2222 (adapter 1)
==> dinghy: Running 'pre-boot' VM customizations...
==> dinghy: Booting VM...
==> dinghy: Waiting for machine to boot. This may take a few minutes...
    dinghy: SSH address: 127.0.0.1:2222
    dinghy: SSH username: docker
    dinghy: SSH auth method: private key
    dinghy: Warning: Connection timeout. Retrying...
==> dinghy: Machine booted and ready!
==> dinghy: Checking for guest additions in VM...
==> dinghy: Checking for host entries
==> dinghy: Configuring and enabling network interfaces...
==> dinghy: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> dinghy: to force provisioning. Provisioners marked to run always will still run.
==> dinghy: Running provisioner: shell...
    dinghy: Running: inline script
==> dinghy: private interface is eth2
==> dinghy: route: SIOCDELRT: No such process
==> dinghy: nameserver 10.0.2.3
==> dinghy: Running provisioner: shell...
    dinghy: Running: inline script
==> dinghy: Running provisioner: shell...
    dinghy: Running: inline script
==> dinghy: Preparing /Users/noah NFS mount
Starting NFS daemon, this will require sudo
Waiting for NFS daemon...
Mounting NFS /Users/noah
Writing /Users/noah/.dinghy/certs/key.pem
Writing /Users/noah/.dinghy/certs/ca.pem
Writing /Users/noah/.dinghy/certs/cert.pem
Starting the DNS daemon
Starting the HTTP proxy
... pulling layers ...
Digest: sha256:14671eb2b6f024b8fbb92751aebaa871487710eab7947e910ab530bfac8f62e7
Status: Downloaded newer image for jwilder/nginx-proxy:latest
a61602b79f654815a4e48ae1d4738f3905afcec5464da6375f7ea04495e1f73a
Your environment variables are already set correctly.

For my relatively small Node project, grunt watch and nodemon are taking >10 seconds to notice changes. That's why I'm nervous the NFS syncing may not be working.

Here's my project for reference: https://github.com/league-wins-pool/league-wins-pool/tree/feature/47-dinghy

Not an issue just thumbs up

This project is too awesome, restored my faith in Docker and saved my Macbook from being killed by a varangian hammer.

I owe you beer!

list command

would be cool to be able to ask dinghy for all the apps its managing along with IPs and hostnames.

something like dinghy ls

NFS squash root access to local user

Currently unfs is set to not munge UIDs leading to the vm having real root access to the shared filesystem and any created files thus having root UID/GID (particularly annoying around npm install or bundle install into a subdirectory).

Looks like unfs supports root squashing with anonuid and anongid (http://linux.die.net/man/8/unfsd) which we could set to the executing user for this export. Personally I'd go as far to turn on all_squash to also avoid any other UID pollution from the vm, but that could potentially interfere with some future use case (create as non root with only uid read, next read would probably fail with a wrong uid).

Looks like this should be a pretty easy change, will try to throw something up this afternoon.

Error on Dinghy installation

I'm getting the following error when trying to install Dinghy:

brew install https://github.com/codekitchen/dinghy/raw/latest/dinghy.rb

######################################################################## 100.0%
==> Installing dependencies for dinghy: unfs3, dnsmasq
==> Installing dinghy dependency: unfs3
==> Downloading https://downloads.sourceforge.net/project/unfs3/unfs3/0.9.22/unfs3-0.9.22.tar.gz
==> Downloading from http://downloads.sourceforge.net/#!/project/unfs3/unfs3/0.9.22/unfs3-0.9.22.tar.gz
######################################################################## 100.0%
Error: SHA1 mismatch
Expected: a6c83e1210ce75836c672cd76e66577bfef7a17a
Actual: ea60df615387f47bdfdfe4da48f6567c4ec60f74
Archive: /Library/Caches/Homebrew/unfs3-0.9.22.tar.gz
To retry an incomplete download, remove the file above.

Figure out a way to side channel inotify events around nfs

Figure out a way to side channel inotify events around nfs so that js watchers (webpack dev server) work correctly without having to revert to polling.

Some ideas

If broadcasting the events over Vagrant's private network is acceptable, this pattern could work:
https://github.com/guard/listen#forwarding-file-events-over-tcp
https://github.com/efacilitation/watch-network

Or touching a file in the nfs mount on the client will trigger a local inotify event. We could listen for inotify events in the nfs export and then touch the equivalent file in the nfs mount by executing a command through Vagrant or piping through to a daemon or command running in the vm.

Add support for docker/machine.

The PR for docker/machine to support VMware Fusion network shares has just been accepted into master.

I am going to do some additional testing, but I believe this means the last issues preventing docker/machine from working with VMware.

Have you considered integration with docker/machine?

mount.nfs: an incorrect mount option was specified

Toms-MBP:webtools_config tom$ dinghy up
Bringing machine 'dinghy' up with 'virtualbox' provider...
==> dinghy: Checking if box 'codekitchen/boot2docker' is up to date...
==> dinghy: VirtualBox VM is already running.
Stopping NFS daemon, this will require sudo
Password:
Starting NFS daemon, this will require sudo
Waiting for NFS daemon...
Mounting NFS /Users/tom
mount.nfs: an incorrect mount option was specified
mount: mounting 192.168.42.1:/Users/tom on /Users/tom failed: Device or resource busy
/usr/local/Cellar/dinghy/3.0.0/cli/dinghy/vagrant.rb:40:in `ssh': Error executing command: sudo mount -t nfs 192.168.42.1:/Users/tom /Users/tom -o nfsvers=3,udp,mountport=19321,port=19321,nolock,hard,intr 

Unable to find image 'jwilder/nginx-proxy:latest'

Followed install instructions on OS X 10.10. When I run dinghy up for first time, I get this error:

Unable to find image 'jwilder/nginx-proxy:latest' locally
Pulling repository jwilder/nginx-proxy
time="2015-06-03T19:03:44Z" level=fatal msg="Get https://registry-1.docker.io/v1/repositories/jwilder/nginx-proxy/tags: dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: too many redirects"
/usr/local/Cellar/dinghy/3.0.0/cli/dinghy/vagrant.rb:40:in `ssh': Error executing command: docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock --name dinghy_http_proxy jwilder/nginx-proxy (RuntimeError)
    from /usr/local/Cellar/dinghy/3.0.0/cli/dinghy/http_proxy.rb:14:in `up'
    from /usr/local/Cellar/dinghy/3.0.0/cli/cli.rb:40:in `up'
    from /usr/local/Cellar/dinghy/3.0.0/cli/thor/lib/thor/command.rb:27:in `run'
    from /usr/local/Cellar/dinghy/3.0.0/cli/thor/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/Cellar/dinghy/3.0.0/cli/thor/lib/thor.rb:359:in `dispatch'
    from /usr/local/Cellar/dinghy/3.0.0/cli/thor/lib/thor/base.rb:440:in `start'
    from /usr/local/bin/dinghy:5:in `<main>'

Arbitrary port mapping.

It is really nice to be able to have VIRTUAL_PORT map to the http port.

What I would like is to be able to use this same functionality for any port. For example, a mysql docker box. I want to be able to expose the mysql port 3306 without specifying what port it should be mapped. This request would support that.

MAJOR issues on Yosemite

I am running into freezing issues on my macbook with Yosemite 10.10.1 and dinghy 3.0.1 which seem to have started since installing dinghy. I can login, but slowly things start to break down until everything freezes and I have to reboot.

Checked the Console logs and this is what I see leading up to the freezes:

com.apple.xpc.launchd: (dingy.unfs[459]) Service exited with abnormal code: 1
com.apple.xpc.launchd: (dingy.unfs) Service only ran for 0 seconds. Pushing respawn out by 10 seconds
com.apple.xpc.launchd: (dingy.unfs[460]) Service exited with abnormal code: 1
com.apple.xpc.launchd: (dingy.unfs) Service only ran for 0 seconds. Pushing respawn out by 10 seconds
com.apple.xpc.launchd: (dingy.unfs[461]) Service exited with abnormal code: 1
com.apple.xpc.launchd: (dingy.unfs) Service only ran for 0 seconds. Pushing respawn out by 10 seconds
com.apple.xpc.launchd: (dingy.unfs[462]) Service exited with abnormal code: 1
com.apple.xpc.launchd: (dingy.unfs) Service only ran for 0 seconds. Pushing respawn out by 10 seconds

I have logged in and quickly opened a terminal to run ps -ef | grep dinghy. I run it until xpcproxy dinghy.dnsmasq comes up, but by the time I try and kill -9 <process id> the freezing has already started and I can't.

I checked Activity Monitor and I don't see Vbox and nothing is showing as sucking up resources.

Any ideas? Can I stop dinghy from trying to start?

My laptop is completely unusable at the moment 😭

Client and server don't have same version

I keep getting the following error even though I just updated everything today (both brew and dinghy upgrade):

Error response from daemon: client and server don't have same version (client : 1.19, server: 1.18)

Is there something wrong with my setup? Should I wait for a new release of Dinghy?

"chown: operation not permitted" error mounting host volume for Postgres.

We have a Docker project that uses a Postgres container (postgres:9.3 image) with /var/lib/postgresql/data mounted to the local filesystem, and it works fine on Linux, but errors out on Mac with "chown: operation not permitted". boot2docker was running into permissions issues there as well, which is why we first tried dinghy, though boot2docker's errors were more confusing.

x509: certificate signed by unknown authority

Moved to latest version to try out fsevents_to_vm. Ran into this:

An error occurred trying to connect: Get https://127.0.0.1:2376/v1.19/containers/json: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "serial:264826990604929301496151133139566451714")

Someone mentioned it might be because of installation through Homebrew

boot2docker/boot2docker#803

Any ideas?

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.