Today, I started to try some stuff with Docker, after install docker-engine complete smoothly. Next to install docker-compose, I recently got very annoying error on my Ubuntu 16.04 machine. Follow the instruction at https://docs.docker.com/compose/install/ , right on the step 7, after the install complete, I try to test it by command
$ docker-compose --version
But instead of showing the version, it throw error with message
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object
After some minutes searching on Google, I find out it missing exec permission on /tmp folder. So, I remount the /tmp folder with exec permission and it work perfectly. You can do by follow the command below.
sudo mount /tmp -o remount,exec
Source : https://github.com/docker/compose/issues/1339#issuecomment-196971221
You can also fix this issue this way:
TMPDIR=/var/tmp /usr/local/bin/docker-compose
if /var/tmp allows the execution of binaries.
I just wanted to say thank you. Instead of hours of trouble shooting and pulling my hair out this solved it right away. Thank you for posting how you solve this with good SEO.