I had run a docker command as below docker container run -it --name=webapp ubunt . . .

chakri chakradhar:
I had run a docker command as below
docker container run -it --name=webapp ubuntu
and now i want to set the hostname for the above container.
How can we do that? Can we set while the container is Still running or do we need to create container and pass options like --hostname=“xxxx”?

Ravi Tripathi:
Yes it will work.