building on OS X

1,055 views
Skip to first unread message

Glyn Normington

unread,
Jun 4, 2014, 7:02:17 AM6/4/14
to docke...@googlegroups.com

I'm trying to set up a dev environment on OS X, following the instructions. boot2docker seems to have worked and so does `docker run -i -t ubuntu /bin/bash`.

But `sudo make build` fails with "Post http:///var/run/docker.sock/build?rm=1&t=docker%3Amaster: dial unix /var/run/docker.sock: no such file or directory".

I've tried with $DOCKER_HOST set to tcp://127.0.0.1:4243 and also with it set to tcp://localhost:4243 in case there is some subtle difference, but I get the same failure either way.

Am I supposed to be running the build inside the VM or what?

Jon Seymour

unread,
Jun 8, 2014, 10:38:27 AM6/8/14
to docke...@googlegroups.com
Glyn,

Is there a reason why you are trying to run it with 'sudo'? I just run the make directly. This will then fire up a docker container to run the actual build, so there is no really good reason to run it as OSX root.

I have been using this bash script to launch the build because the build results don't end up in the OSX bundles directory because of the well-known issues regarding volume sharing with the OSX client. I have also had problems with the integration tests failing, I think because the boot2docker vm runs out of disk space, but I haven't got to the bottom of that yet.

#!/bin/sh

make 'BINDIR=bundles' 'DOCKER_MOUNT=-v /home/docker/bundles:/go/src/github.com/dotcloud/docker/bundles' cross

DARWIN_AMD64=bundles/$(cat VERSION)/cross/darwin/amd64

mkdir -p $DARWIN_AMD64 

scp -r -P 2022 docker@localhost:~/$DARWIN_AMD64 $(dirname "$DARWIN_AMD64")

jon.

Glyn Normington

unread,
Jun 9, 2014, 4:16:37 AM6/9/14
to docke...@googlegroups.com
Hi Jon


On Sunday, June 8, 2014 3:38:27 PM UTC+1, Jon Seymour wrote:
Glyn,

Is there a reason why you are trying to run it with 'sudo'? I just run the make directly. This will then fire up a docker container to run the actual build, so there is no really good reason to run it as OSX root.

Merely that the instructions told me to use sudo: http://docs.docker.com/contributing/devenvironment/.
 

I have been using this bash script to launch the build because the build results don't end up in the OSX bundles directory because of the well-known issues regarding volume sharing with the OSX client. I have also had problems with the integration tests failing, I think because the boot2docker vm runs out of disk space, but I haven't got to the bottom of that yet.

Thanks. Doesn't fill me full of confidence about building on OS X. I wonder if anyone else has had a better experience?

Regards,
Glyn

Solomon Hykes

unread,
Jun 9, 2014, 5:37:38 AM6/9/14
to Glyn Normington, docker-dev
I use boot2docker + the Darwin client as my primary dev environment (including to develop on Docker itself). I did a vanilla install (following the official OSX install instructions) on a Macbook air and a Mac pro. Both times it worked great.

A few notes:

- You can run "make shell" to get an interactive shell in a full build environment. Then you can run "go test" or "./hack/make.sh" from there, avoiding the volume sharing issue altogether.

- An even more extreme (and awesome) variation is to develop directly in a container. This is what I do and it works great. I keep 1 container per ongoing task or project, and just "docker attach" for context switching. You can check out my setup at https://hub.docker.com/u/shykes/devbox


--
You received this message because you are subscribed to the Google Groups "docker-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docker-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Glyn Normington

unread,
Jun 9, 2014, 6:06:32 AM6/9/14
to docke...@googlegroups.com, gnorm...@gopivotal.com
Thanks Solomon!

Following Jon's suggestion, `make build` ran cleanly. I'll submit a pull request to remove sudo from the instructions.

`make test` ran out of space during one of the integration tests. I'll see if I can increase the disk size of the boot2docker VM. Assuming that `make test` works for you, it's odd that Jon and I see a different behaviour - maybe the VM disk size or the test behaviour is somehow dependent on the environment.

Glyn Normington

unread,
Jun 9, 2014, 8:26:45 AM6/9/14
to docke...@googlegroups.com, gnorm...@gopivotal.com


On Monday, June 9, 2014 11:06:32 AM UTC+1, Glyn Normington wrote:
`make test` ran out of space during one of the integration tests. I'll see if I can increase the disk size of the boot2docker VM. Assuming that `make test` works for you, it's odd that Jon and I see a different behaviour - maybe the VM disk size or the test behaviour is somehow dependent on the environment.

There seems to be plenty of disk space free and doubling the size of the temporary partition didn't solve the problem. Here's the error for reference:

--- FAIL: TestBuild (15.75 seconds)
buildfile_test.go:363: Error VFS copying directory: exit status 1 (cp: error writing '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/bin/busybox': No space left on device
cp: failed to extend '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/bin/busybox': No space left on device
cp: error writing '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/bin/init': No space left on device
cp: failed to extend '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/bin/init': No space left on device
cp: error writing '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/bin/socat': No space left on device
cp: failed to extend '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/bin/socat': No space left on device
cp: error writing '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/etc/nsswitch.conf': No space left on device
cp: failed to extend '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/etc/nsswitch.conf': No space left on device
cp: error writing '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/etc/group': No space left on device
cp: failed to extend '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/etc/group': No space left on device
cp: error writing '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/etc/passwd': No space left on device
cp: failed to extend '/tmp/docker-testf285-newTestEngine-466699094/vfs/dir/76dff02550498b17409067f0597092f3b21ee43049d29080999c5864abfeacd1-init/etc/passwd': No space left on device
) 
 
So it seems the problem is in the container's file system rather than the host's. 

Glyn Normington

unread,
Jun 10, 2014, 4:57:56 AM6/10/14
to docke...@googlegroups.com, gnorm...@gopivotal.com
PR for not using sudo to build on Mac OS X: https://github.com/dotcloud/docker/pull/6304

Regarding the failure below, it doesn't reproduce on Ubuntu, so it seems to be an issue with the boot2docker environment. I'm not going to investigate further for the moment as I have much more basic topics to understand first. I'll raise a bug to put this on the books.

(Note that building on Ubuntu failed intermittently, but passed the last couple of times I tried (around the v1.0.0 tag) - not sure if others are seeing intermittent failures or not. If the failure comes back, I'll report it.)

Glyn Normington

unread,
Jun 10, 2014, 5:05:36 AM6/10/14
to docke...@googlegroups.com, gnorm...@gopivotal.com

Jon Seymour

unread,
Jun 12, 2014, 1:56:40 AM6/12/14
to docke...@googlegroups.com, gnorm...@gopivotal.com
Glyn,

I wonder if increasing the memory, as distinct from the disk, allocated to the boot2docker VM might fix this issue?

jon.

On Tuesday, 10 June 2014 19:05:36 UTC+10, Glyn Normington wrote:
Bug raised: https://github.com/dotcloud/docker/issues/6331

Glyn Normington

unread,
Jun 12, 2014, 7:05:05 AM6/12/14
to docke...@googlegroups.com, gnorm...@gopivotal.com
Yes, thanks Jon. That solved the problem.

alain hsiung

unread,
Jul 13, 2014, 8:53:33 AM7/13/14
to docke...@googlegroups.com
I have a similar issue running 
docker build -t mywildfly .
It get Error checking context is accessible: 'no permission to read from '.viminfo''. Please check permissions and try again.
So I tried
sudo docker build -t mywildfly .
But then I get Post http:///var/run/docker.sock/build?rm=1&t=mywildfly: dial unix /var/run/docker.sock: no such file or directory
So I raised boot2docker memory to 2GB with
boot2docker delete
boot2docker init -m 2048
boot2docker up
And then again with "sudo docker build -t mywildfly ." I get the "Post... no such file or directory" error.
Reply all
Reply to author
Forward
0 new messages