Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strapi docker images crashing on Apple Silicon (M1) #307

Open
samrit opened this issue Jul 3, 2021 · 9 comments
Open

Strapi docker images crashing on Apple Silicon (M1) #307

samrit opened this issue Jul 3, 2021 · 9 comments

Comments

@samrit
Copy link

samrit commented Jul 3, 2021

Bug report

Describe the bug

The strapi/strapi docker image does not run on the Apple M1 chip running Big Sur.

Steps to reproduce the behavior

  1. Go to https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/installation/docker.html#creating-a-strapi-project
  2. Copy the docker-compose file (postgresql version) into some local docker-compose.yml
  3. docker-compose pull
  4. mkdir app
  5. mkdir data
  6. docker-compose up -d
  7. docker-compose logs -f strapi
  8. Wait for strapi to install, drink some coffee, take a bath.

And then 💩

strapi_1    | Starting your app...
strapi_1    | Building your admin UI with development configuration ...
strapi_1    | ℹ Compiling Webpack
strapi_1    | ✔ Webpack: Compiled successfully in 2.79m
strapi_1    | qemu: uncaught target signal 4 (Illegal instruction) - core dumped
strapi_strapi_1 exited with code 0

Expected behavior

Should install and launch Strapi admin interface that is accessible at http://localhost:1337

System

As specified in the docker images and compose file provided by Strapi docs.

Additional context

Likely needs an ARM docker image. Someone tried to report something similar in April (strapi/strapi#10118)

@derrickmehaffy derrickmehaffy transferred this issue from strapi/strapi Jul 7, 2021
@derrickmehaffy
Copy link
Member

Transferred to the proper repo.

@jupiteruwdev
Copy link

Any updates on this?
I'm using strapi/base inside my Dockerfile and when I'm running docker-compose up, I'm getting this error.

smartdefi-mysql    | runtime: failed to create new OS thread (have 2 already; errno=22)
smartdefi-mysql    | fatal error: newosproc
smartdefi-mysql    |
smartdefi-mysql    | runtime stack:
smartdefi-mysql    | runtime.throw(0x524da0, 0x9)
smartdefi-mysql    | 	/usr/local/go/src/runtime/panic.go:527 +0x90
smartdefi-mysql    | runtime.newosproc(0xc82002a000, 0xc820039fc0)
smartdefi-mysql    | 	/usr/local/go/src/runtime/os1_linux.go:150 +0x1ab
smartdefi-mysql    | runtime.newm(0x555ce8, 0x0)
smartdefi-mysql    | 	/usr/local/go/src/runtime/proc1.go:1105 +0x130
smartdefi-mysql    | runtime.main.func1()
smartdefi-mysql    | 	/usr/local/go/src/runtime/proc.go:48 +0x2c
smartdefi-mysql    | runtime.systemstack(0x5c4300)
smartdefi-mysql    | 	/usr/local/go/src/runtime/asm_amd64.s:262 +0x79
smartdefi-mysql    | runtime.mstart()
smartdefi-mysql    | 	/usr/local/go/src/runtime/proc1.go:674
smartdefi-mysql    |
smartdefi-mysql    | goroutine 1 [running]:
smartdefi-mysql    | runtime.systemstack_switch()
smartdefi-mysql    | 	/usr/local/go/src/runtime/asm_amd64.s:216 fp=0xc820024770 sp=0xc820024768
smartdefi-mysql    | runtime.main()
smartdefi-mysql    | 	/usr/local/go/src/runtime/proc.go:49 +0x62 fp=0xc8200247c0 sp=0xc820024770
smartdefi-mysql    | runtime.goexit()
smartdefi-mysql    | 	/usr/local/go/src/runtime/asm_amd64.s:1696 +0x1 fp=0xc8200247c8 sp=0xc8200247c0
smartdefi-mysql exited with code 2

@derrickmehaffy any update on this issue fixing?

@ChristianHeimke
Copy link

if you are using an m1 chip the current docker images won't work (not only strapi, also mysql, postgres, etc).. or in a most unstable way. The cross platform is supported by docker, but I guess it is still beta (have a look here: https://docs.docker.com/desktop/mac/apple-silicon/)
if you need to run strapi inside docker, you can use another "vm hypervisor" (maybe virtualbox is working) and install a linux and setup docker inside the vm.
maybe this will help you until docker is more stable on the m1 chip.

@botverse
Copy link

botverse commented Nov 4, 2021

This reports an actual bug, the images should be multi-arch, given that devs are starting to use arm laptops from Apple and this images from strapi are development images, they should work in linux/arm64/v8 too.

@JanMikes
Copy link

Hi, if you are opened to transit from travis to github actions, it is very easy to use multiarch docker build.

Some inspiration (it uses ghcr.io registry) can be taken from here for example: https://github.com/peon-dev/peon/blob/master/.github/workflows/docker.yml

@landoephan
Copy link

any news here?

@vicpara
Copy link

vicpara commented Dec 22, 2022

I have the same issue. Any workaround?

@JanMikes
Copy link

Hi @vicpara the best way is to build your own image locally. You can get some inspiration here: https://github.com/JanMikes/celadna.cz/blob/main/strapi/Dockerfile

@MrMarci666
Copy link

We've created a custom image with the same structure, you can use it if you want (I am not updating it regularly, but if you ping me I can do it) see here: https://registry.hub.docker.com/r/dunadigital/strapi

However, there is a new tool by Strapi, check it out: https://github.com/strapi-community/strapi-tool-dockerize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants