【docker】Harbor镜像制作

1.将harbor上镜像拉取到本地

--检查本地镜像。
[root@es1 docker]# docker image ls 
REPOSITORY                          TAG       IMAGE ID       CREATED       SIZE
192.168.1.11:443/myharbor/nginx     latest    605c77e624dd   2 years ago   141MB
nginx                               latest    605c77e624dd   2 years ago   141MB
my_mysql                            latest    3218b38490ce   2 years ago   516MB
mysql                               latest    3218b38490ce   2 years ago   516MB
192.168.1.11:443/myharbor/busybox   1.28.3    8ac48589692a   6 years ago   1.15MB
busybox                             1.28.3    8ac48589692a   6 years ago   1.15MB

--删除本地镜像 
[root@es1 docker]# docker rmi 192.168.1.11:443/myharbor/nginx
Untagged: 192.168.1.11:443/myharbor/nginx:latest
Untagged: 192.168.1.11:443/myharbor/nginx@sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3
[root@es1 docker]# 
[root@es1 docker]# docker rmi 192.168.1.11:443/myharbor/busybox:1.28.3
Untagged: 192.168.1.11:443/myharbor/busybox:1.28.3
Untagged: 192.168.1.11:443/myharbor/busybox@sha256:186694df7

--删除其他镜像。
[root@es1 docker]# docker rmi nginx mysql my_mysql busybox:1.28.3
Untagged: nginx:latest
Untagged: nginx@sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31
Deleted: sha256:605c77e624ddb75e6110f997c58876baa13f8754486b461117934b24a9dc3a85
Deleted: sha256:b625d8e29573fa369e799ca7c5df8b7a902126d2b7cbeb390af59e4b9e1210c5
Deleted: sha256:7850d382fb05e393e211067c5ca0aada2111fcbe550a90fed04d1c634bd31a14
Deleted: sha256:02b80ac2055edd757a996c3d554e6a8906fd3521e14d1227440afd5163a5f1c4
Deleted: sha256:b92aa5824592ecb46e6d169f8e694a99150ccef01a2aabea7b9c02356cdabe7c
Deleted: sha256:780238f18c540007376dd5e904f583896a69fe620876cabc06977a3af4ba4fb5
Deleted: sha256:2edcec3590a4ec7f40cf0743c15d78fb39d8326bc029073b41ef9727da6c851f
Untagged: mysql:latest
Untagged: mysql@sha256:e9027fe4d91c0153429607251656806cc784e914937271037f7738bd5b8e7709
Untagged: my_mysql:latest
Deleted: sha256:3218b38490cec8d31976a40b92e09d61377359eab878db49f025e5d464367f3b
Deleted: sha256:aa81ca46575069829fe1b3c654d9e8feb43b4373932159fe2cad1ac13524a2f5
Deleted: sha256:0558823b9fbe967ea6d7174999be3cc9250b3423036370dc1a6888168cbd224d
Deleted: sha256:a46013db1d31231a0e1bac7eeda5ad4786dea0b1773927b45f92ea352a6d7ff9
Deleted: sha256:af161a47bb22852e9e3caf39f1dcd590b64bb8fae54315f9c2e7dc35b025e4e3
Deleted: sha256:feff1495e6982a7e91edc59b96ea74fd80e03674d92c7ec8a502b417268822ff
Deleted: sha256:8805862fcb6ef9deb32d4218e9e6377f35fb351a8be7abafdf1da358b2b287ba
Deleted: sha256:872d2f24c4c64a6795e86958fde075a273c35c82815f0a5025cce41edfef50c7
Deleted: sha256:6fdb3143b79e1be7181d32748dd9d4a845056dfe16ee4c827410e0edef5ad3da
Deleted: sha256:b0527c827c82a8f8f37f706fcb86c420819bb7d707a8de7b664b9ca491c96838
Deleted: sha256:75147f61f29796d6528486d8b1f9fb5d122709ea35620f8ffcea0e0ad2ab0cd0
Deleted: sha256:2938c71ddf01643685879bf182b626f0a53b1356138ef73c40496182e84548aa
Deleted: sha256:ad6b69b549193f81b039a1d478bc896f6e460c77c1849a4374ab95f9a3d2cea2
Untagged: busybox:1.28.3
Untagged: busybox@sha256:58ac43b2cc92c687a32c8be6278e50a063579655fe3090125dcb2af0ff9e1a64
Deleted: sha256:8ac48589692a53a9b8c2d1ceaa6b402665aa7fe667ba51ccc03002300856d8c7
Deleted: sha256:0314be9edf00a925d59f9b88c9d8ccb34447ab677078874d8c14e7a6816e21e1

--检查本地镜像 
[root@es1 docker]# docker image ls
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE

--拉取远程镜像。
docker pull 192.168.1.11:443/myharbor/nginx:latest 
[root@es1 docker]# docker pull 192.168.1.11:443/myharbor/nginx:latest 
latest: Pulling from myharbor/nginx
a2abf6c4d29d: Pull complete 
a9edb18cadd1: Pull complete 
589b7251471a: Pull complete 
186b1aaa4aa6: Pull complete 
b4df32aa5a72: Pull complete 
a0bcbecc962e: Pull complete 
Digest: sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3
Status: Downloaded newer image for 192.168.1.11:443/myharbor/nginx:latest
192.168.1.11:443/myharbor/nginx:latest
[root@es1 docker]# 
--查看刚拉取的镜像。
[root@es1 docker]# docker image ls
REPOSITORY                        TAG       IMAGE ID       CREATED       SIZE
192.168.1.11:443/myharbor/nginx   latest    605c77e624dd   2 years ago   141MB
[root@es1 docker]# 
--拉取busybox镜像。
[root@es1 docker]# docker pull 192.168.1.11:443/myharbor/busybox:1.28.3 
1.28.3: Pulling from myharbor/busybox
f70adabe43c0: Pull complete 
Digest: sha256:186694df7e479d2b8bf075d9e1b1d7a884c6de60470006d572350573bfa6dcd2
Status: Downloaded newer image for 192.168.1.11:443/myharbor/busybox:1.28.3
192.168.1.11:443/myharbor/busybox:1.28.3
[root@es1 docker]#
--检查拉取的镜像。 
[root@es1 docker]# docker image ls
REPOSITORY                          TAG       IMAGE ID       CREATED       SIZE
192.168.1.11:443/myharbor/nginx     latest    605c77e624dd   2 years ago   141MB
192.168.1.11:443/myharbor/busybox   1.28.3    8ac48589692a   6 years ago   1.15MB

2.在本地节点上下载进行和上传镜像到Harbor; 

--下载centos镜像。
[root@es4 harbor]# docker pull centos:7.9.2009
7.9.2009: Pulling from library/centos
2d473b07cdd5: Pull complete 
Digest: sha256:9d4bcbbb213dfd745b58be38b13b996ebb5ac315fe75711bd618426a630e0987
Status: Downloaded newer image for centos:7.9.2009
docker.io/library/centos:7.9.2009


[root@es1 docker]# docker push 192.168.1.11:443/myharbor/centos:7.9.2009 
The push refers to repository [192.168.1.11:443/myharbor/centos]
174f56854903: Pushed 
7.9.2009: digest: sha256:dead07b4d8ed7e29e98de0f4504d87e8880d4347859d839686a31da35a3b532f size: 529
[root@es1 docker]# docker image ls 
REPOSITORY                          TAG        IMAGE ID       CREATED       SIZE
192.168.1.11:443/myharbor/nginx     latest     605c77e624dd   2 years ago   141MB
192.168.1.11:443/myharbor/centos    7.9.2009   eeb6ee3f44bd   2 years ago   204MB
centos                              7.9.2009   eeb6ee3f44bd   2 years ago   204MB
192.168.1.11:443/myharbor/busybox   1.28.3     8ac48589692a   6 years ago   1.15MB


[root@es1 docker]# docker search httpd
NAME                           DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
httpd                          The Apache HTTP Server Project                  4741      [OK]       
hypriot/rpi-busybox-httpd      Raspberry Pi compatible Docker Image with a …   48                   
centos/httpd-24-centos7        Platform for running Apache httpd 2.4 or bui…   46                   
centos/httpd                                                                   36                   [OK]
openquantumsafe/httpd          Demo of post-quantum cryptography in Apache …   13                   
mprahl/s2i-angular-httpd24     An S2I image for building and running Angula…   3                    [OK]
centos/httpd-24-centos8                                                        3                    
edirom/subversion-ldap-httpd   Docker image for an Apache web server with S…   3                    [OK]
edirom/webdav-ldap-httpd       Docker image for an Apache web server with W…   2                    [OK]
dockerpinata/httpd                                                             1                    
manageiq/httpd                 Container with httpd, built on CentOS for Ma…   1                    [OK]
dockette/apache                Apache / HTTPD                                  1                    [OK]
betterweb/httpd                                                                0                    
eclipsefdn/generic-httpd                                                       0                    
openeuler/httpd                                                                0                    
dockette/httpdump                                                              0                    
vulhub/mini_httpd                                                              0                    
wodby/httpd                                                                    0                    
jitesoft/httpd                 Apache httpd on Alpine linux.                   0                    
vulhub/httpd                                                                   0                    
paketobuildpacks/php-httpd                                                     0                    
e2eteam/httpd                                                                  0                    
manasip/httpd                                                                  0                    
paketobuildpacks/httpd                                                         0                    
httpdocker/kubia        

[root@es1 docker]# docker pull httpd 
Using default tag: latest
latest: Pulling from library/httpd
a2abf6c4d29d: Already exists 
dcc4698797c8: Pull complete 
41c22baa66ec: Pull complete 
67283bbdd4a0: Pull complete 
d982c879c57e: Pull complete 
Digest: sha256:0954cc1af252d824860b2c5dc0a10720af2b7a3d3435581ca788dff8480c7b32
Status: Downloaded newer image for httpd:latest
docker.io/library/httpd:latest

[root@es1 docker]# docker tag httpd:latest 192.168.1.11:443/myharbor/httpd:latest
[root@es1 docker]# docker push 192.168.1.11:443/myharbor/httpd:latest
The push refers to repository [192.168.1.11:443/myharbor/httpd]
deefaa620a71: Pushed 
9cff3206f9a6: Pushed 
15e4bf5d0804: Pushed 
1da636a1aa95: Pushed 
2edcec3590a4: Mounted from myharbor/nginx 
latest: digest: sha256:57c1e4ff150e2782a25c8cebb80b574f81f06b74944caf972f27e21b76074194 size: 1365

    


[root@es1 docker]# docker search tomcat
NAME                                            DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
tomcat                                          Apache Tomcat is an open source implementati…   3677      [OK]       
tomee                                           Apache TomEE is an all-Apache Java EE certif…   115       [OK]       
bitnami/tomcat                                  Bitnami container image for Tomcat              50                   [OK]
eclipse/rdf4j-workbench                         Dockerfile for Eclipse RDF4J Server and Work…   8                    
rightctrl/tomcat                                CentOS , Oracle Java, tomcat application ssl…   7                    [OK]
jelastic/tomcat                                 An image of the Tomcat Java application serv…   4                    
openidentityplatform/openam-j2ee-agent-tomcat   OpenAM Java EE Policy Agent for Apache Tomcat   1                    
rancher/haproxy-tomcat                                                                          1                    
eclipse/alpine_jdk8                             Based on Alpine 3.3. JDK 1.8, Maven 3.3.9, T…   1                    [OK]
chainguard/tomcat                               Build, ship and run secure software with Cha…   0                    
paketobuildpacks/apache-tomcat                                                                  0                    
wnprcehr/tomcat                                                                                 0                    
bitnamicharts/tomcat                                                                            0                    
rapidfort/tomcat10-openjdk17-ib                                                                 0                    
samply/tomcat-common                                                                            0                    
jumpserver/tomcat                               Apache Tomcat is an open source implementati…   0                    
vulhub/tomcat                                                                                   0                    
hivdb/tomcat-with-nucamino                                                                      0                    
openeuler/tomcat                                                                                0                    
library123/tomcat                                                                               0                    
eclipse/hadoop-dev                              Ubuntu 14.04, Maven 3.3.9, JDK8, Tomcat 8       0                    [OK]
secoresearch/tomcat-varnish                     Tomcat and Varnish 5.0                          0                    [OK]
rapidfort/tomcat9-openjdk11-ib                  RapidFort optimized, hardened image for Tomc…   0                    
tomcat/tomcat01                                                                                 0                    
semoss/docker-tomcat                            Tomcat, Java, Maven, and Git on top of debian   0                    [OK]

[root@es1 docker]# docker pull tomcat:10.0.0-jdk8
10.0.0-jdk8: Pulling from library/tomcat
b9a857cbf04d: Pull complete 
d557ee20540b: Pull complete 
3b9ca4f00c2e: Pull complete 
667fd949ed93: Pull complete 
b6a945768a17: Pull complete 
2b7094777fa8: Pull complete 
a01ae7a16c09: Pull complete 
c74257d7c0a2: Pull complete 
9283cc56994e: Pull complete 
c07fcaa9b8c9: Pull complete 
Digest: sha256:1091243b1f4669ed9ebfe89469eedecefb97011b14c3667fe659be3916813d59
Status: Downloaded newer image for tomcat:10.0.0-jdk8
docker.io/library/tomcat:10.0.0-jdk8


[root@es1 docker]# docker push 192.168.1.11:443/myharbor/tomcat:10.0.0-jdk8 
The push refers to repository [192.168.1.11:443/myharbor/tomcat]
0136aaf21295: Pushed 
e8aa61f454f4: Pushed 
c58895d1e79c: Pushed 
3699edc1df37: Pushed 
3e5f50227def: Pushed 
4ce2c85da406: Pushed 
aa7af8a465c6: Pushed 
ef9a7b8862f4: Pushed 
a1f2f42922b1: Pushed 
4762552ad7d8: Pushed 
10.0.0-jdk8: digest: sha256:674238a58a952cf67ff51a4a376bab1c4debd4b67a9c456905795a9bda41208d size: 2421

--制作Mysql镜像。
#mysql
docker pull mysql:5.7.21
docker tag mysql:5.7.21 192.168.1.11:443/myharbor/mysql:5.7.21
docker push 192.168.1.11:443/myharbor/mysql:5.7.21

[root@es1 docker]# docker pull mysql:5.7.21
5.7.21: Pulling from library/mysql
2a72cbf407d6: Pull complete 
38680a9b47a8: Pull complete 
4c732aa0eb1b: Pull complete 
c5317a34eddd: Pull complete 
f92be680366c: Pull complete 
e8ecd8bec5ab: Pull complete 
2a650284a6a8: Pull complete 
5b5108d08c6d: Pull complete 
beaff1261757: Pull complete 
c1a55c6375b5: Pull complete 
8181cde51c65: Pull complete 
Digest: sha256:691c55aabb3c4e3b89b953dd2f022f7ea845e5443954767d321d5f5fa394e28c
Status: Downloaded newer image for mysql:5.7.21
docker.io/library/mysql:5.7.21
[root@es1 docker]# docker tag mysql:5.7.21 192.168.1.11:443/myharbor/mysql:5.7.21
[root@es1 docker]# docker push 192.168.1.11:443/myharbor/mysql:5.7.21
The push refers to repository [192.168.1.11:443/myharbor/mysql]
c5479ef6e03d: Pushed 
1df83efbc52b: Pushed 
4b402dfbab7b: Pushed 
14d83b80d542: Pushed 
b0c77fd3841d: Pushed 
317e578f94b9: Pushed 
fbb39c7dedaf: Pushed 
55d5d837463a: Pushed 
f0f28cc0eea1: Pushed 
813996252a80: Pushed 
3358360aedad: Pushed 
5.7.21: digest: sha256:12e70236ec8be07b87a95008a22deb0a2a6289ac81d852e622ea13e8311cec64 size: 2621



[root@es1 docker]# docker pull mattrayner/lamp:latest-1804
latest-1804: Pulling from mattrayner/lamp
c64513b74145: Pull complete 
01b8b12bad90: Pull complete 
c5d85cf7a05f: Pull complete 
b6b268720157: Pull complete 
e12192999ff1: Pull complete 
d39ece66b667: Pull complete 
65599be66378: Pull complete 
21b7b8e7b9c1: Pull complete 
18f5b64f7cef: Pull complete 
04ad9a19c5b3: Pull complete 
4103a3ecbaab: Pull complete 
3066e34dc7b7: Pull complete 
b626f562f102: Pull complete 
fad4a5a21cfc: Pull complete 
b61cd78121f8: Pull complete 
8fdead2af556: Pull complete 
0b7a25b71663: Pull complete 
4f7a1c8ef483: Pull complete 
7418cc89daa3: Pull complete 
8a575f293d57: Pull complete 
28bdfc1a4078: Pull complete 
e721c0d58e24: Pull complete 
1cc91c652f0c: Pull complete 
1472f8b101ad: Pull complete 
8ba9e7f930d6: Pull complete 
ffdac6b10455: Pull complete 
744339944267: Pull complete 
e065bd5bccc8: Pull complete 
Digest: sha256:94f6d3e2ea3391c76325441fdd8b1afff7364b89955bc7a5ff4038fc3dd93a5f
Status: Downloaded newer image for mattrayner/lamp:latest-1804
docker.io/mattrayner/lamp:latest-1804
[root@es1 docker]# docker tag mattrayner/lamp:latest-1804 192.168.1.11:443/myharbor/lamp:latest-1804
[root@es1 docker]# docker push 192.168.1.11:443/myharbor/lamp:latest-1804
The push refers to repository [192.168.1.11:443/myharbor/lamp]
2f29a3a71697: Pushed 
11c234baa111: Pushed 
a6dec3d700ad: Pushed 
4ba892c67290: Pushed 
0844264e49ce: Pushed 
74e06a0586a9: Pushed 
246b1c49d6f4: Pushed 
f37f8a6afe10: Pushed 
f6b9c4cdbb9a: Pushed 
1f492437c240: Pushed 
209fa14e6160: Pushed 
a74ad6da736c: Pushed 
d71fd7cf1867: Pushed 
6b3b91ff0439: Pushed 
f89baec68111: Pushed 
e8ed3d66d727: Pushed 
cfa4f4b7df81: Pushed 
3b5778ef680c: Pushed 
2d153ee52f59: Pushed 
32dd4be8fced: Pushed 
dbb098e3e348: Pushed 
c89f4fbc01f8: Pushed 
831fff32e4f2: Pushed 
268a067217b5: Pushed 
c01d74f99de4: Pushed 
ccd4d61916aa: Pushed 
8f2b771487e9: Pushed 
f49017d4d5ce: Pushed 
latest-1804: digest: sha256:94f6d3e2ea3391c76325441fdd8b1afff7364b89955bc7a5ff4038fc3dd93a5f size: 6154




[root@es1 docker]# docker tag elasticsearch:7.9.2 192.168.1.11:443/myharbor/elasticsearch:7.9.2
[root@es1 docker]# docker push 192.168.1.11:443/myharbor/elasticsearch:7.9.2
The push refers to repository [192.168.1.11:443/myharbor/elasticsearch]
28594d270b8b: Pushed 
5152d1bea2f4: Pushed 
7d973242e380: Pushed 
bcfe47fa2edb: Pushed 
69bb30d72312: Pushed 
eb65c01b8a77: Pushed 
549a93afd1d1: Pushed 
510f8aeb40db: Pushed 
613be09ab3c0: Pushed 
7.9.2: digest: sha256:337369f2403be78fcad2e69d3f56681cd1b7a4aa8539ed599806da83cf0f10ae size: 2202


[root@es1 docker]# docker pull postgres
Using default tag: latest
latest: Pulling from library/postgres
a2abf6c4d29d: Already exists 
e1769f49f910: Pull complete 
33a59cfee47c: Pull complete 
461b2090c345: Pull complete 
8ed8ab6290ac: Pull complete 
495e42c822a0: Pull complete 
18e858c71c58: Pull complete 
594792c80d5f: Pull complete 
794976979956: Pull complete 
eb5e1a73c3ca: Pull complete 
6d6360292cba: Pull complete 
131e916e1a28: Pull complete 
757a73507e2e: Pull complete 
Digest: sha256:f329d076a8806c0ce014ce5e554ca70f4ae9407a16bb03baa7fef287ee6371f1
Status: Downloaded newer image for postgres:latest
docker.io/library/postgres:latest
[root@es1 docker]# 



[root@es1 docker]# docker pull mongo
Using default tag: latest
latest: Pulling from library/mongo
7b1a6ab2e44d: Pull complete 
90eb44ebc60b: Pull complete 
5085b59f2efb: Pull complete 
c7499923d022: Pull complete 
019496b6c44a: Pull complete 
c0df4f407f69: Pull complete 
351daa315b6c: Pull complete 
a233e6240acc: Pull complete 
a3f57d6be64f: Pull complete 
dd1b5b345323: Pull complete 
Digest: sha256:5be752bc5f2ac4182252d0f15d74df080923aba39700905cb26d9f70f39e9702
Status: Downloaded newer image for mongo:latest
docker.io/library/mongo:latest



[root@es1 docker]# docker pull redis:latest
latest: Pulling from library/redis
a2abf6c4d29d: Already exists 
c7a4e4382001: Pull complete 
4044b9ba67c9: Pull complete 
c8388a79482f: Pull complete 
413c8bb60be2: Pull complete 
1abfd3011519: Pull complete 
Digest: sha256:db485f2e245b5b3329fdc7eff4eb00f913e09d8feb9ca720788059fdc2ed8339
Status: Downloaded newer image for redis:latest
docker.io/library/redis:latest
[root@es1 docker]# docker tag redis:latest 192.168.1.11:443/myharbor/redis:latest
[root@es1 docker]# docker push 192.168.1.11:443/myharbor/redis:latest
The push refers to repository [192.168.1.11:443/myharbor/redis]
8e5669d83291: Pushed 
9975392591f2: Pushed 
529cdb636f61: Pushed 
4b8e2801e0f9: Pushed 
9b24afeb7c2f: Pushed 
2edcec3590a4: Mounted from myharbor/postgres 
latest: digest: sha256:563888f63149e3959860264a1202ef9a644f44ed6c24d5c7392f9e2262bd3553 size: 1573

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值