Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Instructions for alpine / dockerfile #22

Closed
chrissound opened this issue Feb 22, 2017 · 10 comments
Closed

Instructions for alpine / dockerfile #22

chrissound opened this issue Feb 22, 2017 · 10 comments

Comments

@chrissound
Copy link

I'm trying to use the new alpine package using docker with a Dockerfile as:

FROM alpine:edge
RUN apk add --no-cache ghc
CMD ["sh"]

The result is:

Sending build context to Docker daemon 2.048 kB
Step 1/3 : FROM alpine:edge
 ---> 9655ad68a6c9
Step 2/3 : RUN apk add --no-cache ghc
 ---> Running in 2fdff1fee961
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  ghc (missing):
    required by: world[ghc]
The command '/bin/sh -c apk add --no-cache ghc' returned a non-zero code: 1

Can anyone point me in the right direction to use this?

@mkoloberdin
Copy link

You need to add the "testing" repo to your /etc/apk/repositories

@mitchty
Copy link
Owner

mitchty commented Feb 22, 2017

Yep, that or do this:

# apk --no-cache add --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing ghc

Note, cabal isn't yet in the testing/edge repo. alpinelinux/aports#915

@chrissound
Copy link
Author

Thank you!

@chrissound
Copy link
Author

@mitchty Is there possibly an older / alternative version that has cabal on it?

@mitchty
Copy link
Owner

mitchty commented Feb 25, 2017

Yep, you can just use the old ports version like in the example docker file. Or if you don't want to add that as a repo you can just copy my signing key and then apk add as above with no-cache and get cabal or stack.

That is just copy the mitch.tishmack@gmail.com-55881c97.rsa.pub key in the examples directory to say /etc/apk/keys/mitch.tishmack@gmail.com-55881c97.rsa.pub

Then apk --no-cache add --repository https://s4-us-west-2.amazonaws.com/alpine-ghc/8.0 cabal

Should do it until cabal is upstreamed. Note stack is in there as well if you want it.

@chrissound
Copy link
Author

I'm getting an error of Unable to find installation URLs for OS key: linux64-ncurses6-nopie for stack build. I think it might be similar to the following issue: commercialhaskell/stack#257 (Arch linux though).

@chrissound chrissound reopened this Feb 26, 2017
@mitchty
Copy link
Owner

mitchty commented Feb 26, 2017

Not sure exactly what you're doing but note all the apk's have very minimal depends lines. They have enough to run the commands on their own, but not necessarily enough to be fully functional. At a glance I'd presume you need to add ncurses-dev or the ncurses apks.

That or add all of alpine-sdk. The packages are meant to be minimal so that you can customize the size of your installs. Notably that means if you need to use ncurses headers etc..., its on yourself to add those to your build containers. Those who don't need ncurses for their development would remain unaffected.

@chrissound
Copy link
Author

Many thanks @mitchty ! Really appreciate all your help.

I'm guessing I'll have to liaise with the alpine community / forums to know which packages I need to install to fulfill the necessary dependencies (if they occur in future)?

@mitchty
Copy link
Owner

mitchty commented Mar 1, 2017

Mostly, all you really need to do is look at the build logs and look for whatever header files don't get found and find out what apk provides them.

http://pkgs.alpinelinux.org/packages

Is about the best way to find files at the moment.

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

No branches or pull requests

3 participants