openmaptiles编译源码(make)时出现Permission错误

openmaptiles编译源码(make)时出现Permission错误

出现时间

在make编译源码时出现。

[root@localhost openmaptiles]# make
docker-compose run --rm --user=0:0 openmaptiles-tools bash -c \
        'generate-tm2source openmaptiles.yaml > build/openmaptiles.tm2source/data.yml'
Creating openmaptiles_openmaptiles-tools_run ... done
bash: line 1: build/openmaptiles.tm2source/data.yml: Permission denied
ERROR: 1
make: *** [build/openmaptiles.tm2source/data.yml] Error 1

出现原因

Docker挂载主机目录,访问相应的文件出现Premission denied的权限访问问题。

解决方案

关闭selinux

  1. 临时关闭
setenforce 0
  1. 永久关闭
# 操作前先备份
  cp /etc/selinux/config /etc/selinux/config.bak
  cat /etc/selinux/config
#     SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
 
# 更改setlinux级别
sed -i 's/SELINUX=enforcing/\SELINUX=permissive/' /etc/selinux/config
     ==> vim /etc/selinux/config/  --> SELINUX=enforcing[效果同上]
  # SELINUX参数enforcing代表打开,disabled代表关闭
# 查看selinux状态:
   getenforce

3.添加selinux规则,改变要挂载的目录的安全性文本
4.修改Makefile,在运行容器的时候,给容器加特权,及加上 --privileged=true 参数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值