docker socket: permission denied

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











up vote
0
down vote

favorite












I have home server with proxmox 5 installed and some services in docker containers.
All was fine till yestarday.



I rebooted the server and all services in all containers cannot bind socket because of permission denied. I'm frustrated...



Here some technical details



Linux server 4.10.15-1-pve #1 SMP PVE 4.10.15-15 (Fri, 23 Jun 2017 08:57:55 +0200) x86_64 GNU/Linux

Docker version 18.03.0-ce, build 0520e24
docker-compose version 1.20.1, build 5d8c71b


caddy docker-compose.yml



version: '2'
services:
caddy:
container_name: caddy
image: zzrot/alpine-caddy:latest
restart: unless-stopped
network_mode: "host"
environment:
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
hostname: caddy
volumes:
- /etc/localtime:/etc/localtime:ro
- /mirror/config/caddy-config/certs:/root/.caddy
- /mirror/config/caddy-config/caddy:/etc/Caddyfile


docker-compose up output



root@server:~/compose/caddy# docker-compose up
Creating caddy ... done
Attaching to caddy
caddy | Activating privacy features... done.
caddy | 2018/03/23 19:55:21 listen tcp :443: socket: permission denied
caddy exited with code 1


mariadb docker-compose.yml



version: '3.1'
services:
mariadb:
container_name: mariadb
image: mariadb
restart: always
ports:
- 3306:3306/udp
- 3306:3306/tcp
environment:
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- MYSQL_ROOT_PASSWORD=password
hostname: mariadb
volumes:
- /mirror/config/mariadb-config/databases:/var/lib/mysql
- /mirror/config/custom.cnf:/etc/mysql/conf.d/config-file.cnf
- /mirror/config/logs:/config/logs


docker-compose up output



mariadb_1 | 2018-03-23 13:20:36 139659836417920 [Warning] Failed to create a socket for IPv6 '::': errno: 13.
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [Warning] Failed to create a socket for IPv4 '0.0.0.0': errno: 13.
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [ERROR] Can't create IP socket: Permission denied
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [ERROR] Aborting
mariadb_1 |
mariadb_mariadb_1 exited with code 1


What could be the reason for this?



Upd: some new details



kernel: audit: type=1400 audit(1521896913.536:10071): apparmor="DENIED" operation="create" profile="docker-default" pid=16502 comm="mysqld" family="inet" sock_type="dgram" protocol=0 requested_mask="create" denied_

audit[16271]: AVC apparmor="DENIED" operation="create" profile="docker-default" pid=16271 comm="caddy" family="inet" sock_type="dgram" protocol=0 requested_mask="create" denied_mask="create"






share|improve this question






















  • security_opt: - apparmor:unconfined solves the problem
    – Alexey Miller
    Mar 24 at 13:31










  • Please post your answer as an answer. :)
    – Matheus Santana
    Mar 24 at 15:19














up vote
0
down vote

favorite












I have home server with proxmox 5 installed and some services in docker containers.
All was fine till yestarday.



I rebooted the server and all services in all containers cannot bind socket because of permission denied. I'm frustrated...



Here some technical details



Linux server 4.10.15-1-pve #1 SMP PVE 4.10.15-15 (Fri, 23 Jun 2017 08:57:55 +0200) x86_64 GNU/Linux

Docker version 18.03.0-ce, build 0520e24
docker-compose version 1.20.1, build 5d8c71b


caddy docker-compose.yml



version: '2'
services:
caddy:
container_name: caddy
image: zzrot/alpine-caddy:latest
restart: unless-stopped
network_mode: "host"
environment:
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
hostname: caddy
volumes:
- /etc/localtime:/etc/localtime:ro
- /mirror/config/caddy-config/certs:/root/.caddy
- /mirror/config/caddy-config/caddy:/etc/Caddyfile


docker-compose up output



root@server:~/compose/caddy# docker-compose up
Creating caddy ... done
Attaching to caddy
caddy | Activating privacy features... done.
caddy | 2018/03/23 19:55:21 listen tcp :443: socket: permission denied
caddy exited with code 1


mariadb docker-compose.yml



version: '3.1'
services:
mariadb:
container_name: mariadb
image: mariadb
restart: always
ports:
- 3306:3306/udp
- 3306:3306/tcp
environment:
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- MYSQL_ROOT_PASSWORD=password
hostname: mariadb
volumes:
- /mirror/config/mariadb-config/databases:/var/lib/mysql
- /mirror/config/custom.cnf:/etc/mysql/conf.d/config-file.cnf
- /mirror/config/logs:/config/logs


docker-compose up output



mariadb_1 | 2018-03-23 13:20:36 139659836417920 [Warning] Failed to create a socket for IPv6 '::': errno: 13.
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [Warning] Failed to create a socket for IPv4 '0.0.0.0': errno: 13.
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [ERROR] Can't create IP socket: Permission denied
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [ERROR] Aborting
mariadb_1 |
mariadb_mariadb_1 exited with code 1


What could be the reason for this?



Upd: some new details



kernel: audit: type=1400 audit(1521896913.536:10071): apparmor="DENIED" operation="create" profile="docker-default" pid=16502 comm="mysqld" family="inet" sock_type="dgram" protocol=0 requested_mask="create" denied_

audit[16271]: AVC apparmor="DENIED" operation="create" profile="docker-default" pid=16271 comm="caddy" family="inet" sock_type="dgram" protocol=0 requested_mask="create" denied_mask="create"






share|improve this question






















  • security_opt: - apparmor:unconfined solves the problem
    – Alexey Miller
    Mar 24 at 13:31










  • Please post your answer as an answer. :)
    – Matheus Santana
    Mar 24 at 15:19












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have home server with proxmox 5 installed and some services in docker containers.
All was fine till yestarday.



I rebooted the server and all services in all containers cannot bind socket because of permission denied. I'm frustrated...



Here some technical details



Linux server 4.10.15-1-pve #1 SMP PVE 4.10.15-15 (Fri, 23 Jun 2017 08:57:55 +0200) x86_64 GNU/Linux

Docker version 18.03.0-ce, build 0520e24
docker-compose version 1.20.1, build 5d8c71b


caddy docker-compose.yml



version: '2'
services:
caddy:
container_name: caddy
image: zzrot/alpine-caddy:latest
restart: unless-stopped
network_mode: "host"
environment:
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
hostname: caddy
volumes:
- /etc/localtime:/etc/localtime:ro
- /mirror/config/caddy-config/certs:/root/.caddy
- /mirror/config/caddy-config/caddy:/etc/Caddyfile


docker-compose up output



root@server:~/compose/caddy# docker-compose up
Creating caddy ... done
Attaching to caddy
caddy | Activating privacy features... done.
caddy | 2018/03/23 19:55:21 listen tcp :443: socket: permission denied
caddy exited with code 1


mariadb docker-compose.yml



version: '3.1'
services:
mariadb:
container_name: mariadb
image: mariadb
restart: always
ports:
- 3306:3306/udp
- 3306:3306/tcp
environment:
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- MYSQL_ROOT_PASSWORD=password
hostname: mariadb
volumes:
- /mirror/config/mariadb-config/databases:/var/lib/mysql
- /mirror/config/custom.cnf:/etc/mysql/conf.d/config-file.cnf
- /mirror/config/logs:/config/logs


docker-compose up output



mariadb_1 | 2018-03-23 13:20:36 139659836417920 [Warning] Failed to create a socket for IPv6 '::': errno: 13.
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [Warning] Failed to create a socket for IPv4 '0.0.0.0': errno: 13.
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [ERROR] Can't create IP socket: Permission denied
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [ERROR] Aborting
mariadb_1 |
mariadb_mariadb_1 exited with code 1


What could be the reason for this?



Upd: some new details



kernel: audit: type=1400 audit(1521896913.536:10071): apparmor="DENIED" operation="create" profile="docker-default" pid=16502 comm="mysqld" family="inet" sock_type="dgram" protocol=0 requested_mask="create" denied_

audit[16271]: AVC apparmor="DENIED" operation="create" profile="docker-default" pid=16271 comm="caddy" family="inet" sock_type="dgram" protocol=0 requested_mask="create" denied_mask="create"






share|improve this question














I have home server with proxmox 5 installed and some services in docker containers.
All was fine till yestarday.



I rebooted the server and all services in all containers cannot bind socket because of permission denied. I'm frustrated...



Here some technical details



Linux server 4.10.15-1-pve #1 SMP PVE 4.10.15-15 (Fri, 23 Jun 2017 08:57:55 +0200) x86_64 GNU/Linux

Docker version 18.03.0-ce, build 0520e24
docker-compose version 1.20.1, build 5d8c71b


caddy docker-compose.yml



version: '2'
services:
caddy:
container_name: caddy
image: zzrot/alpine-caddy:latest
restart: unless-stopped
network_mode: "host"
environment:
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
hostname: caddy
volumes:
- /etc/localtime:/etc/localtime:ro
- /mirror/config/caddy-config/certs:/root/.caddy
- /mirror/config/caddy-config/caddy:/etc/Caddyfile


docker-compose up output



root@server:~/compose/caddy# docker-compose up
Creating caddy ... done
Attaching to caddy
caddy | Activating privacy features... done.
caddy | 2018/03/23 19:55:21 listen tcp :443: socket: permission denied
caddy exited with code 1


mariadb docker-compose.yml



version: '3.1'
services:
mariadb:
container_name: mariadb
image: mariadb
restart: always
ports:
- 3306:3306/udp
- 3306:3306/tcp
environment:
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- MYSQL_ROOT_PASSWORD=password
hostname: mariadb
volumes:
- /mirror/config/mariadb-config/databases:/var/lib/mysql
- /mirror/config/custom.cnf:/etc/mysql/conf.d/config-file.cnf
- /mirror/config/logs:/config/logs


docker-compose up output



mariadb_1 | 2018-03-23 13:20:36 139659836417920 [Warning] Failed to create a socket for IPv6 '::': errno: 13.
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [Warning] Failed to create a socket for IPv4 '0.0.0.0': errno: 13.
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [ERROR] Can't create IP socket: Permission denied
mariadb_1 | 2018-03-23 13:20:36 139659836417920 [ERROR] Aborting
mariadb_1 |
mariadb_mariadb_1 exited with code 1


What could be the reason for this?



Upd: some new details



kernel: audit: type=1400 audit(1521896913.536:10071): apparmor="DENIED" operation="create" profile="docker-default" pid=16502 comm="mysqld" family="inet" sock_type="dgram" protocol=0 requested_mask="create" denied_

audit[16271]: AVC apparmor="DENIED" operation="create" profile="docker-default" pid=16271 comm="caddy" family="inet" sock_type="dgram" protocol=0 requested_mask="create" denied_mask="create"








share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 1:47

























asked Mar 23 at 13:23









Alexey Miller

1012




1012











  • security_opt: - apparmor:unconfined solves the problem
    – Alexey Miller
    Mar 24 at 13:31










  • Please post your answer as an answer. :)
    – Matheus Santana
    Mar 24 at 15:19
















  • security_opt: - apparmor:unconfined solves the problem
    – Alexey Miller
    Mar 24 at 13:31










  • Please post your answer as an answer. :)
    – Matheus Santana
    Mar 24 at 15:19















security_opt: - apparmor:unconfined solves the problem
– Alexey Miller
Mar 24 at 13:31




security_opt: - apparmor:unconfined solves the problem
– Alexey Miller
Mar 24 at 13:31












Please post your answer as an answer. :)
– Matheus Santana
Mar 24 at 15:19




Please post your answer as an answer. :)
– Matheus Santana
Mar 24 at 15:19










1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










I have added security_opt to docker-compose and problem has gone.



 security_opt:
- apparmor:unconfined


But I do not consider this option a completely correct solution of the problem.






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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f433062%2fdocker-socket-permission-denied%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    I have added security_opt to docker-compose and problem has gone.



     security_opt:
    - apparmor:unconfined


    But I do not consider this option a completely correct solution of the problem.






    share|improve this answer
























      up vote
      0
      down vote



      accepted










      I have added security_opt to docker-compose and problem has gone.



       security_opt:
      - apparmor:unconfined


      But I do not consider this option a completely correct solution of the problem.






      share|improve this answer






















        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        I have added security_opt to docker-compose and problem has gone.



         security_opt:
        - apparmor:unconfined


        But I do not consider this option a completely correct solution of the problem.






        share|improve this answer












        I have added security_opt to docker-compose and problem has gone.



         security_opt:
        - apparmor:unconfined


        But I do not consider this option a completely correct solution of the problem.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 1:46









        Alexey Miller

        1012




        1012






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f433062%2fdocker-socket-permission-denied%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay