Not able to attach on user defined bridge attach command

75 views Asked by At

I tried to attach in container. But while i attach it's come out. Here is the network below

NETWORK ID     NAME            DRIVER    SCOPE
7ab1dac4166d   alpine-net      bridge    local

Below are my containers

CONTAINER ID   IMAGE     COMMAND              CREATED          STATUS              PORTS     NAMES
4f98c3758144   httpd     "httpd-foreground"   23 minutes ago   Up 3 seconds        80/tcp    alpine4
a00e9603190e   httpd     "httpd-foreground"   23 minutes ago   Up 23 minutes       80/tcp    alpine3
a02ac156f310   httpd     "httpd-foreground"   23 minutes ago   Up 23 minutes       80/tcp    alpine2
55a0395dc0bc   httpd     "httpd-foreground"   24 minutes ago   Up About a minute   80/tcp    alpine1

I am trying to connect alpine1. But not working. After press ctrl+c container got shutdown.

root@ip-172-31-35-240:~# docker network connect alpine-net 4f98c3758144
Error response from daemon: endpoint with name alpine4 already exists in network alpine-net
root@ip-172-31-35-240:~# docker attach alpine1

^C[Wed Sep 28 17:38:25.604430 2022] [mpm_event:notice] [pid 1:tid 140167697374528] AH00491: caught SIGTERM, shutting down
root@ip-172-31-35-240:~# docker attach alpine1
You cannot attach to a stopped container, start it first
root@ip-172-31-35-240:~# docker attach alpine2

^C[Wed Sep 28 17:47:57.649545 2022] [mpm_event:notice] [pid 1:tid 140336080485696] AH00491: caught SIGTERM, shutting down
root@ip-172-31-35-240:~# docker attach a00e9603190e
^C[Wed Sep 28 17:48:56.424446 2022] [mpm_event:notice] [pid 1:tid 140629127331136] AH00491: caught SIGTERM, shutting down

How to attach it? In default bridge it's working. User defined bridge not working

Try1: I recreated server and I have only one network. Below that I have 2 container in this network. When I try again getting shutdown. If you please help to fix this.

Network List : root@ip-172-31-32-242:~# docker network ls NETWORK ID NAME DRIVER SCOPE 7ee777e7a9d6 bridge bridge local 694493b04e19 gold-net bridge local 75c9930ac3df host host local 6ffae4da13f6 none null local

Listing the containers root@ip-172-31-32-242:~# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0f275cb17da4 httpd "httpd-foreground" 49 seconds ago Up 48 seconds 80/tcp apache4 d3bf64d7f751 httpd "httpd-foreground" About a minute ago Up About a minute 80/tcp apache3 0ddd638f1c92 httpd "httpd-foreground" 2 minutes ago Up 2 minutes 80/tcp apache2 b09daeeb17b8 httpd "httpd-foreground" 2 minutes ago Up 2 minutes 80/tcp apache1

Failure Result: root@ip-172-31-32-242:~# docker container attach apache1 ^C[Thu Sep 29 06:44:56.692274 2022] [mpm_event:notice] [pid 1:tid 140043293744448] AH00491: caught SIGTERM, shutting down root@ip-172-31-32-242:~# root@ip-172-31-32-242:~# root@ip-172-31-32-242:~# root@ip-172-31-32-242:~# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0f275cb17da4 httpd "httpd-foreground" 21 minutes ago Up 21 minutes 80/tcp apache4 d3bf64d7f751 httpd "httpd-foreground" 21 minutes ago Up 21 minutes 80/tcp apache3 0ddd638f1c92 httpd "httpd-foreground" 22 minutes ago Up 22 minutes 80/tcp apache2 b09daeeb17b8 httpd "httpd-foreground" 23 minutes ago Exited (0) 8 minutes ago apache1 root@ip-172-31-32-242:~#

0

There are 0 answers