Skip to content

Instantly share code, notes, and snippets.

@bigsleep
bigsleep / Dockerfile
Created February 3, 2018 16:16
for ImagePacker
FROM haskell:8.2.2 AS fetch-source
ADD https://api.github.com/repos/bigsleep/ImagePacker/branches/master /repository-hash
RUN git clone --depth 1 -b master https://github.com/bigsleep/ImagePacker /source
FROM haskell:8.2.2 AS build
RUN printf "\npackage-indices:\n- name: Stackage\n download-prefix: https://www.stackage.org/lts-10.4/package/\n http: https://www.stackage.org/lts-10.4/00-index.tar.gz\n- name: HackageOrig\n download-prefix: https://hackage.haskell.org/package/\n http: https://hackage.haskell.org/00-index.tar.gz" >> ~/.stack/config.yaml
RUN stack update
RUN mkdir /work
COPY --from=fetch-source /source/ImagePacker.cabal /work/
COPY --from=fetch-source /source/stack.yaml /work/
@bigsleep
bigsleep / Dockerfile
Last active February 2, 2018 17:16
pandoc
FROM haskell:8.2.2
RUN stack --system-ghc --resolver lts-10.4 --local-bin-path /sbin install pandoc pandoc-citeproc --ghc-options '-fPIC' --flag pandoc:static --flag pandoc:embed_data_files
FROM alpine:latest
COPY --from=0 /sbin/pandoc /sbin/
COPY --from=0 /sbin/pandoc-citeproc /sbin/
ENTRYPOINT ["pandoc"]
@bigsleep
bigsleep / Dockerfile
Created February 2, 2018 17:08
haskell:8.2.2
## created from https://github.com/freebroccolo/docker-haskell
## Dockerfile for a haskell environment
FROM debian:stretch
## ensure locale is set during build
ENV LANG C.UTF-8
RUN apt-get update && apt-get install -y --no-install-recommends gnupg dirmngr && \
echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main' > /etc/apt/sources.list.d/ghc.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286 && \
import Codec.Picture
import Codec.Picture.Types
import Control.Monad.Primitive (PrimState)
main :: IO ()
main = mapM_ (writeOneRectImage imageSize) [0..99]
where
imageSize = (100, 100)
#!/bin/bash
INDEX_PATH=index
PACKAGE_PATH=package
rm 00-index.tar.gz 2>/dev/null
rm -r $INDEX_PATH 2>/dev/null
mkdir $INDEX_PATH