Docker 命令行的使用

1.Docker 命令列表

[root@host1 ~]# docker
Usage:  docker [OPTIONS] COMMANDA self-sufficient runtime for containersCommon Commands:run         Create and run a new container from an imageexec        Execute a command in a running containerps          List containersbuild       Build an image from a Dockerfilebake        Build from a filepull        Download an image from a registrypush        Upload an image to a registryimages      List imageslogin       Authenticate to a registrylogout      Log out from a registrysearch      Search Docker Hub for imagesversion     Show the Docker version informationinfo        Display system-wide informationManagement Commands:builder     Manage buildsbuildx*     Docker Buildxcompose*    Docker Composecontainer   Manage containerscontext     Manage contextsimage       Manage imagesmanifest    Manage Docker image manifests and manifest listsnetwork     Manage networksplugin      Manage pluginssystem      Manage Dockertrust       Manage trust on Docker imagesvolume      Manage volumesSwarm Commands:swarm       Manage SwarmCommands:attach      Attach local standard input, output, and error streams to a running containercommit      Create a new image from a container's changescp          Copy files/folders between a container and the local filesystemcreate      Create a new containerdiff        Inspect changes to files or directories on a container's filesystemevents      Get real time events from the serverexport      Export a container's filesystem as a tar archivehistory     Show the history of an imageimport      Import the contents from a tarball to create a filesystem imageinspect     Return low-level information on Docker objectskill        Kill one or more running containersload        Load an image from a tar archive or STDINlogs        Fetch the logs of a containerpause       Pause all processes within one or more containersport        List port mappings or a specific mapping for the containerrename      Rename a containerrestart     Restart one or more containersrm          Remove one or more containersrmi         Remove one or more imagessave        Save one or more images to a tar archive (streamed to STDOUT by default)start       Start one or more stopped containersstats       Display a live stream of container(s) resource usage statisticsstop        Stop one or more running containerstag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGEtop         Display the running processes of a containerunpause     Unpause all processes within one or more containersupdate      Update configuration of one or more containerswait        Block until one or more containers stop, then print their exit codesGlobal Options:--config string      Location of client config files (default "/root/.docker")-c, --context string     Name of the context to use to connect to the daemon (overridesDOCKER_HOST env var and default context set with "docker context use")-D, --debug              Enable debug mode-H, --host string        Daemon socket to connect to-l, --log-level string   Set the logging level ("debug", "info", "warn", "error", "fatal")(default "info")--tls                Use TLS; implied by --tlsverify--tlscacert string   Trust certs signed only by this CA (default "/root/.docker/ca.pem")--tlscert string     Path to TLS certificate file (default "/root/.docker/cert.pem")--tlskey string      Path to TLS key file (default "/root/.docker/key.pem")--tlsverify          Use TLS and verify the remote-v, --version            Print version information and quitRun 'docker COMMAND --help' for more information on a command. 
#提示用命令查看某條具體子命令的幫助信息。For more help on how to use Docker, head to https://docs.docker.com/go/guides/

例如,查看 tag 子命令的幫助信息

[root@host1 ~]# docker tag --help
Usage:  docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]Create a tag TARGET_IMAGE that refers to SOURCE_IMAGEAliases:docker image tag, docker tag

2.運行一個容器(以 docker run 命令為例)

[root@host1 ~]# docker run -i -t ubuntu /bin/bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
76249c7cd503: Pull complete 
Digest: sha256:9cbed754112939e914291337b5e554b07ad7c392491dba6daf25eef1332a22e8
Status: Downloaded newer image for ubuntu:latest
root@49e91767b48d:/# ls    #列出當前目錄內容
bin   dev  home  lib64  mnt  proc  run   srv  tmp  var
boot  etc  lib   media  opt  root  sbin  sys  usr
root@49e91767b48d:/# uname -a    #顯示當前操作系統內核信息
Linux 49e91767b48d 5.14.0-611.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 22 16:46:08 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
root@49e91767b48d:/# cat /etc/issue    #查看當前操作系統發行版信息
Ubuntu 24.04.3 LTS \n \lroot@49e91767b48d:/# exit    #結束,只停止不刪除
exit
[root@host1 ~]# docker ps -a    #查看當前容器列表
CONTAINER ID   IMAGE         COMMAND       CREATED              STATUS                      PORTS     NAMES
49e91767b48d   ubuntu        "/bin/bash"   About a minute ago   Exited (0) 21 seconds ago             frosty_lichterman
38b001022f7a   hello-world   "/hello"      29 minutes ago       Exited (0) 29 minutes ago             intelligent_brahmagupta

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/96178.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/96178.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/96178.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Redis Stream:輕量級消息隊列深度解析

📨 Redis Stream:輕量級消息隊列深度解析 文章目錄📨 Redis Stream:輕量級消息隊列深度解析🧠 一、Stream 數據結構解析💡 Stream 核心概念📋 Stream 底層結構? 二、消息生產與消費&#x1f68…

Android studio的adb和終端的adb互相搶占端口

在Android Studio調試時,有時候也需要借助終端的adb命令,他們互相搶占端 口,導致調試麻煩解決如下:① 終端adb的版本是:1.0.39路徑是:/usr/lib/android-sdk/platform-tools/adb② Android Studio使用的adb來源于Androi…

GEO服務商推薦:移山科技以劃時代高精尖技術引領AI搜索優化新紀元

引言:AI搜索生態重塑與GEO優化戰略地位躍升AI技術對信息檢索范式的顛覆GEO優化在企業增長中的核心作用第一章:AI搜索新紀元的企業營銷挑戰與機遇生成式AI成為用戶主要信息入口的行業趨勢企業在AI搜索中的“答案主權”爭奪戰GEO優化服務商的核心能力模型&…

Android SystemServer 系列專題【AttentionManagerService】

AttentionManagerService是framework中用來實現屏幕感知的一個系統級服務,他繼承于systemserver。我們可以通過dumpsys attention來獲取他的一些信息。如下針對屏幕感知的功能的引入來針對這個服務進行一個介紹。1、屏幕感知Settings UI實現屏幕感知的功能在A14上面…

nginx 反向代理使用變量的坑

nginx采用反向代理的時候使用變量的坑 正常情況&#xff1a; location ~ ^/prod-api(?<rest>/.*)?$ {# 假設 $mes_backend 形如: http://127.0.0.1:16889proxy_pass $mes_backend$rest$is_args$args;proxy_http_version 1.1;proxy_set_header Host $host;…

Origin繪制徑向條形圖|科研論文圖表教程

數據排列格式截圖&#xff0c;請查看每張圖↘右下角水印 目錄 數據排列格式截圖&#xff0c;請查看每張圖↘右下角水印 本 期 導 讀 No.1 理解圖形 1 定義 2 特點 3 適用場景 No.2 畫圖教程 1 導入數據&#xff0c;繪制圖形 2 設置繪圖細節 本 期 導 讀 徑…

MySQL InnoDB 的 MVCC 機制

前言 多版本并發控制&#xff08;MVCC&#xff09;是 MySQL InnoDB 存儲引擎實現高性能事務的核心機制。它通過創建數據快照&#xff0c;使得讀寫操作可以無鎖并發&#xff0c;極大地提升了數據庫的并發性能。本文將深入探討 MVCC 的工作原理、實現細節以及它與事務隔離級別的緊…

景區負氧離子氣象站:引領綠色旅游,暢吸清新每一刻

在綠色旅游成為消費主流的今天&#xff0c;游客對 “清新空氣” 的需求不再是模糊的期待&#xff0c;而是可感知、可選擇的具體體驗。景區負氧離子氣象站的出現&#xff0c;正以科技之力重塑綠色旅游格局&#xff0c;讓 “暢吸清新每一刻” 從口號變為觸手可及的現實&#xff0…

Pytorch筆記一之 cpu模型保存、加載與推理

Pytorch筆記一之 cpu模型保存、加載與推理 1.保存模型 首先&#xff0c;在加載模型之前&#xff0c;我們需要了解如何保存模型。PyTorch 提供了兩種保存模型的方法&#xff1a;保存整個模型和僅保存模型的狀態字典&#xff08;state dict&#xff09;。推薦使用第二種方式&…

當AI在代碼車間組裝模塊:初級開發者的創意反成「核心算法」

前言&#xff1a;哈嘍&#xff0c;大家好&#xff0c;今天給大家分享一篇文章&#xff01;并提供具體代碼幫助大家深入理解&#xff0c;徹底掌握&#xff01;創作不易&#xff0c;如果能幫助到大家或者給大家一些靈感和啟發&#xff0c;歡迎收藏關注哦 &#x1f495; 目錄當AI在…

技術視界 | 跨域機器人通信與智能系統:打破壁壘的開源探索

8 月 16 日&#xff0c;在 OpenLoong 社區舉辦的第九期線下分享會上&#xff0c;國家地方共建人形機器人創新中心的軟件開發負責人 Amadeus 博士帶來了一場主題為“跨域機器人通信與智能系統&#xff1a;打破行業壁壘的創新方案”的演講。深入探討了當前機器人領域的一個關鍵痛…

Android入門到實戰(八):從發現頁到詳情頁——跳轉、傳值與RecyclerView多類型布局

一. 引言在上一篇文章里&#xff0c;我們從零開始實現了 App 的 發現頁面&#xff0c;通過網絡請求獲取數據&#xff0c;并使用 RecyclerView 展示了劇集列表。但光有發現頁還不夠&#xff0c;用戶在點擊一部劇時&#xff0c;自然希望進入到一個更詳細的頁面&#xff0c;去查看…

【工具】41K star!網頁一鍵變桌面應用

項目中遇到了一個需要將現有的 web 頁面打包成一個 桌面應用 的需求。 最一開始想到的是 Electron&#xff0c;但是它還需要一些開發工作并且打包后的應用體積比較大&#xff0c;調研后發現了開源工具 Pake。 它能讓你用最輕量的方式&#xff0c;把任何網頁一鍵打包成跨平臺桌…

浪潮CD1000-移動云電腦-RK3528芯片-2+32G-安卓9-2種開啟ADB ROOT刷機教程方法

浪潮CD1000-移動云電腦-RK3528芯片-232G-安卓9-2種開啟ADB ROOT刷機教程方法 往期文章&#xff1a; 浪潮CD1000-移動云電腦-RK3528芯片-232G-安卓9-開啟ADB ROOT破解教程 地址1&#xff1a;浪潮CD1000-移動云電腦-RK3528芯片-232G-開啟ADB ROOT破解教程-CSDN博客 中國移動浪潮…

Day23_【機器學習—聚類算法—K-Means聚類 及評估指標SSE、SC、CH】

一、聚類算法概念屬于無監督學習算法&#xff0c;即有特征無標簽&#xff0c;根據樣本之間的相似性&#xff0c;將樣本劃分到不同的類別中。所謂相似性可以理解為歐氏距離、曼哈頓距離、切比雪夫距離... 。分類按顆粒度分為&#xff1a;粗聚類、細聚類。按實現方法分為&#xf…

android seekbar顯示刻度

SeekBar簡介 SeekBar是Android中的一個可交互UI組件&#xff0c;允許用戶通過拖動滑塊在特定范圍內選擇數值。繼承自ProgressBar&#xff0c;但增加了用戶手動調節功能&#xff0c;常用于音量控制、亮度調節等場景。 核心屬性 android:maxHeight // 背景高度 android:progres…

【高并發內存池】五、頁緩存的設計

文章目錄Ⅰ. page cache頁緩存的結構設計Ⅱ. 完善central cache中的 get_span() 函數Ⅲ. 實現頁緩存獲取span對象的接口Ⅰ. page cache頁緩存的結構設計 ? 首先頁緩存還是一個哈希桶的結構&#xff0c;但是和前兩者不同的是&#xff0c;頁緩存的哈希桶中存放的是一個或者多個…

Elasticsearch(text和keyword)區別分析

text:全文檢索類型,經過分詞處理,支持模糊匹配? keyword:精確匹配類型,適用于聚合、排序和過濾? text 1. 核心屬性 ?analyzer屬性?: 指定用于索引和搜索的分詞器 默認使用標準分析器(Standard Analyzer) 示例:"analyzer": "ik_max_word"(中文…

通過tailscale實現一臺電腦上vscode通過ssh連接另一臺電腦上的VMware Linux 虛擬機

當需要通過一臺windows電腦上的vscode來ssh連接另一臺電腦上的linux虛擬機進行遠程操作&#xff0c;可以通過tailscale來實現。 Linux虛擬機上安裝tailscale 由于掛代理下載仍然很慢&#xff0c;而清華鏡像源又沒有tailscale的軟件包&#xff0c;所以可以通過下載 DEB 包安裝…

[Upscayl圖像增強] docs | 前端 | Electron工具(web->app)

鏈接&#xff1a;https://upscayl.org/docs&#xff1a;Upscayl Upscayl是一款桌面應用程序&#xff0c;允許用戶使用人工智能放大和增強圖像。 提供了一個用戶友好的圖形界面&#xff08;渲染器用戶界面&#xff09;&#xff0c;用戶可以選擇圖像或文件夾&#xff0c;從多種AI…