Skip to content

Instantly share code, notes, and snippets.

@dustin
Created November 1, 2017 00:20
Show Gist options
  • Save dustin/ea787ad087ca31817fd592e001dbd5b2 to your computer and use it in GitHub Desktop.
Save dustin/ea787ad087ca31817fd592e001dbd5b2 to your computer and use it in GitHub Desktop.
Dockerfile for arm linux haskell build environment.
# FROM arm32v7/debian:stretch
FROM resin/rpi-raspbian:stretch
ENV QEMU_SET_ENV=QEMU_CPU=cortex-a9
RUN apt-get update
RUN apt-get install -y netbase curl llvm-3.7 # haskell-stack
RUN curl -sSL https://get.haskellstack.org/ | sh
COPY stack-entry /bin/stack-entry
VOLUME /root
ENTRYPOINT /bin/stack-entry
# ENTRYPOINT stack setup
#!/bin/sh -e
if [ ! -d /root/.stack ]
then
stack setup
fi
exec /bin/bash
@seanjhulse
Copy link

Hey, so, I would use a few things differently and maybe leverage docker-compose:

  1. docker-compose.yml
version: '3.1'

services:
  haskell:
    build: .
    volumes:
      - "/:/root"
    stdin_open: true
    tty: true
  1. Dockerfile
# FROM arm32v7/debian:stretch
FROM resin/rpi-raspbian:stretch

ENV QEMU_SET_ENV=QEMU_CPU=cortex-a9

RUN apt-get update
RUN apt-get install -y netbase curl llvm-3.7 # haskell-stack
RUN curl -sSL https://get.haskellstack.org/ | sh
RUN /usr/local/bin/stack setup
ENTRYPOINT [ "/bin/bash" ]
# ENTRYPOINT stack setup
  1. Command to run:

docker-compose up --build

That's all I needed to get the container up and running. I have the same Mac OSx as you but I have the newest stable version of docker. Make sure your docker-compose file is version '3.1' and not version '3' because I was having issues with mounting wth version '3'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment