Followed "quick start" but http "whoami" returns 404, what is wrong ? [help needed] [in progress]

Hi there,
I'm trying to get discourse and mattermost to run behind traefik.
It all runs on digitalocean droplet using Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-66-generic x86_64) as OS. Discourse was running fine as a standalone container. I can reach the traefik dashboard easily now but that's it.
I'm not even getting whoami running as described in Quick Start despite the fact that the dashboard says all alright but the healthcheck tells a different story

root@Ubuntu18:~# docker exec -it traefik traefik healthcheck --ping
INFO[0000] Configuration loaded from flags.
Bad healthcheck status: 404 Not Found

I found a discussion on this result in Strange healthcheck behaviour but I still don't get it.

When I do curl -v -H Host:whoami.docker.localhost http://127.0.0.1 I get 404. When I repalce the loopback address by the local IP of the container I get the response as shown in Quick Start.

curl -v -H Host:whoami.docker.localhost http://127.0.0.1
* Rebuilt URL to: http://127.0.0.1/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host:whoami.docker.localhost
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Mon, 30 Dec 2019 13:15:19 GMT
< Content-Length: 19
<
404 page not found
* Connection #0 to host 127.0.0.1 left intact
access.log
172.20.0.1 - - [31/Dec/2019:13:34:26 +0000] "GET / HTTP/1.1" 404 19 "-" "-" 1 - - 0ms
172.20.0.1 - - [31/Dec/2019:13:34:46 +0000] "GET / HTTP/1.1" 404 19 "-" "-" 2 - - 0ms
172.20.0.1 - - [31/Dec/2019:13:34:49 +0000] "GET / HTTP/1.1" 404 19 "-" "-" 3 - - 0ms
172.20.0.1 - - [31/Dec/2019:13:35:34 +0000] "GET / HTTP/1.1" 404 19 "-" "-" 4 - - 0ms
172.20.0.1 - - [31/Dec/2019:13:35:35 +0000] "GET / HTTP/1.1" 404 19 "-" "-" 5 - - 0ms
172.20.0.1 - - [31/Dec/2019:13:35:36 +0000] "GET / HTTP/1.1" 404 19 "-" "-" 6 - - 0ms
curl -v -H Host:whoami.docker.localhost http://172.20.0.3
* Rebuilt URL to: http://172.20.0.3/
*   Trying 172.20.0.3...
* TCP_NODELAY set
* Connected to 172.20.0.3 (172.20.0.3) port 80 (#0)
> GET / HTTP/1.1
> Host:whoami.docker.localhost
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Mon, 30 Dec 2019 11:22:42 GMT
< Content-Length: 168
< Content-Type: text/plain; charset=utf-8
<
Hostname: e3c222e6993f
IP: 127.0.0.1
IP: 172.20.0.3
RemoteAddr: 172.20.0.1:58072
GET / HTTP/1.1
Host: whoami.docker.localhost
User-Agent: curl/7.58.0
Accept: */*

I have been sitting on this problem for days now without any progress. I have to say that I spend some days getting docker's logs output to pretty-print, which will be shared here too, hopefully, this makes the life of others easier.
So may you support me a bit in regard to the output of the networking tools as I cannot make head or tail of all of them.

logs, config-files content and traefik dashbaord

  1. basics

    CLI: traefik version
    root@Ubuntu18:/var/traefik# docker exec -t traefik traefik version
    Version:      2.0.7
    Codename:     montdor
    Go version:   go1.13.5
    Built:        2019-12-09T17:51:21Z
    OS/Arch:      linux/amd64
    
    docker-compose.yml
    version: "3.7"
    
    services:
      traefik-reverse-proxy:   
        # The official v2.0 Traefik docker image
        image: traefik:v2.0
        container_name: "traefik"       
        command:
          # --providers.docker  : tells Traefik to listen to docker 
          # --log.level=DEBUG : set debug level 
          # --api : Enable api/dashboard. (Default: false) / (set the docker endpoint to speak to docker's API)
          # --api.dashboard : Activate dashboard. (Default: true)
          # --api.insecure=true Enables the web UI / Traefik will listen on port 8080 by default for API request. / Activate API directly on the entryPoint named traefik. (Default: false) --> port '8080'v= entryPoint 'traefik', overrides --api
          # --api.debug=true Enable additional endpoints for debugging and profiling. (Default: false)
          --api=true
          --api.dashboard
          --api.insecure=true 
          --api.debug=true
          --providers.docker      
          --log.level=DEBUG    
          --accesslog=true    
          --accesslog.filepath=/var/traefik/access.log    
          #--entryPoints.myweb.address=:80    
          #--providers.docker.endpoint=unix:///var/run/docker.sock    
        ports:
          # The HTTP port
          - "80:80"
          # The Web UI (enabled by --api.insecure=true)
          - "8080:8080"
        volumes:
          # So that Traefik can listen to the Docker events
          - /var/run/docker.sock:/var/run/docker.sock
          - ./log:/var/traefik
        networks:
          - traefik
    
       #Tiny Go webserver that prints os information and HTTP request to output
      whoami:
        image: "containous/whoami"
        container_name: "whoami"
        labels:
          #- "traefik.enable=true"
          #- "traefik.docker.network=bridge_proxy_traefikv2"
          - "traefik.http.routers.whoami.rule=Host(`whoami.fairbnb.community`)"
          #- "traefik.http.routers.whoami.entrypoints=myweb"
          #- "traefik.http.services.whoami.loadBalancer.server.port=80"
        networks:
          - traefik
    
    
    networks:
      traefik:
        external:
          name: bridge_proxy_traefikv2
    
    API/rawdata - formatted
    {
      "routers":
      {  
        "traefik-reverse-proxy-traefik@docker":
        {
          "service":"traefik-reverse-proxy-traefik","rule":"Host(`traefik-reverse-proxy-traefik`)",
       	  "status":"enabled","using":["http","traefik"]
        }
        ,"whoami@docker":
        { 
          "service":"whoami-traefik","rule":"Host(`whoami.fairbnb.community`)",
    	  "status":"enabled","using":["http","traefik"]
        }
      },
      "services":
      {
        "traefik-reverse-proxy-traefik@docker":
    	{
    	  "loadBalancer":
    	  {
    	    "servers":[
    		{
    		  "url":"http://172.20.0.4:80"
    		}],
    	    "passHostHeader":true
    	  },
          "status":"enabled","usedBy":["traefik-reverse-proxy-traefik@docker"],
    	  "serverStatus":
    	  {
    	    "http://172.20.0.4:80":"UP"
    	  }
    	},
    	"whoami-traefik@docker":
    	{
    	  "loadBalancer":
    	  {
    	    "servers":[
    		{
    		  "url":"http://172.20.0.3:80"
    		}],
    		"passHostHeader":true
    	  },
          "status":"enabled","usedBy":["whoami@docker"],
    	  "serverStatus":
    	  {
    		"http://172.20.0.3:80":"UP"
    	  }
    	}
      }
    }
    
    docker lables - image versions of traefik and whoami etc.
    root@Ubuntu18:/var/traefik# docker ps --no-trunc  --format "table {{.Names}}::{{.Command}}::{{.Ports}}::{{.Networks}}::{{.Labels}}" | awk -F:: -f docker_ps-pretty-print.awk
    NAMES          | COMMAND                                      | PORTS                  | NETWORKS               | LABELS
    whoami         | /whoami                                      | 80/tcp                 | bridge_proxy_traefikv2 | com.docker.compose.config-hash=04d3ea1924e36df000380782ee3ef53bc6ba4ea3f4fd64399471c7c289a116d0
                   |                                              |                        |                        | com.docker.compose.container-number=1
                   |                                              |                        |                        | com.docker.compose.oneoff=False
                   |                                              |                        |                        | com.docker.compose.project=traefik
                   |                                              |                        |                        | com.docker.compose.service=whoami
                   |                                              |                        |                        | com.docker.compose.version=1.24.1
                   |                                              |                        |                        | traefik.http.routers.whoami.rule=Host(`whoami.fairbnb.community`)
    traefik        | --accesslog.filepath=/var/traefik/access.log | 0.0.0.0:80->80/tcp     | bridge_proxy_traefikv2 | com.docker.compose.config-hash=c8103750c5e975be3a182063d6ecc48a3f7590d5fa3ed5730c784dc2eff23eeb
                   | --accesslog=true                             | 0.0.0.0:8080->8080/tcp |                        | com.docker.compose.container-number=1
                   | --api.dashboard                              |                        |                        | com.docker.compose.oneoff=False
                   | --api.debug=true                             |                        |                        | com.docker.compose.project=traefik
                   | --api.insecure=true                          |                        |                        | com.docker.compose.service=traefik-reverse-proxy
                   | --api=true                                   |                        |                        | com.docker.compose.version=1.24.1
                   | --log.level=DEBUG                            |                        |                        | org.opencontainers.image.description=A modern reverse-proxy
                   | --providers.docker                           |                        |                        | org.opencontainers.image.documentation=https://docs.traefik.io
                   | /entrypoint.sh                               |                        |                        | org.opencontainers.image.title=Traefik
                   |                                              |                        |                        | org.opencontainers.image.url=https://traefik.io
                   |                                              |                        |                        | org.opencontainers.image.vendor=Containous
                   |                                              |                        |                        | org.opencontainers.image.version=v2.0.7
    
    
  2. log entries

    log etnries of the traefik docker | docker logs --details --tail all traefik
    root@Ubuntu18:/var/traefik# docker logs --details  --tail all  traefik | awk '{print $1 "\t" $2  "\t" substr($0, length($1) + length($2) + 4  ) }'
    time="2019-12-31T17:23:49Z"     level=info      msg="Configuration loaded from flags."
    time="2019-12-31T17:23:49Z"     level=info      msg="Traefik version 2.0.7 built on 2019-12-09T17:51:21Z"
    time="2019-12-31T17:23:49Z"     level=debug     msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"http\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{}},\"traefik\":{\"address\":\":8080\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":10000000000},\"respondingTimeouts\":{\"idleTimeout\":180000000000}},\"forwardedHeaders\":{}}},\"providers\":{\"providersThrottleDuration\":2000000000,\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"swarmModeRefreshSeconds\":15000000000}},\"api\":{\"insecure\":true,\"dashboard\":true,\"debug\":true},\"log\":{\"level\":\"DEBUG\",\"format\":\"common\"},\"accessLog\":{\"filePath\":\"/var/traefik/access.log\",\"format\":\"common\",\"filters\":{},\"fields\":{\"defaultMode\":\"keep\",\"headers\":{\"defaultMode\":\"drop\"}}}}"
    time="2019-12-31T17:23:49Z"     level=info      msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://docs.traefik.io/v2.0/contributing/data-collection/\n"
    time="2019-12-31T17:23:49Z"     level=debug     msg="No default certificate, generating one"
    time="2019-12-31T17:23:49Z"     level=info      msg="Starting provider aggregator.ProviderAggregator {}"
    time="2019-12-31T17:23:49Z"     level=debug     msg="Start TCP Server" entryPointName=http
    time="2019-12-31T17:23:49Z"     level=debug     msg="Start TCP Server" entryPointName=traefik
    time="2019-12-31T17:23:49Z"     level=info      msg="Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"exposedByDefault\":true,\"swarmModeRefreshSeconds\":15000000000}"
    time="2019-12-31T17:23:49Z"     level=debug     msg="Provider connection established with docker 19.03.5 (API 1.40)" providerName=docker
    time="2019-12-31T17:23:49Z"     level=error     msg="port is missing" providerName=docker container=discourse-main-90c80be9cb355d83097c34c033bb39c8dd1614cb3673746a8ad626464099b03a
    time="2019-12-31T17:23:49Z"     level=debug     msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"traefik-reverse-proxy-traefik\":{\"service\":\"traefik-reverse-proxy-traefik\",\"rule\":\"Host(`traefik-reverse-proxy-traefik`)\"},\"whoami\":{\"service\":\"whoami-traefik\",\"rule\":\"Host(`whoami.fairbnb.community`)\"}},\"services\":{\"traefik-reverse-proxy-traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.20.0.3:80\"}],\"passHostHeader\":true}},\"whoami-traefik\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://172.20.0.4:80\"}],\"passHostHeader\":true}}}},\"tcp\":{}}" providerName=docker
    time="2019-12-31T17:23:49Z"     level=debug     msg="No entryPoint defined for this router, using the default one(s) instead: [http traefik]" routerName=traefik-reverse-proxy-traefik@docker
    time="2019-12-31T17:23:49Z"     level=debug     msg="No entryPoint defined for this router, using the default one(s) instead: [http traefik]" routerName=whoami@docker
    time="2019-12-31T17:23:49Z"     level=debug     msg="Creating middleware" middlewareName=pipelining middlewareType=Pipelining routerName=traefik-reverse-proxy-traefik@docker entryPointName=http serviceName=traefik-reverse-proxy-traefik
    time="2019-12-31T17:23:49Z"     level=debug     msg="Creating load-balancer" entryPointName=http serviceName=traefik-reverse-proxy-traefik routerName=traefik-reverse-proxy-traefik@docker
    time="2019-12-31T17:23:49Z"     level=debug     msg="Creating server 0 http://172.20.0.3:80" serverName=0 routerName=traefik-reverse-proxy-traefik@docker entryPointName=http serviceName=traefik-reverse-proxy-traefik
    time="2019-12-31T17:23:49Z"     level=debug     msg="Added outgoing tracing middleware traefik-reverse-proxy-traefik" middlewareName=tracing middlewareType=TracingForwarder entryPointName=http routerName=traefik-reverse-proxy-traefik@docker
    time="2019-12-31T17:23:49Z"     level=debug     msg="Creating middleware" middlewareType=Pipelining entryPointName=http routerName=whoami@docker serviceName=whoami-traefik middlewareName=pipelining
    time="2019-12-31T17:23:49Z"     level=debug     msg="Creating load-balancer" serviceName=whoami-traefik entryPointName=http routerName=whoami@docker
    time="2019-12-31T17:23:49Z"     level=debug     msg="Creating server 0 http://172.20.0.4:80" serviceName=whoami-traefik entryPointName=http routerName=whoami@docker serverName=0
    time="2019-12-31T17:23:49Z"     level=debug     msg="Added outgoing tracing middleware whoami-traefik" entryPointName=http middlewareName=tracing middlewareType=TracingForwarder routerName=whoami@docker
    time="2019-12-31T17:23:49Z"     level=debug     msg="Creating middleware" entryPointName=http middlewareName=traefik-internal-recovery middlewareType=Recovery
    time="2019-12-31T17:23:49Z"     level=debug     msg="Creating middleware" entryPointName=traefik middlewareName=traefik-internal-recovery middlewareType=Recovery
    time="2019-12-31T17:23:49Z"     level=debug     msg="No default certificate, generating one"
    
    log entries of the whoami | docker logs --details --tail all whoami
    root@Ubuntu18:/var/traefik# docker logs --details  --tail all  whoami
     Starting up on port 80
    
  3. Dashboard

    traefik dashboard

    traefik dashboard - HTTP Routers - whoami

    traefik dashboard - HTTP Routers - traefik

    traefik dashboard - HTTP Services - whoami

    traefik dashboard - HTTP Services - traefik

host and container settings:

  1. NETWORK INTERFACES

    besides the terminal welcome message, I use the tools described in Linux Show / Display Available Network Interfaces - nixCraft or their successor, as described in Deprecated Linux networking commands and their replacements | Doug Vitale Tech Blog.
    The target is to get the full route of each container route based on networking - What is the relation between docker0 and eth0? - Stack Overflow.
    My understanding is:

    1. each container has a physical network card for each network connection ethX.
      In case the container is connected to two networks, there is eth0 and eth1.
      (there is edge bridge/switch for each interface each)
    2. there is virtual ethernet card vethX for each incoming connection from a container to a docker network.
      If there are two containers and both are connected to two bridge networks there would be veth0, veth1, veth2, veth3.
    3. each container and the host have its own network namespace.
    4. each docker network has its own virtual switch, the default one is docker0

    combining these points yields:

    container1:eth0@namespace ns_c1 <- veth0pair  -> veth0:switch0@namespace ns_host
    container1:eth1@namespace ns_c1 <- veth1pair  -> veth1:switch1@namespace ns_host
    
    container2:eth0@namespace ns_c2 <- veth2pair  -> veth2:switch0@namespace ns_host
    container2:eth1@namespace ns_c2 <- veth3pair  -> veth3:switch1@namespace ns_host
    
    My assumption is based on
    1. What is the relation between docker0 and eth0? - Stack Overflow.
    2. Docker Namespace Container Networking Tutorial | Platform9
    3. Play With Container Network Interface | ArthurChiao's Blog
    4. Docker Bridge Networking Deep Dive - Peng Xiao - Medium
    5. Understanding the Docker Internals - Nitin AGARWAL - Medium
    6. Docker Internals -- Docker Saigon
    7. Relationship between interface "vethxxxxx" and container? - Open Source Projects / DockerEngine - Docker Forums
    8. Step-by-Step Guide: Establishing Container Networking - DZone Cloud
    9. Docker Networking with Linux www.i3s.unice.fr › ~urvoy › docs › VICC › 3_vicc

    The terminal welcome message shows a bare minimum of information what may helps

    terminal welcome message:
    Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-66-generic x86_64)
    
     * Documentation:  https://help.ubuntu.com
     * Management:     https://landscape.canonical.com
     * Support:        https://ubuntu.com/advantage
    
      System information as of Mon Dec 30 11:07:19 UTC 2019
    
      System load:                    0.0
      Usage of /:                     45.4% of 24.06GB
      Memory usage:                   56%
      Swap usage:                     20%
      Processes:                      131
      Users logged in:                1
      IP address for eth0:            157.245.67.230
      IP address for docker0:         172.17.0.1
      IP address for br-1978b6c75b4c: 172.18.0.1
      IP address for br-bb2fe97e47e9: 172.20.0.1
    

    Whereby I understand, that eht0 is the droplet network interface card and docker0 is docker's virutal switch for its default network bridge as described in Customize the docker0 bridge. The br-... are the virtual switches of the other default networks and my user-defined bridge network(s), as described in Bridge network tutorial.
    This is verified running docker network ls.

    "docker network ls" output:
    root@Ubuntu18:/var/traefik# docker network ls
    NETWORK ID          NAME                     DRIVER              SCOPE
    2bde0d1d4f8b        bridge                   bridge              local
    bb2fe97e47e9        bridge_proxy_traefikv2   bridge              local
    5d99fd161697        host                     host                local
    6e391c8d1d9e        none                     null                local
    

    In order to make the set it compete the output of ifconfig -a below

    "ifconfig -a" output:
    root@Ubuntu18:/var/traefik# ifconfig -a
    br-1978b6c75b4c: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
            inet6 fe80::42:84ff:feeb:b763  prefixlen 64  scopeid 0x20<link>
            ether 02:42:84:eb:b7:63  txqueuelen 0  (Ethernet)
            RX packets 92202  bytes 11582870 (11.5 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 44964  bytes 6755184 (6.7 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    br-bb2fe97e47e9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 172.20.0.1  netmask 255.255.0.0  broadcast 172.20.255.255
            inet6 fe80::42:f2ff:fe74:a12  prefixlen 64  scopeid 0x20<link>
            ether 02:42:f2:74:0a:12  txqueuelen 0  (Ethernet)
            RX packets 68826  bytes 26062100 (26.0 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 106351  bytes 27308279 (27.3 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
            inet6 fe80::42:5fff:feb4:57ff  prefixlen 64  scopeid 0x20<link>
            ether 02:42:5f:b4:57:ff  txqueuelen 0  (Ethernet)
            RX packets 165166  bytes 45682665 (45.6 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 267180  bytes 1492545842 (1.4 GB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 157.245.67.230  netmask 255.255.240.0  broadcast 157.245.79.255
            inet6 fe80::473:72ff:fe0c:30df  prefixlen 64  scopeid 0x20<link>
            ether 06:73:72:0c:30:df  txqueuelen 1000  (Ethernet)
            RX packets 2880178  bytes 5261342242 (5.2 GB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 2300961  bytes 532480689 (532.4 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 106366  bytes 9418803 (9.4 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 106366  bytes 9418803 (9.4 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    veth67562bb: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet6 fe80::c0ef:a9ff:feff:731a  prefixlen 64  scopeid 0x20<link>
            ether c2:ef:a9:ff:73:1a  txqueuelen 0  (Ethernet)
            RX packets 16  bytes 1732 (1.7 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 47  bytes 3498 (3.4 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    vetha074a47: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet6 fe80::4427:65ff:fe41:a4a2  prefixlen 64  scopeid 0x20<link>
            ether 46:27:65:41:a4:a2  txqueuelen 0  (Ethernet)
            RX packets 36  bytes 4054 (4.0 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 73  bytes 13713 (13.7 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    vethf58fd37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet6 fe80::5cd2:80ff:fe48:3e89  prefixlen 64  scopeid 0x20<link>
            ether 5e:d2:80:48:3e:89  txqueuelen 0  (Ethernet)
            RX packets 2404  bytes 1076308 (1.0 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 4336  bytes 1133910 (1.1 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

    for information:

    same again in short showing only the id's, using netstat -i

    "netstat -i" output:
    Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
    br-1978b  1500    92202      0      0 0         44964      0      0      0 BMU
    br-bb2fe  1500    69835      0      0 0        108256      0      0      0 BMRU
    docker0   1500   165166      0      0 0        267180      0      0      0 BMU
    eth0      1500  2884219      0      0 0       2303639      0      0      0 BMRU
    lo       65536   106442      0      0 0        106442      0      0      0 LRU
    veth6756  1500       16      0      0 0            49      0      0      0 BMRU
    vetha074  1500       36      0      0 0            74      0      0      0 BMRU
    vethf58f  1500     3413      0      0 0          6241      0      0      0 BMRU
    

    The last two commands list also the virtual ethernet cards which are the host partner for each veth pair for each container as nicely displayed on Docker Namespace Container Networking Tutorial | Platform9 repeated for each virtual switch of the docker network as shown on Play With Container Network Interface | ArthurChiao's Blog

    pictures


    but none of the tools allow to put together
    container/interface/veth pair/host network / host network switch.
    This well discussed in Relationship between interface "vethxxxxx" and container? - Open Source Projects / DockerEngine - Docker Forums wherein micahculpepper create a little helper script:

    but is has to be translated into the Linux world first otherwise you get /bin/bash^M: bad interpreter as well descripbed in command line - Not able to execute a .sh file: /bin/bash^M: bad interpreter - Ask Ubuntu and Bash script and /bin/bash^M: bad interpreter: No such file or directory - Stack Overflow.
    The output gives me some clue but it is distorted in Linux so either someone updates the script or you do it as follows:

    1. docker ps --no-trunc --format "table {{.Names}}\t {{.Ports}} \t {{.Networks}} \t {{.ID}}"
NAMES                PORTS                                          NETWORKS                   CONTAINER ID
whoami               80/tcp                                         bridge_proxy_traefikv2     e3c222e6993f59219e96c73741dbbf149a8fbd3ffac454419b60588b690ddd45
traefik              0.0.0.0:80->80/tcp, 0.0.0.0:8080->8080/tcp     bridge_proxy_traefikv2     0f2d3a0baa26dee5868e98e8865b2a1c84562e7e749e74b8270e9a00dfc66735
discourse_main                                                      bridge_proxy_traefikv2     90c80be9cb355d83097c34c033bb39c8dd1614cb3673746a8ad626464099b03a

tools and custom scripts

awk script "docker_ps-pretty-print"
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }

BEGIN \
{	
	myOFS = "|" ; # "::" "\t" "|";
	OFS4csv = ";" ; 
	newOutput[""]="" ;
	columnLength[""] = "" ;
	originalIndex[""] = "" ;
	lastRowOfPreviousLine = 0 ;
	FileNameCSV = "docker_ps-pretty-print.csv" ;
	
	 # read first line earliers as this is the header what shall be processed in the BEGIN section
	getline;
	lastRowOfPreviousLine = NR
	originalIndex[1]  = NR 
	
	#  build header line 
	for( c = 1 ; c <= NF ; c++)
	{
		 # determine the field length
		if( columnLength[c]  < length( $c ) ) columnLength[c]  = length( $c )
		 # first field without delimiter
		if( c == 1 )
		{
			line=$c
			newOutput[c lastRowOfPreviousLine] = $c;
		}
		if( c != 1 )
		{
			line=line myOFS $c
			newOutput[c lastRowOfPreviousLine] = $c;
		}		
	}
}

{
	max_n = 1;
	fields2rows[""]="";
	fields2rowsColumn[""]="";
	fields2rowsColumnSorted[""]="";
	line="";
	itemsMoved=1;
	
	 # iterarte through all fields of the current input line
	for( c = 1 ; c <= NF ; c++)
	{
		 # current field content, stored in array, one array item represents one field per current input line
		arrayFieldsPerLine[c] = $c; 	
		
		 # getting array with field values 
		StringBeingSought = arrayFieldsPerLine[c]; 
		 # values in the field COMMAND are delimited by space not comma. The line begins and ends with quotes, which have to be removed 
		if ( substr( StringBeingSought, 1 , 1 ) == "\""  && substr( StringBeingSought, length(StringBeingSought) ) == "\""  ) 
		{
			String2Search = " ";
			gsub( "\"" , "" , StringBeingSought );
		}
		else 
		{
			String2Search = ",";
		}
		fields = split(StringBeingSought, arrayFieldsPerLineValues, String2Search);

		 # setting max field number, if there more values in this field than in previous fields, variable is set to the current count. At the end max_n will represent the count of values of the field with the most values
		if( max_n < fields ) max_n = fields;
		
		 # iterate through all values in a field until the current maximum count. 
		for ( row = 1 ; row <= max_n ; row++)
		{
			arrayFieldsPerLineValues[row] = trim(arrayFieldsPerLineValues[row]) ;
			 # set lenght of column what is the lenght of the longest value in column
			if( columnLength[c]  < length( arrayFieldsPerLineValues[row] ) ) columnLength[c]  = length( arrayFieldsPerLineValues[row] ) ;
			
			 # building the array adding value per value by loop by loop 
			fields2rows[c row] = arrayFieldsPerLineValues[row]
			
		}	
		 # sort each column alphabetically of current input line when end of line is reached 
		if( c == NF) 
		{
			for( c = 1 ; c <= NF ; c++)
			{
				 # creating an array containing the values of a column only
				for ( row = 1 ; row <= max_n ; row++)
				{
					fields2rowsColumn[c row]=fields2rows[c row]
				}		
				 # sorting the array and write the sorted output in a new array, they are sorted ascending but that cause that empty values will listed first
				n=asort(fields2rowsColumn, fields2rowsColumnSorted, "@val_str_asc")
				
				# delete upstream items ( for (i=n; i>=1; i--); delete fields2rowsColumnSorted[i];  ) is not working so existing values will be moved to beginning 
				for (i=1; i<=n; i++) 
				{
					if( fields2rowsColumnSorted[i] != "" ) 
					{						
						 # do it only when the first item is not empty, otherwise there are not any empty values  
						if ( itemsMoved != i )
						{
							fields2rowsColumnSorted[itemsMoved] = fields2rowsColumnSorted[i];
							fields2rowsColumnSorted[i] = "";
						}
						itemsMoved++;
					}
				}
				itemsMoved = 1;
				
				 # write sorted column in output storage 
				for (i=1; i<=n; i++) 
				{
						fields2rows[c i] = fields2rowsColumnSorted[i] ;
				}
				
				 # prepare for next input line
				delete fields2rowsColumn;
				delete fields2rowsColumnSorted;
			}
	
			 # building  output array
			for ( row = 1 ; row <= max_n ; row++)
			{	
				 # continue after the last entry of the previous input line 
				finalRow = lastRowOfPreviousLine + row
				for( c = 1 ; c <= NF ; c++)
				{
					newOutput[c finalRow] = fields2rows[c row];
					originalIndex[finalRow] = NR ;
				}
				
			}
			
			# prepare for next input line
			delete fields2rows;
			lastRowOfPreviousLine = lastRowOfPreviousLine + max_n;
		}
		
	}
}

END \
{
	for ( row = 1 ; row <= lastRowOfPreviousLine ; row++)
	{	
		i = originalIndex[row]
		 # reset all modifier, foreground and background attributes
		printf "\033[0m" ; 
		 # the first and then every second record is printed with dark grey background
		if ( i%2 == 0 ) printf "\033[1;39;100m" ;
		 # the header is printed with light grey background
		if( row == 1) printf "\033[1;42;47m" ;
		
		
		for( c = 1 ; c <= NF ; c++)
		{
			if( c == 1 ) 
			{
				printf "%-*s", columnLength[c]+1, newOutput[c row] ;
				printf newOutput[c row] >> FileNameCSV ;
			}
			
			if( c != 1 ) 
			{
				printf myOFS " "
				printf "%-*s", columnLength[c]+1, newOutput[c row] ;
				printf OFS4csv >> FileNameCSV ;
				printf newOutput[c row] >> FileNameCSV ;
			}
			if( c == NF)
			{
				print "\r" ;
				print "\r" >> FileNameCSV ;
			}
		}
		
	}
	printf "\033[0m" ; 
	printf "\n" ;
}
where I found help

my main source is Awk - A Tutorial and Introduction - by Bruce Barnett, which is an excellent read by the way. Besides explaining awk fabulously, it dug out long-forgotten things like Escape Sequences or Format Specifiers and so on but it could not reply to all questions, so I found additional help for:

  1. some more details on awk, in general, explained in Getting Started with awk - Effective awk Programming, 4th Edition [Book] explaining how to make use of the chmod utility what makes the ‘ #! ’ script mechanism work.
    Moreover, you find very comphre3bsive information in The GNU Awk User’s Guide.

  2. more details on how to Pass parameter to an awk script file

  3. reading the first line in the BEGIN section, to build a header line, without the need to check if the current read line is line #1. It feels better to build the header in BEGIN as it happens only once at the very beginning.
    That can be realised using GETLINE, what is explained in awk: print first line of file before reading lines | stackoverflow.

  4. how to delete arrays Delete (The GNU Awk User’s Guide) although I didn't achieve to delete single array items

  5. full explanation on all printf format identifiers.

  6. trying to get columns sorted, e.g the container labels per container otherwise it is not easy to read. I hoped to get along with Sort one column only, keeping remaining columns untouched using sort but at the end, I used asort as explained in Array Sorting Functions (The GNU Awk User’s Guide), getting additional help in Sort an associative array in awk, what led me to the Controlling Scanning (The GNU Awk User’s Guide).

  7. How can I trim white space from a variable in awk? with additional support from How to remove leading and trailing whitespaces?

  8. list the missing escape sequences, which are discussed in Need help understanding how \n, \b, and \r will render printf output, as I faced How to replace double quotes by escaped double quote in awk?.

  9. how to make the output colourful reading through

    1. Using colors with printf
    2. Terminal colour highlights
    3. Changing colour of text and background of terminal?
  1. docker ps --no-trunc pretty print:

    Summary
    CONTAINER ID                                                     | NAMES          | COMMAND                                      | PORTS                  | NETWORKS               | LABELS                                                  
    e3c222e6993f59219e96c73741dbbf149a8fbd3ffac454419b60588b690ddd45 | whoami         | /whoami                                      | 80/tcp                 | bridge_proxy_traefikv2 | com.docker.compose.config-hash=04d3ea1924e36df000380782ee3ef53bc6ba4ea3f4fd64399471c7c289a116d0
                                                                     |                |                                              |                        |                        | com.docker.compose.container-number=1                   
                                                                     |                |                                              |                        |                        | com.docker.compose.oneoff=False                         
                                                                     |                |                                              |                        |                        | com.docker.compose.project=traefik                      
                                                                     |                |                                              |                        |                        | com.docker.compose.service=whoami                       
                                                                     |                |                                              |                        |                        | com.docker.compose.version=1.24.1                       
                                                                     |                |                                              |                        |                        | traefik.http.routers.whoami.rule=Host(`whoami.fairbnb.community`)
    0f2d3a0baa26dee5868e98e8865b2a1c84562e7e749e74b8270e9a00dfc66735 | traefik        | --accesslog.filepath=/var/traefik/access.log | 0.0.0.0:80->80/tcp     | bridge_proxy_traefikv2 | com.docker.compose.config-hash=4317a7ded2dd5f6a2460f5cf5a3319118c96bd784bf1963f14b296c306362121
                                                                     |                | --accesslog=true                             | 0.0.0.0:8080->8080/tcp |                        | com.docker.compose.container-number=1                   
                                                                     |                | --api                                        |                        |                        | com.docker.compose.oneoff=False                         
                                                                     |                | --api.debug                                  |                        |                        | com.docker.compose.project=traefik                      
                                                                     |                | --api.insecure=true                          |                        |                        | com.docker.compose.service=traefik-reverse-proxy        
                                                                     |                | --log.level=DEBUG                            |                        |                        | com.docker.compose.version=1.24.1                       
                                                                     |                | --providers.docker                           |                        |                        | org.opencontainers.image.description=A modern reverse-proxy
                                                                     |                | /entrypoint.sh                               |                        |                        | org.opencontainers.image.documentation=https://docs.traefik.io
                                                                     |                |                                              |                        |                        | org.opencontainers.image.title=Traefik                  
                                                                     |                |                                              |                        |                        | org.opencontainers.image.url=https://traefik.io         
                                                                     |                |                                              |                        |                        | org.opencontainers.image.vendor=Containous              
                                                                     |                |                                              |                        |                        | org.opencontainers.image.version=v2.0.7                 
    90c80be9cb355d83097c34c033bb39c8dd1614cb3673746a8ad626464099b03a | discourse_main | /sbin/boot                                   |                        | bridge_proxy_traefikv2 | app_name=fairbnb_discourse                              
    
    

Questions

  1. bad healthcheck