instruction: Create a comprehensive Dockerfile for networking applications with best practices
output: ```dockerfile
  from the root user to a non-root user with sudo:
  
  # sudo -iu testuser
  $ systemctl --user start docker
  Failed to connect to bus: No such file or directory
  Instead of sudo -iu <USERNAME>, you need to log in using pam_systemd. For example:Log in through the graphic consolessh <USERNAME>@localhostmachinectl shell <USERNAME>@The daemon does not start up automaticallyYou need sudo loginctl enable-linger $(whoami) to enable the daemon to start
  up automatically. See Usage.iptables failed: iptables -t nat -N DOCKER: Fatal: can't open lock file /run/xtables.lock: Permission deniedThis error may happen with an older version of Docker when SELinux is enabled on the host.The issue has been fixed in Docker 20.10.8.
  A known workaround for older version of Docker is to run the following commands to disable SELinux for iptables:
  
  $ sudo dnf install -y policycoreutils-python-utils && sudo semanage permissive -a iptables_t
  docker pull errorsdocker: failed to register layer: Error processing tar file(exit status 1): lchown <FILE>: invalid argumentThis error occurs when the number of available entries in /etc/subuid or
  /etc/subgid is not sufficient. The number of entries required vary across
  images. However, 65,536 entries are sufficient for most images. See
  Prerequisites.docker: failed to register layer: ApplyLayer exit status 1 stdout: stderr: lchown <FILE>: operation not permittedThis error occurs mostly when ~/.local/share/docker is located on NFS.A workaround is to specify non-NFS data-root directory in ~/.config/docker/daemon.json as follows:
  
  {"data-root":"/somewhere-out-of-nfs"}docker run errorsdocker: Error response
  ```