LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-10-2022, 06:50 AM   #1
alexanderzhirov
LQ Newbie
 
Registered: May 2022
Distribution: Solus
Posts: 16

Rep: Reputation: 0
Question Docker is no connection until docker.socket restarts


I made an assembly based on Thinstation. Added package docker. I run the distribution, everything loads without problems. Docker starts after downloading the distribution. I download nginx:alpine and run it with port 80 forwarding. The container starts, there are no problems:
Code:
ts_0800273e9027:~# docker run --restart always --name mynginx -p 80:80 -d nginx:alpine
4fc242d58285: Loading layer [==================================================>]  5.855MB/5.855MB
4721bfafc708: Loading layer [==================================================>]  19.05MB/19.05MB
45b275e8a06d: Loading layer [==================================================>]  3.072kB/3.072kB
a43749efe4ec: Loading layer [==================================================>]  4.096kB/4.096kB
d6dd885da0bb: Loading layer [==================================================>]  3.584kB/3.584kB
c0e7c94aefd8: Loading layer [==================================================>]  7.168kB/7.168kB
Loaded image: nginx:alpine
a22e21817fbd4040e6cbf0d590180117ee88cecb1259080e7af4016b0931b5ce
ts_0800273e9027:~# docker container ls
CONTAINER ID   IMAGE          COMMAND                  CREATED          STATUS         PORTS                               NAMES
a22e21817fbd   nginx:alpine   "/docker-entrypoint.…"   10 seconds ago   Up 9 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp   mynginx
ts_0800273e9027:~# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      3678/docker-proxy
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2321/dropbear
tcp        0      0 :::80                   :::*                    LISTEN      3685/docker-proxy
tcp        0      0 :::22                   :::*                    LISTEN      2321/dropbear
The problem is that I can't connect even locally to the lifted container at the localhost address. Telnet also does not connect to port 80. The remote connection doesn't work either.
If I restart docker.socket - access to the container from the outside is provided, I open the page in the browser.
I have rebuild the assembly with the ability to debug (/usr/bin/docker d --debug -H fd://).
I attach the FULL docker download docker.log.
After downloading the distribution, I rebooted docker.socket and unloaded the log with debugging information. In the log I saw the difference between automatic loading of Docker when downloading the distribution and after restarting the docker.socket service. There you can see that after restarting docker.socket, new iptables rules are prescribed, which were not prescribed at the initial boot. After that, the service became available from the outside. Here is a comparison of the two logs.
I can't understand why RESTARTING the service causes adding new iptables rules. Why doesn't this work on initial boot?
I also provide an infographic of the distribution download.
I also attach the full distribution startup log.
Attached Files
File Type: log docker.log (131.8 KB, 12 views)
File Type: log load_os.log (83.5 KB, 21 views)
 
  


Reply

Tags
docker, iptables, service, socket, systemd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify UDP receive socket buffer size for an open socket (not at system level, but socket level) barz_83_LQ Linux - Networking 2 11-27-2017 07:56 PM
Connecting client socket to server socket only once in socket programming srinietrx Programming 5 08-20-2017 11:53 AM
Wireless connection restarts periodically rengo.Java Linux - Wireless Networking 3 02-04-2008 05:30 AM
Computer restarts after syslogd restarts birdseye Linux - General 2 03-05-2006 04:27 AM
connection between java socket and unix socket sathishkumar Programming 1 01-10-2006 03:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration