- 在docker容器中运行一个 Python Flask 应用来运行一个web应用
#载入镜像
[root@localhost ~]# docker pull training/webapp
Using default tag: latest
latest: Pulling from training/webapp
[DEPRECATION NOTICE] registry v2 schema1 support will be removed in an upcoming release. Please contact admins of the docker.io registry NOW to avoid future disruption.
e190868d63f8: Pull complete
909cd34c6fd7: Pull complete
0b9bfabab7c1: Pull complete
a3ed95caeb02: Pull complete
10bbbc0fc0ff: Pull complete
fca59b508e9f: Pull complete
e7ae2541b15b: Pull complete
9dd97ef58ce9: Pull complete
a4c1b0cb7af7: Pull complete
Digest: sha256:06e9c1983bd6d5db5fba376ccd63bfa529e8d02f23d5079b8f74a616308fb11d
Status: Downloaded newer image for training/webapp:latest
docker.io/training/webapp:latest
[root@localhost ~]# docker run -d -P training/webapp python app.py
6eded223c4242208e465da1da1ab382455c4f78c560567c1e068d62a166bfcb2
#参数说明:
-d:让容器在后台运行。
-P:将容器内部使用的网络端口映射到我们使用的主