您好,登錄后才能下訂單哦!
Docker
Docker 是一個開源的應用容器引擎,讓開發者可以打包他們的應用以及依賴包到一個可移植的容器中,然后發布到任何流行的Linux機器或Windows 機器上,也可以實現虛擬化,容器是完全使用沙箱機制,相互之間不會有任何接口。
1.docker的主要內容
(1).docker是一個cs架構
(2).docker主要:鏡像 容器 倉庫 網絡 存儲 監控
(3).docker是一個軟件的打包技術
2.docker鏡像基礎命令
1.docker search Nginx(搜索鏡像)
[root@docker03 ~]# docker search nginx
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
nginx Official build of Nginx. 12314 [OK]
jwilder/nginx-proxy Automated Nginx reverse proxy for docker con… 1698 [OK]
richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable of… 746 [OK]
linuxserver/nginx An Nginx container, brought to you by LinuxS… 83
2.docker pull nginx (官網倉庫下載鏡像,不加latest,默認下載最新版)
[root@docker03 ~]# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
000eee12ec04: Pull complete
3.docker push (上傳鏡像)
[root@docker03 ~]# docker push nginx
4.docker images (查看本地已有鏡像)
[root@docker03 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest 231d40e811cd 2 weeks ago 126MB
5.docker rmi (刪除鏡像)
[root@docker03 ~]# docker rmi nginx:latest
Untagged: nginx:latest
Untagged: nginx@sha256:50cf965a6e08ec5784009d0fccb380fc479826b6e0e65684d9879170a9df8566
Deleted: sha256:231d40e811cd970168fb0c4770f2161aa30b9ba6fe8e68527504df69643aa145
6.docker tag(給鏡像打標簽)
[root@docker03 ~]# docker tag nginx:latest nginx:v1
7.docker load -i docker_kod.tar.gz (本地鏡像導入)
[root@docker03 ~/docker]# ls
docker_kod.tar.gz
[root@docker03 ~/docker]#
[root@docker03 ~/docker]# docker load -i docker_kod.tar.gz
b5e11aae8a8e: Loading layer [==================================================>] 202.9MB/202.9MB
8.docker import (導入鏡像,images沒有鏡像名和標簽)
[root@docker03 ~/docker]# docker import docker_kod.tar.gz
[root@docker03 ~/docker]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
<none> <none> c1863e2b0717 35 seconds ago 627MB
9.docker save(保存鏡像到當前目錄)
[root@docker03 ~/docker]# docker save nginx:latest -o docker_nginx.tar.gz
10.docker inspect nginx:v1 (查看鏡像屬性)
[root@docker03 ~/docker]# docker inspect nginx:v1
11.docker image prune(清理無人使用的鏡像和拉取到一半的鏡像,刪除鏡像緩存)
[root@docker03 ~/docker]# docker image prune
WARNING! This will remove all dangling images.
Are you sure you want to continue? [y/N] y
Deleted Images:
deleted: sha256:c1863e2b07171e582113544e6c19660cd3fee7d6f1d89401529f8472732c8e33
deleted: sha256:56d69e4a0819cab19e224724de86de73c8dfcd8ee5f01e08288b20cfb49c4d52
12.docker更改拾取(重啟容器生效)
[root@22732407347e /]# /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
13.刪除<none>鏡像
[root@docker03 ~]# docker image prune
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。