Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running stack build with docker enabled: exec: "/opt/host/bin/stack": permission denied #1750

Closed
ehamberg opened this issue Feb 5, 2016 · 1 comment

Comments

@ehamberg
Copy link

ehamberg commented Feb 5, 2016

I have set up docker on a Linux VM and set DOCKER_HOST to point to this machine on my local OS X machine. I am able to build and run containers.

However, when I try to build a stack project with Docker enabled, I get the following error:

exec: "/opt/host/bin/stack": permission denied
Error response from daemon: Cannot start container e8e26000eacbf13ae7a34189d46d283125eb1f923a64297b0c4794ec1298165c: [8] System error: exec: "/opt/host/bin/stack": permission denied

This looks like a stack bug to me, but I'm still quite new to Docker, so I might be doing something completely wrong. :-)

Here's a full session:

$ cat stack.yaml
resolver: lts-5.0

packages:
- '.'
- location:
    git: [email protected]:haskell-servant/servant
    commit: 2ae504143a97578d62acd9bfb3d87b873c5658a7
  subdirs:
    - servant
    - servant-client
    - servant-server

docker:
  enable: true
$ docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.5.3
 Git commit:   a34a1d5
 Built:        Sun Jan 17 16:14:45 UTC 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:12:04 UTC 2015
 OS/Arch:      linux/amd64
$ stack docker pull
Pulling image from registry: 'fpco/stack-build:lts-5.0'
lts-5.0: Pulling from fpco/stack-build

Digest: sha256:a236e009cdbeac8f8d6ca11522aef28435e6218fdf6f7540c50ed0f1d26e41cd
Status: Image is up to date for fpco/stack-build:lts-5.0
$ stack build
exec: "/opt/host/bin/stack": permission denied
Error response from daemon: Cannot start container e8e26000eacbf13ae7a34189d46d283125eb1f923a64297b0c4794ec1298165c: [8] System error: exec: "/opt/host/bin/stack": permission denied
@borsboom
Copy link
Contributor

borsboom commented Feb 7, 2016

Using Stack with Docker on a remote machine is not well supported, but it is possible if things are set up just right. The most important requirement is that your home directory and any directories containing your projects must be mounted in the VM. Unfortunately VMware and Virtualbox's native ways to do this are very slow for working with Haskell (really high overhead for every file access), so using something like NFS is highly recommended. Two places to look for hints: the Vagrantfile I use and the issue where this is being discussed: #194.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants