Skip to Content
Flask Web开发:基于Python的Web应用开发实战(第2版)
book

Flask Web开发:基于Python的Web应用开发实战(第2版)

by Miguel Grinberg
August 2018
Intermediate to advanced
230 pages
6h 42m
Chinese
O'Reilly Media, Inc. Beijing
Content preview from Flask Web开发:基于Python的Web应用开发实战(第2版)
200
17
本地使用的地址是
http://localhost:8000
,在同一网络中的其他计算机上则使用
http://<ip-
address>:8000
若想停止运行容器,执行 docker stop 命令:
$
docker stop 71357ee776ae
71357ee776ae
stop 命令只停止运行容器,但不从系统中将其删除。如果想删除容器,执行 docker
rm
命令:
$
docker rm 71357ee776ae
71357ee776ae
这两个命令可以合并为 docker rm -f
$
docker rm -f 71357ee776ae
71357ee776ae
17.5.4
 审查运行中的容器
容器出现异常时,可能需要调试。最简单的调试方法是在应用中添加输出日志的语句,然
后使用 docker logs 命令监控运行中的容器。
不过,有些情况下更适合在运行中的容器里打开一个
shell
会话,以进行更深入的分析。这
个任务通过 docker exec 命令操作:
$
docker exec -it 71357ee776ae sh
执行这个命令后,
Docker
将使用 sh
Unix shell
)打开一个
shell
会话,而且不打断容器的
运行。-it 选项把执行这个命令的终端会话与新启动的进程连接起来,让
shell
执行交互式
操作。如果容器中有其他更高级的
shell
,例如
bash
Python
解释器,也可以拿来用。
排查容器问题的常用策略是创建一个特殊的容器,加载一些辅助工具,例如调试器 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python机器学习基础教程

Python机器学习基础教程

Andreas C. Müller, Sarah Guido
Python编程入门与实战

Python编程入门与实战

Posts & Telecom Press, Fabrizio Romano
程序设计导论:Python语言实践

程序设计导论:Python语言实践

罗伯特 塞奇威克, 凯文 韦恩, 罗伯特 唐德罗

Publisher Resources

ISBN: 9787115489456