No interface eth0 in container's /sys/class/net/ only vethXXXX

Every docker container on my vserver (from german hoster shows a strange behaviour:
In the container ifconfig shows the expected internal interface eth0. In /sys/class/net/ there is only a virtual interface vethXXXXX.


root@hXXXX:~# docker run -it --rm --entrypoint ls alpine /sys/class/net
bonding_masters  lo               vethab835bd

root@hXXXX:~# docker run -it --rm --entrypoint ifconfig alpine
eth0      Link encap:Ethernet  HWaddr XX:XX::XX:XX:XX
          inet addr:  Bcast:  Mask:
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:90 (90.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:  Mask:
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Reinstalling did not help. OS is Ubuntu 22.04 LTS (Kernel 5.2.0);
Docker Installation from Repo (Install Docker Engine on Ubuntu | Docker Documentation).

My home server shows the expected behaviour:

test@test:~$ sudo docker run -it --rm --entrypoint ls alpine /sys/class/net
eth0  lo

Any ideas?

The kernel seems to be old, but I dont think it should be the reason. You also have a “bonding_masters”. I don’t think you should see that either.

The installation link is correct, but are you sure you have only one Docker installed?
Please, try to run the following commands and share the result:

snap list | grep docker
dpkg -l | grep docker
docker context ls
docker info

Thanks for your answer!
There is only one docker instance installed, but the system is a vserver. As far as I know it’s a Virtuozzo container. So my guess is, that’s the causefor the mislabeling/mapping in /sys/class/net.

Here are the results (snap ist not installed!):

root@XXXX:~# dpkg -l | grep docker
ii  docker-buildx-plugin          0.10.2-1~ubuntu.22.04~jammy                amd64        Docker Buildx cli plugin.
ii  docker-ce                     5:23.0.0-1~ubuntu.22.04~jammy              amd64        Docker: the open-source application container engine
ii  docker-ce-cli                 5:23.0.0-1~ubuntu.22.04~jammy              amd64        Docker CLI: the open-source application container engine
ii  docker-ce-rootless-extras     5:23.0.0-1~ubuntu.22.04~jammy              amd64        Rootless support for Docker.
ii  docker-compose-plugin         2.15.1-1~ubuntu.22.04~jammy                amd64        Docker Compose (V2) plugin for the Docker CLI.
ii  docker-scan-plugin            0.23.0~ubuntu-jammy                        amd64        Docker scan cli plugin.

root@XXXX:~# docker context ls
NAME        DESCRIPTION                               DOCKER ENDPOINT               ERROR
default *   Current DOCKER_HOST based configuration   unix:///var/run/docker.sock

root@XXXX:~# docker info
 Context:    default
 Debug Mode: false
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.15.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan

 Containers: 4
  Running: 4
  Paused: 0
  Stopped: 0
 Images: 8
 Server Version: 23.0.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 1
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 31aa4358a36870b21a992d3ad2bef29e1d693bec
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
   Profile: builtin
 Kernel Version: 5.2.0
 Operating System: Ubuntu 22.04.1 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 8GiB
 ID: c3b8299e-10a5-44f1-b8b0-15a96e737a9a
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
 Live Restore Enabled: false

WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

It could be, but I don’t know why and I can’t test it. If your container works correctly, I wouldn’t worry about that unless something in the container relies on that folder.