乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      docker基礎:本地鏡像管理相關命令

       丹楓無跡 2022-06-15 發(fā)布于北京

      Blog:博客園 個人

      本地鏡像管理

      • docker images: 列出本地鏡像;
      • docker rmi:刪除本地鏡像;
      • docker tag:標記本地鏡像;
      • docker build:使用DockerFile創(chuàng)建鏡像;
      • docker history:查看指定鏡像的創(chuàng)建歷史;
      • docker save:將指定鏡像保存成tar歸檔文件;
      • docker load:導入使用docker save命令導出的鏡像;
      • docker import:從歸檔文件中創(chuàng)建鏡像;
      • docker commit:從容器修改中創(chuàng)建新的鏡像;

      列出本地鏡像

      語法如下:

      docker images [OPTIONS] [REPOSITORY[:TAG]]
      
      Options:
        -a, --all             Show all images (default hides intermediate images(默認隱藏中間鏡像層))
            --digests         Show digests(顯示摘要信息)
        -f, --filter filter   Filter output based on conditions provided(顯示滿足條件的鏡像)
            --format string   Pretty-print images using a Go template
            --help            Print usage
            --no-trunc        Don't truncate output(顯示完整的鏡像信息)
        -q, --quiet           Only show numeric IDs
      
      

      刪除本地鏡像

      語法如下:

      docker rmi [OPTIONS] IMAGE [IMAGE...]
      
      Options:
        -f, --force      Force removal of the image(強制刪除鏡像)
            --no-prune   Do not delete untagged parents(不移除該鏡像的過程鏡像,默認移除)
      

      例如:

      # 刪除所有鏡像
      docker rmi $(docker images -q) 
      
      # 批量刪除無用鏡像
      docker rmi $(docker images -f dangling=true)
      

      標記本地鏡像

      語法如下:

      docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
      

      使用DockerFile創(chuàng)建鏡像

      語法如下:

      docker build [OPTIONS] PATH | URL | -
      
      Options:
            --build-arg list             Set build-time variables (default [])
            --cache-from stringSlice     Images to consider as cache sources
            --cgroup-parent string       Optional parent cgroup for the container
            --compress                   Compress the build context using gzip
            --cpu-period int             Limit the CPU CFS (Completely Fair Scheduler) period
            --cpu-quota int              Limit the CPU CFS (Completely Fair Scheduler) quota
        -c, --cpu-shares int             CPU shares (relative weight)
            --cpuset-cpus string         CPUs in which to allow execution (0-3, 0,1)
            --cpuset-mems string         MEMs in which to allow execution (0-3, 0,1)
            --disable-content-trust      Skip image verification (default true)
        -f, --file string                Name of the Dockerfile (Default is 'PATH/Dockerfile')
            --force-rm                   Always remove intermediate containers
            --help                       Print usage
            --isolation string           Container isolation technology
            --label list                 Set metadata for an image (default [])
        -m, --memory string              Memory limit
            --memory-swap string         Swap limit equal to memory plus swap: '-1' to enable unlimited swap
            --network string             Set the networking mode for the RUN instructions during build (default "default")
            --no-cache                   Do not use cache when building the image
            --pull                       Always attempt to pull a newer version of the image
        -q, --quiet                      Suppress the build output and print image ID on success
            --rm                         Remove intermediate containers after a successful build (default true)
            --security-opt stringSlice   Security options
            --shm-size string            Size of /dev/shm, default value is 64MB
        -t, --tag list                   Name and optionally a tag in the 'name:tag' format (default [])
            --ulimit ulimit              Ulimit options (default [])
      
      

      查看指定鏡像的創(chuàng)建歷史

      語法如下:

      docker history [OPTIONS] IMAGE
      
      Options:
        -H, --human      Print sizes and dates in human readable format (default true)
            --no-trunc   Don't truncate output
        -q, --quiet      Only show numeric IDs
      

      鏡像保存

      語法如下:

      docker save [OPTIONS] IMAGE [IMAGE...]
      
      Options:
        -o, --output string   Write to a file, instead of STDOUT
      

      鏡像導入

      語法如下:

      docker load [OPTIONS]
      
      Options:
        -i, --input string   Read from tar archive file, instead of STDIN
        -q, --quiet          Suppress the load output
      

      從歸檔文件中創(chuàng)建鏡像

      語法如下:

      docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]]
      
      Options:
        -c, --change list      Apply Dockerfile instruction to the created image (default [])
        -m, --message string   Set commit message for imported image
      
      

      從容器修改中創(chuàng)建新鏡像

      語法如下:

      docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
      
      Options:
        -a, --author string    Author (e.g., "John Hannibal Smith <hannibal@a-team.com>")
        -c, --change list      Apply Dockerfile instruction to the created image (default [])
        -m, --message string   Commit message
        -p, --pause            Pause container during commit (default true)
      

        本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
        轉藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多