Docker 容器调试

Tags
docker
Created
Jul 12, 2018 1:46 PM

https://medium.com/@betz.mark/ten-tips-for-debugging-docker-containers-cde4da841a1d

1 — View stdout history with the logs command. // --follow, -f

https://docs.docker.com/config/containers/logging/

2 — Stream stdout with the attach command

https://docs.docker.com/engine/reference/commandline/attach/

ctrl + c 将向容器发送 SIGKILL 信号

3 — Execute arbitrary commands with exec.

4 — Override the ENTRYPOINT.

ENTRYPOINT定義在容器中作為 PID 1 運行的進程

5 — Add options with the CMD.

docker run 命令中的映像名稱之後出現的任何內容都會傳遞給容器並被視為 CMD 參數

6 — Pause and unpause a container.

7 — Get process stats with the top command.

8 — View container details with the inspect command.

9 — View image layers with the history command.

10 — Run one process in each container.

SuperMade with Super