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}

  • How to connect Docker Swarm to multiple consul servers for failover?
  • Restore SQL Server database to Linux Docker
  • docker daemon logs are missing
  • Reproducible Docker builds - long-term storage/restoring
  • Docker in Docker docker-compose daemon not running on host. Windows 10
  • Dockerizing a Node.js app on microsoft/nanoserver
  • 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

  • `docker run` output to bash variable - strange behaviour
  • Getting puppet error on docker ubuntu image
  • Why do I get Error: Could not find or load main class .jar when I run docker image
  • How to write commands with multiple lines in Dockerfile while preserving the new lines?
  • Run a complex series of commands in the same Docker container
  • passing parameters to app on docker image
  • One Solution collect form web for “Haskell Stack Image Container Execute On Docker run”

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

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

    Man sometimes you don’t see the forest.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.