1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Issue Docker container has no internet access

Discussion in 'Plesk Extensions' started by TimoViBritannia, Nov 27, 2016.

  1. TimoViBritannia

    TimoViBritannia Basic Pleskian

    6
    70%
    Joined:
    Jun 4, 2016
    Messages:
    30
    Likes Received:
    0
    Hello,

    I am running some docker images on my server and all of them seem to be unable to connect to the internet. When I go into their shell and curl google.de I get curl: (6) Couldn't resolve host 'google.de'. Can someone please help me to fix this? I have the firewall turned on. And the forwarding of traffic is also turned on.


    Thanks,
    Timo
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    Looks like there is problem with hostnames resolving due to incorrect nameserver settings. Have you checked that /etc/resolv.conf has correctly specified nameservers? Also you can run docker with -dns option (eg docker run -dns 8.8.8.8 -dns 8.8.4.4 base ping google.com)
     
  3. TimoViBritannia

    TimoViBritannia Basic Pleskian

    6
    70%
    Joined:
    Jun 4, 2016
    Messages:
    30
    Likes Received:
    0
    Hi,
    I have a name Server specified: thats what it is in the file.
    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    nameserver 80.237.128.145
     
  4. TimoViBritannia

    TimoViBritannia Basic Pleskian

    6
    70%
    Joined:
    Jun 4, 2016
    Messages:
    30
    Likes Received:
    0
    It seems like the dns server can only be accessed from the local network of my hosting provider. But when I query it from my root it works fine and resolves everything.
     
  5. TimoViBritannia

    TimoViBritannia Basic Pleskian

    6
    70%
    Joined:
    Jun 4, 2016
    Messages:
    30
    Likes Received:
    0
    But also when I add the a environment variable inside of plesk and add DNS 8.8.8.8 I still get the same dns error.
     
  6. TimoViBritannia

    TimoViBritannia Basic Pleskian

    6
    70%
    Joined:
    Jun 4, 2016
    Messages:
    30
    Likes Received:
    0
    Are there any news on regarding this issue?
     
  7. TimoViBritannia

    TimoViBritannia Basic Pleskian

    6
    70%
    Joined:
    Jun 4, 2016
    Messages:
    30
    Likes Received:
    0
    Can someone please help me with this? Please
     
  8. Herman Ronk

    Herman Ronk New Pleskian

    1
    70%
    Joined:
    Oct 21, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Netherlands
    Did you find a solution for this problem? I have the same situation with a Duplicati container..
     
  9. AYamshanov

    AYamshanov Regular Pleskian Staff Member

    18
    55%
    Joined:
    Nov 24, 2016
    Messages:
    246
    Likes Received:
    63
    Location:
    Russia
    Hello,

    Could you describe your environment with Plesk (OS/version, Plesk/version, network settings, container)? Do you have steps to reproduce this issue? I think it should help with diagnosis.
     
  10. mr-wolf

    mr-wolf Silver Pleskian Plesk Guru

    26
    90%
    Joined:
    Oct 26, 2016
    Messages:
    517
    Likes Received:
    97
    Location:
    Netherlands
    You first need to establish if you have an internet connection before putting the blame on DNS.

    If DNS is correctly set, but no connecting to the outside world is present you will get the same error message (could not resolve host).

    Do a 'ping 8.8.8.8'

    For the Docker to work some special firewall rules should be in place. Check if these exist (on the host terminal, not in the docker)

    iptables-save | grep -i docker


    Do you have your firewall enabled and is it the one from Plesk?
     
  11. Herman Ronk

    Herman Ronk New Pleskian

    1
    70%
    Joined:
    Oct 21, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Netherlands
    The server:
    Operating System: CentOS Linux 7 (Core)

    Plesk:
    Plesk Onyx
    Version 17.5.3 Update #28

    The container config:
    upload_2017-11-13_8-56-7.png

    Which is a Duplicati container: https://hub.docker.com/r/linuxserver/duplicati/

    I can't ping from the container since the ping application is not present:

    Code:
    ping 8.8.8.8
    bash: ping: command not found
    From the host: iptables-save | grep -i docker :
    Code:
    :DOCKER - [0:0]
    -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
    -A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
    -A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE
    -A DOCKER -i docker0 -j RETURN
    -A DOCKER ! -i docker0 -p tcp -m tcp --dport 8200 -j DNAT --to-destination 172.17.0.2:8200
    :DOCKER - [0:0]
    :DOCKER-ISOLATION - [0:0]
    -A FORWARD -j DOCKER-ISOLATION
    -A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
    -A FORWARD -o docker0 -j DOCKER
    -A FORWARD -i docker0 ! -o docker0 -j ACCEPT
    -A FORWARD -i docker0 -o docker0 -j ACCEPT
    -A DOCKER -d 172.17.0.2/32 ! -i docker0 -o docker0 -p tcp -m tcp --dport 8200 -j ACCEPT
    -A DOCKER-ISOLATION -j RETURN
    
    resolv.conf in the container:
    Code:
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    


    I can reach the Duplicati interface from outside the server, so the container is at least accessible from outside the container.
     
  12. AYamshanov

    AYamshanov Regular Pleskian Staff Member

    18
    55%
    Joined:
    Nov 24, 2016
    Messages:
    246
    Likes Received:
    63
    Location:
    Russia
    Hi,

    The Duplicati container does not contain any diagnostic tools like ping, ifconfig, netstat, iptables, etc... Try to research the issue with another container like 'centos' with diagnostic tools:

    I hope this could help get more helpful information about your environment. If in centos-container you have no problem with access to the Internet, I think you need ask for help on a forum of a maintainer of the container (LinuxServer.io).
     
  13. Herman Ronk

    Herman Ronk New Pleskian

    1
    70%
    Joined:
    Oct 21, 2017
    Messages:
    8
    Likes Received:
    0
    Location:
    Netherlands
    Okay.. This is unexpected.. After running the centos container (which had internet access) the Duplicati container started working.. The IPtables output is still the same but something must have changed. For now i'm glad it is working, but if I can find the time I will try to duplicate the situation and find out what changed.

    Thanks for the help.
     
Loading...