Björn Grambow
Björn Grambow

Reputation: 368

Haskell Stack Image Container Execute On Docker run

I am following the turorials from stackage and docker to run a haskell build via docker.

Building and Image creation works well and i can run the app via docker run -p 5000:5000 {imagename} {app-exe}

I am using the build in features of the latest stack to create the docke image with this minimal configuration.

image:
    container:
       base: "fpco/ubuntu-with-libgmp"

How can i make the image to launch the executable automatically, so that i can just type docker run -p 5000:5000 {imagename}. I know how to do it in a dockerfile but not with stack. I was thinking that I have to use:

entrypoints:
      - appname-exe

No success, no matter if I just use the name of executable or the absolute path to it. Maybe I don't understand what the entrypoint is for.

I am using Docker for Mac.

Any suggestions appreciated.

Cheers Bjorn

Upvotes: 1

Views: 208

Answers (1)

Björn Grambow
Björn Grambow

Reputation: 368

I figured it out myself. Everything is working correctly, I just didn't understand that stack creates two separate images. One just for the environment and one for the entrypoint.

So I checked docker images and found indeed two images. I was simply running the wrong image. This is correct docker run -p 5000:5000 {imagename-app-exe}

Man sometimes you don't see the forest.

Upvotes: 3

Related Questions