-
Notifications
You must be signed in to change notification settings - Fork 843
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 support should work using non-FP-generated images (not require entrypoint.sh) #531
Comments
I think at this point the oldImage logic can be removed. That said, stack's docker integration isn't going to work well with an image that doesn't have a correct entrypoint that handles the user and directory mapping. If you need a custom image, I recommend deriving it from the |
Where are the Dockerfile's for the fpco images? I cannot find any of them. |
The fpco images aren't built using Dockerfiles, and the current build tool contains some proprietary information and so we can't open source it yet. In the images, the entrypoint is at
|
Unfortunately I cannot use the fpco images then. Perhaps your can make your build tool capable of generating a Dockerfile A better way to get the file out (from my point of view at least) is
Thanks for that, I will give it a shot |
I've been looking at this a bit more, and I think it is likely possible to make stack work without the special entrypoint in a slightly degraded form. It would lose the user ID mapping (meaning files it writes would be owned by root) and using the package index and build plan from the image (meaning stack would have to download those). |
My general workflow is to create a single user for the container and mount things into their home directory. Since I am the first user on my own computer, the uids match up (I know it is hacky, but it always works for my development flow). For stack, I just need to mount ~/.stack and the project directory. I think the entrypoint script could be broken up into 2 separate things:
I am definitely willing to help make this happen. Let me know. |
I was able to get things working with my own image by taking the output of I think there is really no reason why stack should not be able to work with the official haskell image. |
Copied from my own duplicate issue (#936): Since Docker support was originally implemented in an internal build tool, much has changed in stack. Those changes mean the structure of the Docker image is much less important than it used to be, and there's no deep reason for the Docker image to need a special structure anymore. Changes required, as far as I know:
We will continue to distribute images, but just about any image should work, including the Official Haskell images. Even images that don't contain GHC should work (stack will just fall back on its usual non-Docker behaviour of installing its own GHC in |
@borsboom I have been trying using
I am basically trying to use an image alike from haskell-stack. |
Images built by that haskell-stack Dockerfile are not currently supported by But aside from that, stack shouldn't need libpcre. Did you build your stack binary yourself? And, if so, how? There was a brief period when the master version of stack did require it due to the |
cassava contravariant fclabels iproute stack test-framework-hunit yaml Added dependencies ignore pcre-heavy base-compat pcre-light string-conversions Signed-off-by: Magnus Therning <magnus@therning.org>
@borsboom Thanks for your comment. My bad, I thought this issue was closed ... Is there a fpco image based on debian jessie ? I cannot use an image based on ubuntu:14:04 (I am trying to build |
@PierreR that image is designed to be run with /bin/bash and a directory mounted to run stack.
where haskell-user is from here |
@PierreR There is not, since our images are based on phusion/baseimage which is based on ubuntu:14.04. We currently use phusion's init daemon. Resolving this issue will remove the dependency. In the meantime, you might be able to add a layer to our images that installs a different Ruby version. |
@borsboom I will probably wait for this issue to be solved then (there is no urgency on my side, right now I am just building everything on the host and use a docker image that uses the same distro for publishing the exec). I guess supporting the official haskell docker image makes perfect sense and it will come in time; I just need to be a bit patient. Thanks for your support. It is really appreciated. @gregwebs Thanks for the suggestion. I might go this route if I really need to but I will probably just wait for the resolution of this issue ;-) |
I would like to remove the haskell-stack Dockerfile from the repo. Any objections? |
No objections, it's been a source of confusion. |
Note: any change we make to resolve this issue needs be compatible with resolving #194. That's a bit tricky, because it means we can't count stack itself containing all the startup logic. But we could embed some shell script in stack that performs any required bootstrapping, which it would ship into the container and run, before passing control to the in-container stack executable. |
What's the status on this issue? I noticed in #531 (comment) that you mention stack requiring two things: internalizing the entrypoint logic, and acting as a proper init daemon. Any estimate on how difficult / how long it would take to add either of those? As things stand, since the |
This is now implemented in master, and Stack's Docker integration should work with any image that includes the basics for running GHC. For example, I've tested with the official Haskell image and things seem to work fine. |
Fantastic! I will try this out soon. |
Tried it out. Seems to be working remarkably well now :) |
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
For the context to this pull request, see see [Hpack issue #530](sol/hpack#530), the [Hpack PR #531](sol/hpack#531) and the alternative [Hpack PR #535](sol/hpack#535) (on which this PR builds). See also [Pantry PR #74](commercialhaskell/pantry#74) (on which this PR builds).
It looks like it is impossible to use a custom docker image right now.
From looking at the source code, using my own image must be getting identified as an
oldImage
, so it then gets a--entrypoint
argument.The text was updated successfully, but these errors were encountered: