Comments (11)
看起来是文件夹访问权限问题,因为 CentOS 默认是打开 SELinux 的,有很多情况与这个有关,不过从截图中看不出来。
我在 VirtualBox 中安装了 CentOS 7 3.10.0-693.el7.x86_64
,使用 yum 安装 rpm 包的方式安装了 Docker version 17.09.0-ce, build afdb6d4
,使用 docker-compose version 1.16.1, build 6d1ac21
没有复现错误。
可以在主机 easy-mock 目录和 docker 内 easy-mock 目录执行命令 id -Z
和 ls -ldZ
,然后把结果贴出来看看。
也可以参考一下这些方式看看是否有帮助
moby/moby#14175
http://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux
from easy-mock-docker.
感谢回复,以下为命令结果贴图和做的一些尝试
命令结果贴图
做的一些尝试
尝试使用 mrs 用户启动 sudo docker-compose up
,报错和 root 用户下启动相同
尝试不挂载 logs 目录,能启动成功
from easy-mock-docker.
通过 id -Z
结果可以看出系统 SELinux 是关闭状态,按理来说不会触发 SELinux 导致容器内读取文件 permission denied 问题。我同样把系统 SELinux 关闭后启动新的容器,也没有复现问题。我的 ls -ldZ
的结果和你不太一样,我这边如下所示:
ls -Z
会列出文件安全上下文,可是你这里没有,也看不出什么问题。
现在能想到的做法是在主机上和容器内的 easy-mock 目录下 ls -al
查看一下文件拥有者和文件权限。
对于不挂在 logs 目录可以启动成功,有可能是 easy-mock 程序本身会判断文件夹是否存在,不存时自动创建或者不记录日志,没有参与 easy-mock 程序开发,具体就不太清楚了 😂。
from easy-mock-docker.
const logDir = path.join(__dirname, '../logs')
if (!fs.existsSync(logDir)) {
mkdirp.sync(logDir)
}
from easy-mock-docker.
😄 果然做了判断,不过虽然不挂载 logs 文件夹可以用,但是日志文件保存调试就不太方便了
from easy-mock-docker.
尝试在虚拟机的 Centos 7 系统上使用同样的配置部署,成功了。
尝试在安装了Centos 7 的电脑上使用同样的配置部署,报错和阿里云服务器上的报错一样。
=.=
from easy-mock-docker.
👌 待今天下班后把家里机器装成 CentOS 7 尝试一下。
from easy-mock-docker.
家里机器 CentOS 7 没什么问题,十一长假没太关注,等稍有空去阿里云试一下。
from easy-mock-docker.
后续在我自己的服务器尝试了下,也没有报错出现,issue 暂时关闭了,有后续讨论我们可以再打开。
from easy-mock-docker.
from easy-mock-docker.
遇到同样的问题...不挂载logs才能启动...emmmmmm
from easy-mock-docker.
Related Issues (20)
- macOS下启动不能启动web HOT 1
- 自定义部署路径 HOT 2
- 搜索团队会报错是什么原因呢? HOT 3
- web运行不起来 HOT 3
- 使用 network ! HOT 2
- docker镜像不维护了吗?easy-mock版本都4以上了 HOT 1
- docker-compose easymock 镜像版本问题 HOT 1
- docker-compose 部署时报文件权限错误 HOT 3
- docker-compose ps 一直在 Restarting HOT 1
- [ioredis] Unhandled error event: Error: connect ECONNREFUSED HOT 1
- 无法访问easy-mock问题 HOT 1
- docker部署运行出现: net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK) HOT 7
- easymock:1.6.0登录页加载失败
- 安装后,远程JS 加载失败,是不是需要更新下镜像代码了 HOT 1
- 1.3.3 镜像 up 之后提示访问,提示 window is not defined HOT 3
- npm start 时的权限问题 HOT 2
- 求一个CentOS7.x的docker-compose部署 HOT 2
- win10下部署报错:Operation not permitted, terminating HOT 4
- win10 使用docker部署不成功 HOT 1
- permission denied
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy-mock-docker.