mattermost-docker icon indicating copy to clipboard operation
mattermost-docker copied to clipboard

Failed to set capabilities

Open frohrka opened this issue 5 years ago • 2 comments

After running

docker-compose build on Linux with docker-compose Version docker-compose version 1.25.0, build 0a186604 and docker verion 19.03.5, build 633a0ea838 I'm getting this error.

usage: setcap [-q] [-v] [-n <rootid>] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]

 Note <filename> must be a regular (non-symlink) file.
ERROR: Service 'app' failed to build: The command '/bin/sh -c mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins     && if [ ! -z "$MM_BINARY" ]; then curl $MM_BINARY | tar -xvz ;       elif [ "$edition" = "team" ] ; then curl https://releases.mattermost.com/$MM_VERSION/mattermost-team-$MM_VERSION-linux-amd64.tar.gz | tar -xvz ;       else curl https://releases.mattermost.com/$MM_VERSION/mattermost-$MM_VERSION-linux-amd64.tar.gz | tar -xvz ; fi     && cp /mattermost/config/config.json /config.json.save     && rm -rf /mattermost/config/config.json     && addgroup -g ${PGID} mattermost     && adduser -D -u ${PUID} -G mattermost -h /mattermost -D mattermost     && chown -R mattermost:mattermost /mattermost /config.json.save /mattermost/plugins /mattermost/client/plugins     && setcap cap_net_bind_service=+ep /mattermost/bin/mattermost' returned a non-zero code: 1

If I run docker-compose build everything works as expected. I tried it on two debian stretch systems and got the same error message.

frohrka avatar Dec 30 '19 12:12 frohrka

Same error trying to upgrade mattermost from 5.15.1 to 5.18. docker-compose version 1.14.0, build c7bdf9e docker engine version 19.03.3 API version: 1.40

ManuCasl avatar Jan 02 '20 09:01 ManuCasl

It's dirty but it was successful for us. Edit the file app/Dockerfile and replace :

&& chown -R mattermost:mattermost /mattermost /config.json.save /mattermost/plugins /mattermost/client/plugins \
    && setcap cap_net_bind_service=+ep /mattermost/bin/mattermost

by

&& chown -R mattermost:mattermost /mattermost /config.json.save /mattermost/plugins /mattermost/client/plugins
    #&& setcap cap_net_bind_service=+ep /mattermost/bin/mattermost

Comment && setpcap and delete the "" -- last -- character.

Next

docker-compose build docker-compose up -d

rlapleige-am avatar Jan 07 '20 21:01 rlapleige-am