docker 常用命令

2021-09-21 06:50:05 字數 1118 閱讀 3838

> docker logs [options] container

options:

--details 顯示更多的資訊

-f, --follow 跟蹤實時日誌

--since string 顯示自某個timestamp之後的日誌,或相對時間,如42m(即42分鐘)

--tail string 從日誌末尾顯示多少行日誌, 預設是all

-t, --timestamps 顯示時間戳

--until string 顯示自某個timestamp之前的日誌,或相對時間,如42m(即42分鐘)

啟動

docker start [options] container [container...]
停止

>docker stop [options] container [container...]
重啟

>docker restart [options] container [container...]
會啟用乙個bash環境

獲取container id 

[root]# docker ps

container id image command created status ports names

84c729a89cd1 amancevice/superset:latest "gunicorn superset.a…" 4 days ago up 4 hours (healthy) 0.0.0.0:8088->8088/tcp superset

進入容器

[root]# docker exec -it -u root 84c729a89cd1 bash

root@84c729a89cd1:/home/superset#

docker常用命令 Docker 常用命令筆錄

格式docker run 選項 映象 命令 引數.示例docker run it rm ubuntu 16.04 bash 示例解釋 it 這是兩個引數,乙個是 i,表示互動式操作,乙個是 t表示終端 rm 這個引數是說容器退出後隨之將其刪除 ubuntu 16.04 這是指用ubuntu 16.0...

docker常用命令

1.刪除已退出的容器 docker rm docker ps a q 2.強制刪除所有容器 docker rm f docker ps a 3.docker attach 進不去的時候可以用docker exec it containerid bin bash docker run it ubunt...

docker常用命令

docker常用命令 1.進入docker容器 sudo docker run it insaneworks centos bin bash 使用ctrl p或者ctrl q可以進入和退出容器 2.拉去乙個映象 docker pull insaneworks centos 檢視所有的映象 docke...