Run docker-compose in RHEL
I was trying to run ‘docker-compose’ in our environment today, but found following message from RedHat officially:
Is docker-compose included in RHEL or RHEL Atomic Host ?
SOLUTION VERIFIED — Updated August 24 2017 at 11:12 AM -
- Red Hat Enterprise Linux 7.x
- We want to install
RHEL 7.4server. Is it supported ? If not, are there any workarounds without using
RHEL Atomic Host?
docker-composebe added to the
Extras channel- or be made available from
Red Hatin general, like the other
OpenShift (kube)and our
container development kit, based on
minishift, as the preferred technology for
low-level container orchestration.
ansible-container projectis another project that provides strong overlap in capability with
docker-composeand can also work with
Red Hatwill continue to evaluate
ansible-containerbut there are no plans to include either in
RHELat this time.
So we are on our own…
Get the latest version from Github: https://github.com/docker/compose/releases
Same as usual, link it to /usr/local/bin/docker-compose
Give it exe permission…
However, here is the problem happening in RHEL 7.4:
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted
I tried to disable SElinux, not working…
Finally, I came across this github issue and I tried one of the workarounds which worked in my instance.
Solution was to remount tmp with exec permission by executing :
sudo mount /tmp -o remount,exec
Or have following ansible block:
- name: make mount tmp with exec
src: /dev/mapper/rootvg-tmpvol # your own real path
fstype: xfs # your own real type
opts: nodev,nosuid # as long as you don't have noexec... :)