Enable User Namespace on RHEL7:
# Notice: Use whatever is the lates version of `/boot/vmlinuz-xxx.el7.x86_64`
sudo grubby --args="user_namespace.enable=1" --update-kernel=/boot/vmlinuz-3.10.0-327.13.1.el7.x86_64
sudo reboot now
Add current user an group ids to subordinate mapping:
echo "$USER:$(id -u $USER):65536" | sudo tee /etc/subuid
echo "$USER:$(id -g $USER):65536" | sudo tee /etc/subgid
Configure Docker daemon to use remapping:
echo '{"userns-remap":"'$USER'"}' | sudo tee /etc/docker/daemon.json
Since docker images takes up a lot of space, we’ll usually move them to a folder on a mounted drive with more room.
E.g. if /data
is the storage drive:
mkdir /data/docker
Add an entry in /etc/docker/daemon.json:
"graph":"/data/docker"