commercialhaskell / commercialhaskell/stack

Docker build with stack fails with 137 on Mac M1 Chipset

Open
#5,880 3 comments 4 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

I have downloaded facebook/duckling. I run docker build. It failed with code: executor failed running [/bin/sh -c stack setup -j1]: exit code: 137

### Steps to reproduce

For example:

1. clone facebook/duckling
2. run docker build

### Expected

build succesfully

### Actual
executor failed running [/bin/sh -c stack setup -j1]: exit code: 137

### Dockerfile

`FROM --platform=linux/amd64 haskell:latest AS builder

RUN apt-get update -qq && \
apt-get install -qq -y libpcre3 libpcre3-dev build-essential pkg-config --fix-missing --no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN mkdir /log

WORKDIR /duckling

RUN chmod -R 777 /duckling

ADD . .

ENV LANG=C.UTF-8
RUN stack --version
RUN stack setup -j1

ADD . .

RUN stack install

FROM --platform=linux/amd64 alpine:latest
ENV LANG C.UTF-8
RUN apk add --no-cache libc6-compat
RUN apk update -qq && \
apk add -qq libpcre32 pcre pcre-dev pcre-tools && \
apk add --no-cache gmp-dev && \
apk add --virtual build-dependencies && \
apk add --no-cache build-base gcc && \
apk add g++ && \
apk add pcre-dev && \
ln -s /usr/lib/libpcre.so /usr/lib/libpcre.so.3 && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apk add gcompat
RUN apk add tzdata

COPY --from=builder /root/.local/bin/duckling-example-exe /usr/local/bin/

EXPOSE 8000

CMD ["duckling-example-exe", "-p", "8000"]

`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.