How to rename a container?
$ docker rename CONTAINER NEW_NAME
The docker rename command renames a container.
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
90a3993d725a ubuntu "/bin/bash" 4 hours ago Up 4 hours c1
[root@localhost ~]# docker container rename 90a 'TESTNAME'
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
90a3993d725a ubuntu "/bin/bash" 4 hours ago Up 4 hours TESTNAME
No comments:
Post a Comment