ByteInternet / hypernode-docker

Fast and easy Docker for Magento development
https://community.hypernode.io/hypernode-docker
35 stars 8 forks source link

Apple Silicon M1 support #65

Open jordy2607 opened 2 years ago

jordy2607 commented 2 years ago

Hi,

I'm currently trying to set up a magento hypernode docker environment on my local machine. unfortunately i'm running into issues and the environment is not running. It seems to connected to my Macbook with a silicon m1 chip. Since my colleagues have no issues on intel chips.

is there support for this silicon m1 chip?

Below the errors i'm running into while the docker image is running:

Nginx error log:

2022/02/18 14:51:02 [error] 1594#1594: failed to initialize Lua VM in /etc/nginx/nginx.conf:142

bash commands in docker environment:

app@XP_DOCKER:[~/magento2]
bash> curl http://127.0.0.1:9200
curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused
app@XP_DOCKER:[~/magento2]
bash> restart
Killing old Hypernode services
pkill: killing pid 527 failed: Operation not permitted
pkill: killing pid 535 failed: Operation not permitted
pkill: killing pid 552 failed: Operation not permitted
Killing any old NGINX service
Killing any old Redis service
pkill: killing pid 527 failed: Operation not permitted
pkill: killing pid 532 failed: Operation not permitted
Killing any old PHP-FPM service
pkill: killing pid 535 failed: Operation not permitted
pkill: killing pid 540 failed: Operation not permitted
Killing any old MySQL service
pkill: killing pid 552 failed: Operation not permitted
pkill: killing pid 557 failed: Operation not permitted
pkill: killing pid 571 failed: Operation not permitted
Killing any old Mailhog service
Killing any old nginx-config-reloader service
Killing any old Varnish service
Killing any old ElasticSearch service
Giving any old services 5 seconds to stop..
No Sockets found in /run/screen/S-app.

jq: error: Could not open file /etc/hypernode/magweb.json: Permission denied
Starting new detached hypernode services. See screen -x
Starting NGINX
Starting Redis
Starting PHP
update-alternatives: error: alternative /usr/bin/php for php not registered; not setting
Starting MySQL
Starting Mailhog
Starting nginx-config-reloader
Starting Varnish
Starting ElasticSearch
Giving the new services a couple of seconds to start..
No JSON object could be decoded
hypernode-docker status: 
You can login now with SSH from another terminal, see the instructions above.

I noticed markshust also had some issues and made some changes to make it work. is there a possibility you can support this aswell?

https://github.com/markshust/docker-magento/commit/767d691c20bc542e5c983b8979fad80465e9e484 https://github.com/markshust/docker-magento/commit/5767f628733eb831f3b89dcabc3f40e16fc87efd https://docs.docker.com/desktop/mac/apple-silicon/

rtscherepanow commented 2 years ago

Just remove the LUA support at all from nginx.conf and security.conf by replacing these files in a custom docker image. patch.zip LUA is only used to render the NGINX default page. Tested with docker.hypernode.com/byteinternet/hypernode-buster-docker-php74-mysql57:latest ...

Apple Silicon patches

RUN sudo mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.org RUN sudo mv /etc/nginx/security.conf /etc/nginx/security.conf.org COPY ./patches/nginx.conf /etc/nginx/nginx.conf COPY ./patches/security.conf /etc/nginx/security.conf ...

@ByteInternet -> Or you guys just do it in your provided images directly :) BTW: If you could provide all the files that are required to build the images, I'll would give a native arm64 build a try.