strapi-docker icon indicating copy to clipboard operation
strapi-docker copied to clipboard

Strapi docker images crashing on Apple Silicon (M1)

Open samrit opened this issue 3 years ago • 9 comments

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 (https://github.com/strapi/strapi/issues/10118)

samrit avatar Jul 03 '21 20:07 samrit

Transferred to the proper repo.

derrickmehaffy avatar Jul 07 '21 20:07 derrickmehaffy

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?

jupiteruwdev avatar Sep 16 '21 15:09 jupiteruwdev

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.

ChristianHeimke avatar Oct 02 '21 19:10 ChristianHeimke

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.

botverse avatar Nov 04 '21 12:11 botverse

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

JanMikes avatar Mar 19 '22 10:03 JanMikes

any news here?

landoephan avatar Nov 30 '22 10:11 landoephan

I have the same issue. Any workaround?

vicpara avatar Dec 22 '22 14:12 vicpara

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

JanMikes avatar Dec 22 '22 14:12 JanMikes

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

MrMarci666 avatar Jan 09 '23 10:01 MrMarci666