赞
踩
删除容器,重新新建容器多加一个-p端口映射即可
修改容器配置文件,重启docker服务
[root@redmine-test containers]# docker container run -itd -p80:80 --name nginx --restart always nginx
1599dc63b7e52e419f7cf6566900a522dc4798c9fe223ca81be4d8c7dad118f0
[root@redmine-test containers]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1599dc63b7e5 nginx "/docker-entrypoint.…" 23 seconds ago Up 23 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp nginx
[root@redmine-test containers]# docker info |grep "Docker Root Dir"
Docker Root Dir: /var/lib/docker
[root@redmine-test containers]# cd /var/lib/docker/containers/
[root@redmine-test containers]# ll
1599dc63b7e52e419f7cf6566900a522dc4798c9fe223ca81be4d8c7dad118f0
[root@redmine-test containers]# cd 1599dc63b7e52e419f7cf6566900a522dc4798c9fe223ca81be4d8c7dad118f0/
[root@redmine-test ~]# systemctl stop docker
[root@redmine-test 1599dc63b7e52e419f7cf6566900a522dc4798c9fe223ca81be4d8c7dad118f0]# vim hostconfig.json
[root@redmine-test 1599dc63b7e52e419f7cf6566900a522dc4798c9fe223ca81be4d8c7dad118f0]# vim config.v2.json
[root@redmine-test ~]# systemctl start docker.service
[root@redmine-test ~]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1599dc63b7e5 nginx "/docker-entrypoint.…" 5 minutes ago Up 4 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp nginx
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。