Skip to content

Latest commit

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

haskell-builder

A docker container for compiling statically linked binaries written in Haskell.

This project is inspired by golang-builder for Go, but provides the same result for Haskell binaries.

Overview

An example dockerfile:

FROM scratch
COPY ["build/hello/hello", "/usr/bin/"]
ENTRYPOINT ["/usr/bin/hello"]

Requirements

A project must include the following files:

├── Dockerfile
├── example.cabal
├── stack.yaml
└── ...

A Dockerfile is optional, when present a container will be created.

Usage

# Pull the docker container
docker pull dkubb/haskell-builder
# OR build it with:# docker build --tag dkubb/haskell-builder builder# Change to the directory containing the projectcd example
# Build an example container
docker run \
-v "$(pwd):/src" \
-v /var/run/docker.sock:/var/run/docker.sock \
--rm \
dkubb/haskell-builder \
hello
# Run the binary inside the docker container
docker run -it --rm hello:latest

Thanks

Thanks to Mitch Tishmack (mitchy) for his Alpine Linux GHC port which provides the base docker image for this project.

About

A docker container for compiling statically linked binaries written in Haskell

Resources

Stars

26 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages