我们有这个Dockerfile:
FROM mcr.microsoft.com/playwright:v1.20.0-focal
ADD ./sometest.e2e.spec.js /
RUN yarn add playwright && \
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright install && \
yarn add @playwright/test
RUN PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers ./node_modules/playwright/node_modules/.bin/playwright test当我们尝试构建时,在bitbucket管道(它反过来使用图像停靠程序:20.10.8-al菠萝3.13)期间,会发生这样的错误:
...
Step 4/4 : RUN PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers ./node_modules/playwright/node_modules/.bin/playwright test
---> Running in d8a3b2a2d013
[Error: EACCES: permission denied, scandir '/proc/tty/driver'] {
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/proc/tty/driver'
}在本地,它可以工作,但在管道中,即使我在/proc/tty/driver文件夹中执行一个简单的"ls“命令,它也会崩溃,而权限被拒绝。
有小费吗?谢谢!
发布于 2022-09-06 00:03:25
我在使用根目录,创建了一个非根目录,问题解决了!
FROM mcr.microsoft.com/playwright:v1.25.0-focal
RUN mkdir /playwright
ADD ./sometest.e2e.spec.js /playwright
RUN cd /playwright && \
yarn add playwright && \
PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers npx playwright install && \
yarn add @playwright/test
RUN cd /playwright && PLAYWRIGHT_BROWSERS_PATH=$HOME/pw-browsers ./node_modules/playwright/node_modules/.bin/playwright test谢谢你!!
https://stackoverflow.com/questions/73615498
复制相似问题