执行docker cp命令报错

问题描述:

在执行docker cp命令的时候,从宿主机复制文件到容器操作执行正常,但是从容器复制文件到宿主机的时候报如下所示报错:

Error response from daemon: error processing tar file: docker-tar: relocation error: /lib/x86_64-linux-gnu/libnss_files.so.2: symbol __libc_readline_unlocked, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference
: exit status 127

问题原因:

docker版本导致

Initialize nss libraries in Glibc so that the dynamic libraries are loaded in the host environment not in the chroot from untrusted files. CVE-2019-14271 may allow unprivileged access to host system while copying files from a malicious container image with docker cp command. Affected versions: v19.03.0. Older Docker versions are not affected by this issue. This fix is included in the already released Docker v19.03.1. Users of Docker v19.03.0 are advised to upgrade.

解决办法:

升级docker版本

[root@VM_0_16_centos ~]#  yum remove -y docker-ce docker-ce-cli

[root@VM_0_16_centos ~]#  yum -y install  docker-ce docker-ce-cli

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容