sudo docker stop CONTAINER_NAME
sudo service docker stop

Edit config file (JSON) [You should make backup first]

/var/lib/docker/containers/CONTAINER_ID/config.json

Replace “Hostname”:“WHATEVER”

with “Hostname”:“NEW_HOSTNAME”

sudo service docker start
sudo docker start CONTAINER_NAME