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

docker with git repos #1358

Closed
gregwebs opened this issue Nov 17, 2015 · 5 comments
Closed

docker with git repos #1358

gregwebs opened this issue Nov 17, 2015 · 5 comments

Comments

@gregwebs
Copy link
Contributor

I have only seen 1 issue after taking advantage of #531, usage with git repos

I get errors when I have a config like this with docker: in it also.

packages:
  - .
  - extra-dep: true
  - location:
      git: ...
      subdirs: ...

When I remove the docker: section everything installs.
It seems that I need to mount my ~/.ssh directory, but I cannot figure out how to get that to work.

@borsboom
Copy link
Contributor

To mount your ~/.ssh into the container's ~/.ssh, use something like this:

stack --docker-mount "$HOME/.ssh:$(stack-release exec -- sh -c 'echo $HOME')/.ssh"

Note that each project has its own $HOME, so unfortunately you can't put this in your ~/.stack/config.yaml.

Perhaps the nicest way to solve this would be to support optional SSH agent forwarding into the container, that way you wouldn't have to re-enter your private key's passphrase.

Note that in FP Complete's recommended Docker-based workflow, we eschew using git references and extra-deps in stack.yaml, and instead create a custom Docker image that contains all required dependencies.

@borsboom
Copy link
Contributor

This is now working in master, at least for common cases. ~/.ssh and the SSH auth socket are now mounted into the container. More complex path setups in ~/.ssh/config may not work, but there's not much we can do about that due to security restrictions SSH has in where it looks for files.

Ping @snoyberg.

@gregwebs
Copy link
Contributor Author

Awesome, thanks!

@bwbaugh
Copy link

bwbaugh commented Aug 3, 2016

Note that in FP Complete's recommended Docker-based workflow, we eschew using git references and extra-deps in stack.yaml, and instead create a custom Docker image that contains all required dependencies.

I was looking through the blog and wiki, but couldn't find a section that explicitly talked about avoiding git references. Is there somewhere online that goes into more detail about the recommended workflow? We've got a few internal libraries that I'd like to use. The easiest solution seemed to be to reference them via git since that doesn't require an internal hackage server. I'm not sure where custom Docker images would fit in.

@borsboom
Copy link
Contributor

borsboom commented Aug 4, 2016

Basically we generate custom Docker images that include the required packages in GHC's global package database. Our tooling around this isn't really in a publicly-releasable state yet, unfortunately.

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

3 participants