由于 M1 芯片上的 Qemu 错误,Docker/Cypress 容器失败 [英] Docker/Cypress Container Failing Due to Qemu Error on M1 Chip

查看:237
本文介绍了由于 M1 芯片上的 Qemu 错误,Docker/Cypress 容器失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Docker 镜像,我想在本地运行,但我认为它失败是由于 Qemu 的问题,这似乎源于试图在 M1 芯片上运行 Cypress:

I have a Docker image that I'd like to run locally but I believe it's failing due to an issue with Qemu, which seems to stem from attempting to run Cypress on an M1 chip:

REPOSITORY   TAG       IMAGE ID       CREATED       SIZE
dna          local     097c5f291db5   2 hours ago   3.66GB

当我尝试使用 docker run dna:local 在本地运行图像时,我得到以下信息:

When I attempt to run the image locally using docker run dna:local I get the following:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
yarn run v1.22.10
$ concurrently "yarn:start:ui" "yarn:start:api" "cypress run"
[start:api] $ cd api && yarn start:dev
[start:ui] $ cd ui && yarn start
[2] [STARTED] Task without title.
[start:api] $ DEBUG=socket.io:* DISABLE_AD=1 USE_MEMORY_DB=true nodemon --inspect -r esm ./src/app.js
[2] [FAILED] Cypress failed to start.
[2] [FAILED]
[2] [FAILED] This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies
[2] [FAILED]
[2] [FAILED] Please refer to the error below for more details.
[2] [FAILED]
[2] [FAILED] ----------
[2] [FAILED]
[2] [FAILED] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[2] [FAILED] qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped
[2] [FAILED]
[2] [FAILED]
[2] [FAILED] #
[2] [FAILED] # Fatal error in , line 0
[2] [FAILED] # ignored
[2] [FAILED] #
[2] [FAILED] #
[2] [FAILED] #
[2] [FAILED] #FailureMessage Object: 0x4009bb9420
[2] [FAILED] qemu: uncaught target signal 4 (Illegal instruction) - core dumped

我的 Dockerfile 如下所示:

My Dockerfile looks like this:

FROM cypress/browsers:node14.16.0-chrome90-ff88

# Copy the project into the Docker container
COPY . /

# Install the API and UI packages
RUN yarn workspace checkin-api install
RUN yarn workspace checkin-ui install

# Run the e2e test suite
CMD yarn run e2e

奇怪的是,如果我尝试为镜像指定平台,Docker 会抱怨在本地找不到镜像:

Strangely, if I try to specify a platform for the image, Docker complains that it can't find the image locally:

docker run --platform linux/arm64/v8 dna:local

为我提供以下信息:

Unable to find image 'dna:local' locally
docker: Error response from daemon: pull access denied for dna, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

我假设从 Cypress Docker 存储库中提取的图像决定了所使用的架构,而不是我的 --platform 标志?如果是这样,是否只是 Cypress 不会在我机器上的 Docker 容器中运行的情况?

I assume that the image pulled from the Cypress Docker repository dictates the architecture used as opposed to my --platform flag? If so, is it simply a case that Cypress won't run in a Docker container on my machine?

推荐答案

Cypress 的 Docker 容器似乎存在一个已知问题,无法与 M1 芯片一起正常工作:

Looks like there is a known issue with Cypress' Docker containers not working properly with M1 chips:

https://github.com/cypress-io/cypress-docker-images/issues/431

这篇关于由于 M1 芯片上的 Qemu 错误,Docker/Cypress 容器失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆