docker2-容器的使用
Posted wang-mengmeng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker2-容器的使用相关的知识,希望对你有一定的参考价值。
[root@ipha-dev71-1 chenjl]# docker [root@ipha-dev71-1 chenjl]# docker pull training/webapp [root@ipha-dev71-1 chenjl]# docker run -d -P training/webapp python app.py [root@ipha-dev71-1 chenjl]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f48e38ee81a9 training/webapp "python app.py" 15 seconds ago Up 10 seconds 0.0.0.0:32768->5000/tcp sweet_brown [root@ipha-dev71-1 chenjl]# docker run -d -p 5000:5000 training/webapp python app.py 69fbb799c3d5bf4526cbcca9505519ec18c0bdb010301c533c779e47f351e96a [root@ipha-dev71-1 chenjl]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 69fbb799c3d5 training/webapp "python app.py" 3 seconds ago Up 2 seconds 0.0.0.0:5000->5000/tcp magical_khorana f48e38ee81a9 training/webapp "python app.py" 55 minutes ago Up 55 minutes 0.0.0.0:32768->5000/tcp sweet_brown [root@ipha-dev71-1 chenjl]# docker logs -f 69fbb799c3d5 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) ^C [root@ipha-dev71-1 chenjl]# docker top magical_khorana UID PID PPID C STIME TTY TIME CMD root 104711 104694 0 22:53 ? 00:00:00 python app.py [root@ipha-dev71-1 chenjl]# docker inspect magical_khorana [ "Id": "69fbb799c3d5bf4526cbcca9505519ec18c0bdb010301c533c779e47f351e96a", "Created": "2019-09-16T14:53:21.107783511Z", "Path": "python", "Args": [ "app.py" ], "State": "Status": "running", "Running": true, "Paused": false, "Restarting": false, "OOMKilled": false, ... [root@ipha-dev71-1 chenjl]# docker stop magical_khorana magical_khorana [root@ipha-dev71-1 chenjl]# docker ps -l CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 69fbb799c3d5 training/webapp "python app.py" 4 minutes ago Exited (137) 26 seconds ago magical_khorana [root@ipha-dev71-1 chenjl]# docker rm magical_khorana magical_khorana
以上是关于docker2-容器的使用的主要内容,如果未能解决你的问题,请参考以下文章