instruction: Create a comprehensive Dockerfile for networking applications with best practices
output: ```dockerfile
  from the host without nsenter-ing into the network namespace.Host network (docker run --net=host) is also namespaced inside RootlessKit.NFS mounts as the docker "data-root" is not supported. This limitation is not specific to rootless mode.Install
  NoteIf the system-wide Docker daemon is already running, consider disabling it:
  
  $ sudo systemctl disable --now docker.service docker.socket
  $ sudo rm /var/run/docker.sock
  Should you choose not to shut down the docker service and socket, you will need to use the --force
  parameter in the next section. There are no known issues, but until you shutdown and disable you're
  still running rootful Docker.
  With packages (RPM/DEB)
  
  Without packagesIf you installed Docker 20.10 or later with
  RPM/DEB packages, you should have dockerd-rootless-setuptool.sh in /usr/bin.Run dockerd-rootless-setuptool.sh install as a non-root user to set up the daemon:
  
  $ dockerd-rootless-setuptool.sh install
  [INFO] Creating /home/testuser/.config/systemd/user/docker.service
  ...
  [INFO] Installed docker.service successfully.
  [INFO] To control docker.service, run: `systemctl --user (start|stop|restart) docker.service`
  [INFO] To run docker.service on system startup, run: `sudo loginctl enable-linger testuser`
  
  [INFO] Make sure the following environment variables are set (or add them to ~/.bashrc):
  
  export PATH=/usr/bin:$PATH
  export DOCKER_HOST=unix:///run/user/1000/docker.sock
  If dockerd-rootless-setuptool.sh is not present, you may need to install the docker-ce-rootless-extras package manually, e.g.,
  
  $ sudo apt-get install -y docker-ce-rootless-extras
  If you do not have permission to run package managers like apt-get and dnf,
  consider using the installation script available at https://get.docker.com/rootless.
  Since static packages are not available for s390x, hence it is not supported for s390x.
  
  $ curl -fsSL https://get.docker.com/rootless | sh
  ...
  [INFO] Creating /home/testuser/.config/systemd/user/docker.service
  ...
  [INFO] Installed docker.service successfully.
  [INFO] To control docker.service, run: `systemctl --user (start|stop|restart) docker.service`
  [INFO] To run docker.service on system startup, run: `sudo loginctl enable-linger testuser`
  
  [INFO] Make sure the following environment variables are set (or add them to ~/.bashrc):
  
  export PATH=/home/testuser/bin:$PATH
  export DOCKER_HOST=unix:///run/user/1000/docker.sock
  The binaries will be installed at ~/bin.See Troubleshooting if you faced an error.UninstallTo remove the systemd service of the Docker daemon, run dockerd-rootless-setuptool.sh uninstall:
  
  $ dockerd-rootless-setuptool.sh uninstall
  + systemctl --user stop docker.service
  + systemctl --user disable docker.service
  Removed /home/testuser/.config/systemd/user/default.target.wants/docker.service.
  [INFO] Uninstalled docker.service
  [INFO] This uninstallation tool does NOT remove Docker binaries and data.
  [INFO] To remove data, run: `/usr/bin/rootlesskit rm -rf /home/testuser/.local/share/docker`
  Unset environment variables PATH and DOCKER_HOST if you have added them to ~/.bashrc.To remove the data directory, run rootlesskit rm -rf ~/.local/share/docker.To remove the binaries, remove docker-ce-rootless-extras package if you installed Docker with package managers.
  If you installed Docker with https://get.docker.com/rootless (Install without packages),
  remove the binary files under ~/bin:
  
  $ cd ~/bin
  $ rm -f containerd containerd-shim containerd-shim-runc-v2 ctr docker docker-init docker-proxy dockerd dockerd-rootless-setuptool.sh dockerd-rootless.sh rootlesskit rootlesskit-docker-proxy runc vpnkit
  UsageDaemon
  With systemd (Highly recommended)
  
  Without systemdThe systemd unit file is installed as ~/.config/systemd/user/docker.service.Use systemctl --user to manage the lifecycle of the daemon:
  
  $ systemctl --user start docker
  To launch the daemon on system startup, enable the systemd service and lingering:
  
  $ systemctl --user enable docker
  $ sudo loginctl enable-linger $(whoami)
  Starting Rootless Docker as a systemd-wide service (/etc/systemd/system/docker.service)
  is not supported, even with the User= directive.To run the daemon directly without systemd, you need to run dockerd-rootless.sh instead of dockerd.The following environment variables must be set:$HOME: the home directory$XDG_RUNTIME_DIR: an ephemeral directory that is only accessible by the expected user, e,g, ~/.docker/run.
  The directory should be removed on every host shutdown.
  The directory can be on tmpfs, however, should not be under /tmp.
  Locating this directory under /tmp might be vulnerable to TOCTOU attack.Remarks about directory paths:The socket path is set to $XDG_RUNTIME_DIR/docker.sock by default.
  $XDG_RUNTIME_DIR is typically set to /run/user/$UID.The data dir is set to ~/.local/share/docker by default.
  The data dir should not be on NFS.The daemon config dir is set to ~/.config/docker by default.
  This directory is different
  ```