strapi / strapi-docker

Install and run your first Strapi project using Docker
https://strapi.io
MIT License
1.16k stars 447 forks source link

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

Open samrit opened 3 years ago

samrit commented 3 years ago

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)

derrickmehaffy commented 2 years ago

Transferred to the proper repo.

jupiteruwdev commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

any news here?

vicpara commented 1 year ago

I have the same issue. Any workaround?

JanMikes commented 1 year ago

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 commented 1 year ago

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