Open sbilgil opened 2 years ago
@sbilgil thanks for reporting. Can you help me understand what appears to be happening? The Docker file starts with a reference to Linux/AMD64 (Linux/x86_64) but you refer to Mac M1, which I understand is Apple silicon/ARM-based. Does that mean that Apple's Rosetta is being called upon to translate a x86_64 executable into something that runs on Apple silicon?
If you specify Stack's verbose output (stack --verbose setup -j1
) does that provide some insight as to when the problem arises?
Actually i am trying to build duckling on alpine linux distro. When i prepare my dockerfile on windows or intel mac it works fine. But when i use my M1 chip mac same dockerfile cant work. I googled it and they offer to add platform parameter to it. This image will work on linux machines.
And when i use verbose and tried to create image. i got these logs:
same problem with haskell:9.0.2-slim
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:
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"]
`