Skip to content

Stack fails to run in AMD64 docker container on M1 Mac #5734

Open
@ChrisPenner

Description

@ChrisPenner

Hey everyone! Thanks for taking the time 👋🏼

General summary/comments

I need to build some x86 debian-compatible haskell executables, so my hope was to run stack inside a docker container to build them.

I'm aware that stack doesn't run on ARM64 yet, so I'm running my docker containers with the --platform=linux/amd64 flag to force docker to run things in x86 via Rosetta.

When I try to do anything with stack, it exits after a half-second pause, the only output is Killed.

Steps to reproduce

Run the following on an M1 mac with docker and Rosetta installed:

$ docker run --platform=linux/amd64 -it --rm --entrypoint bash haskell
# Then, inside the container:
$ stack --help

Expected

I expect stack to output its help message.

Actual

Stack just exits and I see "Killed"

$ docker run --platform=linux/amd64 -it --rm --entrypoint bash haskell
root@9150ee3e5e45:/# stack
Killed

Other commands run just fine, it seems to be an issue with stack.

Stack version

It'll be whichever stack is installed in the haskell:latest docker image, but obviously since I can't run stack I can't check 🙃

Anyone have thoughts on how to debug this or on how to get stack running in docker on an M1 mac?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions