后安装 Docker CE和Docker 组合在 RHEL 7 上,我尝试使用它时遇到错误:
$ docker-compose --version
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted
快速谷歌一下错误会导致单线解决方案:
sudo mount /tmp -o remount,exec
问题是,每次系统重新启动时,该命令都会再次运行。我考虑过让 Bash 脚本在启动时以 root 身份运行,但这似乎很麻烦并且难以维护。
有没有办法挂载/tmp
Docker Compose 所需的配置?
如果有帮助,这里是mount
和的输出/etc/fstab
:
$ mount | grep tmp
devtmpfs on /dev type devtmpfs (rw,nosuid,size=8119132k,nr_inodes=2029783,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,noexec)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
/dev/mapper/VolGroup00-LogVol02 on /tmp type ext3 (rw,nosuid,nodev,noexec,relatime,data=ordered)
/dev/mapper/VolGroup00-LogVol02 on /var/tmp type ext3 (rw,nosuid,nodev,noexec,relatime,data=ordered)
tmpfs on /run/user/16777223 type tmpfs (rw,nosuid,nodev,relatime,size=1626620k,mode=700,uid=16777223,gid=16777221)~
#
# /etc/fstab
# Created by anaconda on Fri Oct 13 01:03:21 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup00-LogVol00 / ext3 defaults 1 1
UUID=9e305d5c-10d9-431a-ab40-8fc3a7a7bf81 /boot ext3 defaults 1 2
/dev/mapper/VolGroup00-LogVol06 /home ext3 nodev 0 0
/dev/mapper/VolGroup00-LogVol02 /tmp ext3 nodev,nosuid,noexec 0 0
/dev/mapper/VolGroup00-LogVol03 /var ext3 defaults 1 2
/dev/mapper/VolGroup00-LogVol04 /var/log ext3 defaults 1 2
/dev/mapper/VolGroup00-LogVol05 /var/log/audit ext3 defaults 1 2
/dev/mapper/VolGroup00-LogVol01 swap swap defaults 0 0
/dev/mapper/VolGroup01-LogVol01 /local/apps xfs defaults 1 2
tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0
/tmp /var/tmp none bind 0 0
答案1
您每次都/etc/fstab
安装安装座。/tmp
noexec
将该选项替换noexec
为/tmp
安装并重新启动以查看是否有帮助/etc/fstab
。exec