Cypress 文件夹不可写

问题描述

我正在尝试让 Cypress 在我的构建过程中运行,但出现以下错误

2021-03-06 00:25:45 HAST    opening Cypress...
2021-03-06 00:25:45 HAST    Folder /code is not writable.
2021-03-06 00:25:48 HAST    
2021-03-06 00:25:48 HAST    Writing to this directory is required by Cypress in order to store screenshots and videos.
2021-03-06 00:25:48 HAST    
2021-03-06 00:25:48 HAST    Enable write permissions to this directory to ensure screenshots and videos are stored.
2021-03-06 00:25:48 HAST    
2021-03-06 00:25:48 HAST    If you don't require screenshots or videos to be stored you can safely ignore this warning.
2021-03-06 00:25:48 HAST    

我的 Dockerfile

FROM node12-ubuntu18.04

RUN apt-get update
RUN apt-get -y install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

RUN mkdir -p /code
workdir /code

ADD ./client/package.json /code/package.json
ADD ./client/yarn.lock /code/yarn.lock


RUN chown -R $USER:$USER /code
RUN chmod 755 /code

# install packages
RUN yarn install --pure-lockfile

# copy the source code
# `node_modules` and `coverage` will be excluded by .dockerignore
ADD ./client /code

RUN node_modules/.bin/cypress install

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)