Troubleshooting Docker-Compose Installation on CentOS 7: libz.so.1 Error

Hello everyone,

I’m facing an issue with setting up Docker on CentOS 7 and need some advice. Here are the steps I followed:

Docker Community Edition Installation

Added Docker CE repo:

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Installed Docker CE:

sudo yum install docker-ce

Started Docker:

sudo systemctl start docker

Docker-Compose Installation

Used curl to install Docker-Compose:

sudo curl -L “https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

After installation, when I check the version with docker-compose --version, I encounter the following error:

docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object

Here is the cat etc/fstab output

/root/images/tmpfile.bin /tmp ext4 rw,noexec,nosuid,nodev 0 0

I suspect this issue might be related to the /tmp directory being mounted with noexec.

Questions:

  1. Based on my setup, does the issue seem related to the /tmp folder’s noexec setting?
  2. If I change the directory from /tmp to /var/tmp, could it resolve the issue? Would there be any potential side effects?

Thanks, in advance.