How to run docker with user namespace enabled?

As per the documentation, i tried the following command but get error:

sudo docker daemon --userns-remap=default
INFO[0000] previous instance of containerd still alive (2640) 
INFO[0000] User namespaces: ID ranges will be mapped to subuid/subgid ranges of: dockremap:dockremap 
FATA[0000] Error starting daemon: Can't create ID mappings: No subuid ranges found for user "dockremap"

  • Docker Ubuntu Build File Errors
  • cannot ADD file in current directory or in the directory with full path
  • What's causing authentication error when pushing Docker image to Google Container Registry?
  • Docker registry getsockopt: connection refused
  • File storage for Docker Swarm
  • On Windows how the docker host connect to docker containers?
  • Docker ERROR: Container command not found or does not exist when running from Win10
  • Gitlab Runner fails creating android build using the newer yml format
  • Apache config for redirecting traffic to different host and port
  • Can't access mapped port (can't connect from host to sshd running inside docker container)
  • Scaling Docker containers in Rancher with different but persistent volumes
  • Windows authentication of an application hosted in Windows Container
  • One Solution collect form web for “How to run docker with user namespace enabled?”

    I got past the above error by creating /etc/subuid and /etc/subguid with following text dockuser:100000:65536 and then starting docker daemon as docker daemon --userns-remap:dockuser

    But now i get another error related to /dev/mqueue permissions when starting containers. Refer this issue for more details: https://github.com/docker/docker/issues/20798

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.