cypress-example-docker-compose
cypress-example-docker-compose copied to clipboard
Errors on build or cy-open
Trying to set up for first time with Docker and running into issues.
This is a Symfony API-Platform back-end, Next js front-end with mySql.
I am on Mac with M1, which is important to have in mind for the first issue.
So, the initial directory structure is as follows:
/api
Dockerfile
/pwa
Dockerfile
docker-compose.yml
So I tried this two ways:
1 - First I attempted to install Cypress within my Next js app, in the regular way:
docker-compose exec pwa npm install cypress
so that the directory structure became:
/api
Dockerfile
/pwa
/cypress
Dockerfile
docker-compose.yml
In this case the image builds but when attempting to run cypress open the following error occurs:
Cypress failed to start.
This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies
Please refer to the error below for more details.
----------
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
----------
Platform: linux-x64 (Alpine Linux - 3.15.4)
Cypress Version: 9.5.4
Looking around I find a few issues stating that this was related to Mac M1, but adding platform: linux/amd64 to e2e on docker-compose.yml did not resolve the issue.
I have added the same platform on a mysql image that works fine with that.
2- Secondly I attempted the solution from this repo, ie, building a separate image for cypress within my app;
/api
Dockerfile
/pwa
Dockerfile
/e2e
Dockerfile
docker-compose.yml
But as you can see below, it fails when attempting to run npx cypress verify.
Only thing I changed on the code you proposed was to make e2e depend on pwa instead of web, to conform with my nomenclature.
As above, it is saying that this could be related to missing dependencies. While I could understand that in case 1 above, I would be surprised if your image does not already contain all required dependencies.
@BernardA I am having same issue on my Mac M1. Were you able to resolve issue and what did you do? Thanks.
@rnunezil No, I left it as is for now.