docker-compose: error while loading shared libraries

When running docker-compose on CentOS 7, i get following error

[root@cp03 serverok-rubycms]# docker-compose up
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted
[root@cp03 serverok-rubycms]#

To fix the error, do the following

mv /usr/local/bin/docker-compose /usr/local/bin/docker-compose-bin

Now create a new file

Advertisement

vi /usr/local/bin/docker-compose

Add following content

#!/bin/bash

export TMPDIR=/opt/compose-tmp
/usr/local/bin/docker-compose-bin "$@"

Make it executable

chmod 755 /usr/local/bin/docker-compose

Create temp folder

mkdir -p /opt/compose-tmp

Now docker-compose will work.

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement