Run docker-compose after reboot on RHEL 7

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












After installing Docker CE and Docker Compose on RHEL 7, I get an error trying to use it:



$ docker-compose --version
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted


A quick Google of the error leads to a one-liner solution:



sudo mount /tmp -o remount,exec


The problem is, each time the system reboots that command has the be run again. I've considered making a Bash script run as root on bootup, but this seems hacky and hard to maintain.



Is there a way to mount /tmp with the configuration Docker Compose needs?




In case it's helpful, here is the output of mount and /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









share|improve this question























  • Avoid putting answers in comments.
    – user1717828
    Dec 4 at 18:13














up vote
0
down vote

favorite
1












After installing Docker CE and Docker Compose on RHEL 7, I get an error trying to use it:



$ docker-compose --version
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted


A quick Google of the error leads to a one-liner solution:



sudo mount /tmp -o remount,exec


The problem is, each time the system reboots that command has the be run again. I've considered making a Bash script run as root on bootup, but this seems hacky and hard to maintain.



Is there a way to mount /tmp with the configuration Docker Compose needs?




In case it's helpful, here is the output of mount and /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









share|improve this question























  • Avoid putting answers in comments.
    – user1717828
    Dec 4 at 18:13












up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





After installing Docker CE and Docker Compose on RHEL 7, I get an error trying to use it:



$ docker-compose --version
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted


A quick Google of the error leads to a one-liner solution:



sudo mount /tmp -o remount,exec


The problem is, each time the system reboots that command has the be run again. I've considered making a Bash script run as root on bootup, but this seems hacky and hard to maintain.



Is there a way to mount /tmp with the configuration Docker Compose needs?




In case it's helpful, here is the output of mount and /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









share|improve this question















After installing Docker CE and Docker Compose on RHEL 7, I get an error trying to use it:



$ docker-compose --version
docker-compose: error while loading shared libraries: libz.so.1: failed to map segment from shared object: Operation not permitted


A quick Google of the error leads to a one-liner solution:



sudo mount /tmp -o remount,exec


The problem is, each time the system reboots that command has the be run again. I've considered making a Bash script run as root on bootup, but this seems hacky and hard to maintain.



Is there a way to mount /tmp with the configuration Docker Compose needs?




In case it's helpful, here is the output of mount and /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






permissions rhel mount docker tmp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 4 at 18:22









Jeff Schaller

37.8k1053122




37.8k1053122










asked Dec 4 at 18:13









user1717828

1,62911326




1,62911326











  • Avoid putting answers in comments.
    – user1717828
    Dec 4 at 18:13
















  • Avoid putting answers in comments.
    – user1717828
    Dec 4 at 18:13















Avoid putting answers in comments.
– user1717828
Dec 4 at 18:13




Avoid putting answers in comments.
– user1717828
Dec 4 at 18:13










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Your /etc/fstab is mounting the /tmp mount as noexec each time.



Replace that noexec option for the /tmp mount in /etc/fstab to be exec and reboot to see if that helps.






share|improve this answer




















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485960%2frun-docker-compose-after-reboot-on-rhel-7%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Your /etc/fstab is mounting the /tmp mount as noexec each time.



    Replace that noexec option for the /tmp mount in /etc/fstab to be exec and reboot to see if that helps.






    share|improve this answer
























      up vote
      0
      down vote













      Your /etc/fstab is mounting the /tmp mount as noexec each time.



      Replace that noexec option for the /tmp mount in /etc/fstab to be exec and reboot to see if that helps.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Your /etc/fstab is mounting the /tmp mount as noexec each time.



        Replace that noexec option for the /tmp mount in /etc/fstab to be exec and reboot to see if that helps.






        share|improve this answer












        Your /etc/fstab is mounting the /tmp mount as noexec each time.



        Replace that noexec option for the /tmp mount in /etc/fstab to be exec and reboot to see if that helps.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 4 at 18:28









        GracefulRestart

        1,08427




        1,08427



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485960%2frun-docker-compose-after-reboot-on-rhel-7%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)