Docker中使用命令COPY-ADD导入文件对权限的影响
发表于|更新于
|浏览量:
1、文件
保留权限原文件的权限
所属用户与组为镜像中的用户
可以使用--chown=jenkins:jenkins来指定用户所属
1 | COPY --chown=1001:1001 sample.txt sample.txt |
2、压缩包(ADD)
保留权限原文件的权限
保留压缩包内文件的用户与组
文章作者: Michael Pan
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Michael Blog!
相关推荐
2020-05-20
使用Vagrant+Ansible一键部署Rancher2-0
Kubernetes的流行程度就不说了,前两天关注了另一个产品Rancher。使用它可以快速部署与接管Kubernetes。而且Rancher的部署非常简单,只需要跑一个容器就完事了。 既然这么简单,那我们就使用Vagrant与Ansible让它更简单。 安装Vagrant + VirtualBox 具体安装不表了,不是本文知识。相信大家多半都使用过,如果没有使用过,赶紧学习起来。 导入Vagrant Box。这里使用的是Centos 7.5 centos75-with-boxadditions.box下载链接: https://pan.baidu.com/s/1U-kJhbY2JirHgw0eP9TBXw 密码: 1a6b 1vagrant box add centos/75 centos75-with-boxadditions.box 或者安装vagrant插件 1$ vagrant plugin install vagrant-disksize vagrant-ignition vagrant-vbguest 定义Vagrantfile,设置好虚拟机的配置,具...
2020-05-20
Openshift集群升级3-6至3-7
更新方法与策略:自动升级方法 更新openshift-ansible的脚本代码 12git pull git checkout -b release-3.7 安装需要的包 1ansible all -m yum -a 'name=pyOpenSSL state=present' 关闭Service Catalog和Template Service Broker。3.7 以上版本默认会启用 Service Catalog 和 Template Service Broker 123456# /etc/ansible/hosts...openshift_enable_service_catalog=falsetemplate_service_broker_install=falseansible_service_broker_install=false... 关闭etcd目录的selinux检查关闭任务Check selinux label of ‘‘与Make sure the ‘‘ has the proper label 12345678910...
2020-05-20
OpenShift中的Grafana监控界面无法完成登录
问题描述:访问OpenShift默认的grafana无法跳转到OpenShift console界面。报如下错误: 12{"error":"invalid_request","error_description":"The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed."} 解决办法: 1$ oc patch sa grafana -p '{"metadata":{"annotations":{"serviceaccounts.openshift.io/oauth-redirecturi.first":"https://grafana.ap...

2020-05-20
Openshift网络插件动态切换
Openshift 3.11版本Openshift SDN网络插件ovs-subnet 与 ovs-multitenant切换 更改节点上的networkPluginName的配置 master节点:/etc/origin/master/master-config.yaml node节点:/etc/origin/node/node-config.yaml 将networkPluginName中的redhat/openshift-ovs-subnet换成redhat/openshift-ovs-multitenant,或者反过来。 12$ ansible all -m shell -a 'sed -i "s/openshift-ovs-subnet/openshift-ovs-multitenant/g" /etc/origin/node/node-config.yaml'$ ansible masters -m shell -a 'sed -i "s/openshift-ovs-subnet/openshif...
2020-05-20
Jira容器化-+-Openshift-Jira模板创建
因为应用容器化部署已经是标准化的流程,无需再详篇介绍具体的部署流程。所以本文只提供相关的配置文档。如果对部署过程不了解的同学,请先自学容器基础。镜像已经创建好了,如下 12docker.io/xhuaustc/jira-software:7.11.0docker.io/xhuaustc/atlassian-mysql:5.7 镜像构建配置Jira容器构建 1git clone https://github.com/cptactionhank/docker-atlassian-jira-software 将setenv.sh与atlassian-extras-3.2.jar拷贝到docker-atlassian-jira-software 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919...

2020-05-22
Openshift-常见运维脚本及问题解决
1.扩容计算结点在执行扩容前需检查扩容节点的以下几点信息: 内核版本 selinux已经开启enforcing docker数据盘已经就绪 /etc/resolv.conf配置正确 hostname已经设置 时间同步已配置 在每个节点都能解析新增节点的域名,如果是通过/etc/hosts来配置域名解析,需要在配置后重启所有节点的dnsmasq服务 docker证书的问题需要添加到自动化配置中来,特别是私有镜像仓库的证书。有三个地方: /etc/sysconfig/docker配置, /etc/pki/ca-trust/source/anchors/目录下的证书, /etc/docker/certs.d下docker拉取镜像认证证书 123456789101112131415# /etc/ansible/hosts[OSEv3:children]mastersnodesetcdnew_nodes...[new_nod...
