找回密码
 注册
查看: 412|回复: 2

linux8系统安装调试podman

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-2-10 21:51:16 | 显示全部楼层 |阅读模式
[root@controller ~]# dnf module list  |grep container-tools1 p# C, h# D2 n; M5 K  Y& }8 `( \
container-tools      rhel8 [d][e]    common [d]                               Most recent (rolling) versions of podman, buildah, skopeo, runc, conmon, runc, conmon, CRIU, Udica, etc as well as dependencies such as container-selinux built and tested together, and updated as frequently as every 12 weeks.         
' U9 N. v) d, scontainer-tools      1.0             common [d]                               Stable versions of podman 1.0, buildah 1.5, skopeo 0.1, runc, conmon, CRIU, Udica, etc as well as dependencies such as container-selinux built and tested together, and supported for 24 months.                                          . E5 D1 G5 F# W( p; W
container-tools      2.0             common [d]                               Stable versions of podman 1.6, buildah 1.11, skopeo 0.1, runc, conmon, etc as well as dependencies such as container-selinux built and tested together, and supported as documented on the Application Stream lifecycle page.             & u. R; w: j) N" ^; j5 q! Q/ v
container-tools      3.0             common [d]                               Stable versions of podman 3.0, buildah 1.19, skopeo 1.2, runc, conmon, CRIU, Udica, etc as well as dependencies such as container-selinux built and tested together, and supported as documented on the Application Stream lifecycle page.
( V9 d5 Q$ h1 icontainer-tools      4.0             common                                   Stable versions of podman 4.0, buildah 1.24, skopeo 1.6, runc, conmon, CRIU, Udica, etc as well as dependencies such as container-selinux built and tested together, and supported as documented on the Application Stream lifecycle page.
/ H; }: t" C  q- [3 E+ g; M4 g% b
9 \/ s/ I! S) G! h
% Z. A$ |" q' y; s* H8 v% Y, J4 |3 L8 Q. m0 W/ ]  U
[root@controller ~]# dnf install -y @container-tools8 [) {6 x' r- U" [& z6 \
Last metadata expiration check: 0:43:52 ago on Fri 10 Feb 2023 09:03:30 PM CST.
( ^# w+ Y; }7 }, R
9 z# L  [. f& ](22/27): python3-chardet-3.0.4-7.el8.noarch.rpm                                   3.1 MB/s | 195 kB     00:00    ( E# }1 X1 E: w5 I8 J0 |' b
(23/27): python3-idna-2.5-5.el8.noarch.rpm                                        1.2 MB/s |  97 kB     00:00   
" ]; A! q5 v7 i/ w: X(24/27): python3-pysocks-1.6.8-3.el8.noarch.rpm                                   765 kB/s |  34 kB     00:00   
6 k5 S' `4 H* H8 B" x(25/27): python3-requests-2.20.0-2.1.el8_1.noarch.rpm                             2.3 MB/s | 123 kB     00:00   
" b1 F1 w; u4 O6 \(26/27): python3-urllib3-1.24.2-5.el8.noarch.rpm                                  2.9 MB/s | 177 kB     00:00   
% {& z6 ]- N) f- r(27/27): gsettings-desktop-schemas-3.32.0-6.el8.x86_64.rpm                        1.9 MB/s | 633 kB     00:00   
$ S7 j* }# [4 e, x------------------------------------------------------------------------------------------------------------------
& k# g* d% j0 i/ d4 Y7 XTotal                                                                             8.7 MB/s |  24 MB     00:02     ' K% _+ n$ p2 _/ e; n1 ~  k9 @
Running transaction check
0 L& w# k( v+ ?4 }+ B5 jTransaction check succeeded.
6 u5 G/ s) L0 A8 Y% nRunning transaction test& [6 x8 y" L) R4 j7 c- b) |
Transaction test succeeded.5 s" L2 z; I  R% o
Running transaction
/ t. F3 G/ _% h/ ^/ M  Preparing        :                                                                                          1/1 7 J3 J- Q, [, l3 }  d6 s/ r
  Installing       : fontpackages-filesystem-1.44-22.el8.noarch                                              1/27 ' A! K9 d: K* ~" N6 t6 V6 ]
  Installing       : abattis-cantarell-fonts-0.0.25-6.el8.noarch                                             2/27 - H+ l. {" n; Q  \
  Installing       : dejavu-fonts-common-2.35-7.el8.noarch                                                   3/27   a' h! K0 w8 B( K+ N% }
  Installing       : dejavu-sans-mono-fonts-2.35-7.el8.noarch                                                4/27 + f. b5 g- G( h) o
  Installing       : gsettings-desktop-schemas-3.32.0-6.el8.x86_64                                           5/27
0 R& e9 P3 K) H* j0 S( e  Installing       : python3-pysocks-1.6.8-3.el8.noarch                                                      6/27 3 ]# p0 L2 L" s- q9 a$ Q
  Installing       : python3-urllib3-1.24.2-5.el8.noarch                                                     7/27   P  I: B8 ]9 ^0 J9 l: k* s& R
  Installing       : python3-idna-2.5-5.el8.noarch                                                           8/27 , O" E5 H7 W' }) g
  Installing       : python3-chardet-3.0.4-7.el8.noarch                                                      9/27 * @$ J, x! F# s) @5 ~1 m
  Installing       : python3-requests-2.20.0-2.1.el8_1.noarch                                               10/27
  g) d4 S3 E" @  Installing       : libmodman-2.0.1-17.el8.x86_64                                                          11/27 ) n! u$ s! s8 }/ Q
  Running scriptlet: libmodman-2.0.1-17.el8.x86_64                                                          11/27   \" s$ v. t0 _! x& ?& q! {, F$ ]
  Installing       : libproxy-0.4.15-5.2.el8.x86_64                                                         12/27
; }$ `% C' k& q" T  Running scriptlet: libproxy-0.4.15-5.2.el8.x86_64                                                         12/27
2 G6 s7 h) I: w' |1 A% c  Installing       : glib-networking-2.56.1-1.1.el8.x86_64                                                  13/27
8 J2 g  e4 h; M9 L  Installing       : json-glib-1.4.4-1.el8.x86_64                                                           14/27
' [. d& n6 D! ~2 o) K. A  Installing       : cockpit-bridge-283-1.el8.x86_64                                                        15/27
6 c3 B' x1 |( e* c" ]6 z  Installing       : yajl-2.1.0-11.el8.x86_64                                                               16/27
$ o1 |2 U& B9 ]' g9 Z6 Q  Installing       : python3-pyxdg-0.25-16.el8.noarch                                                       17/27 9 g% i+ [) @( k- A, J: S
  Installing       : python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                          18/27
% Y( e& G: L* `/ l9 _1 A9 M  Installing       : aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                             19/27
4 y! d9 C; k  H  Installing       : netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                 20/27 2 H# P, s" J1 f( b( R
  Installing       : buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                 21/27
# U( z6 l* R) D/ U: l3 s5 v: b8 |6 T2 K) ?  Installing       : python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                             22/27 ( V6 f  q3 w/ o" j( f
  Installing       : crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                         23/27 ; ^8 k/ W# \8 O, A2 m4 F
  Installing       : cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                24/27 8 a/ I8 y' m3 t( s2 r: k; S/ F
  Installing       : udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                      25/27
) Q* f! |6 f6 j1 C  Installing       : toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                  26/27
: }# _- r4 F& B6 l$ `5 x  Installing       : skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   27/27 6 `9 ?" D& X, D  I# \1 w& @
  Running scriptlet: skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   27/27 0 B; z9 K8 E, D$ p
  Verifying        : aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                              1/27
) |  |0 H4 u3 p4 Z, |/ g8 g  `+ S. P  Verifying        : abattis-cantarell-fonts-0.0.25-6.el8.noarch                                             2/27 " R# N* k, m5 j2 N% m3 C
  Verifying        : buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                  3/27 6 }& ~, ^! k. B" ?$ t" z2 i3 B
  Verifying        : cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                 4/27   c6 l8 |" C, R$ s4 k0 v- b3 ]
  Verifying        : crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                          5/27
% [- e  d' |" U" c+ ~  Verifying        : netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                  6/27 . y" }. I! p; f8 n4 b
  Verifying        : python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                              7/27 $ A  R) |0 f! B
  Verifying        : python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                           8/27 2 K5 m; [: o/ y( d: k1 S5 b- h
  Verifying        : python3-pyxdg-0.25-16.el8.noarch                                                        9/27
' z9 Y* Z4 B$ \8 j% z0 G7 _  Verifying        : skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   10/27
& \! ~1 q; H, U- l# P) Q0 Y  Verifying        : toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                  11/27 : g+ P, K8 Z$ J
  Verifying        : udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                      12/27 $ J3 C; `. @: o- A% r& ~
  Verifying        : yajl-2.1.0-11.el8.x86_64                                                               13/27 5 G) F3 Z& J9 M& c6 B+ M: |
  Verifying        : cockpit-bridge-283-1.el8.x86_64                                                        14/27
& x# A6 |. `  @9 G+ M  Verifying        : dejavu-fonts-common-2.35-7.el8.noarch                                                  15/27
) `, I$ I" d  M( r) t  Verifying        : dejavu-sans-mono-fonts-2.35-7.el8.noarch                                               16/27
5 ^. `- c9 j) Z* s* i& C
8 B3 r8 ^  n4 l" [- o; }: LInstalled:
" T/ s" z% g6 x  D  aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                                                      4 C3 H( x; ]7 P$ Y! h
  abattis-cantarell-fonts-0.0.25-6.el8.noarch                                                                     5 R0 B% }# q( K9 k$ h# n! D( Q5 F
  buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                                         
2 Z8 ]9 T0 L. E5 D$ t  cockpit-bridge-283-1.el8.x86_64                                                                                 
9 j2 o* S8 _2 B! {- b# U  g6 ~  cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                                         
  u/ ?( z1 U! @4 F; {; D: S3 V  crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                                                  / A! G0 }+ ^4 C: W0 Z$ V
  dejavu-fonts-common-2.35-7.el8.noarch                                                                           6 K% M2 B0 c2 ?. c$ c
  dejavu-sans-mono-fonts-2.35-7.el8.noarch                                                                        , |3 d4 Q# Z9 t* ^# H0 G5 F
  fontpackages-filesystem-1.44-22.el8.noarch                                                                      ; E. q3 v# R( b. |7 d
  glib-networking-2.56.1-1.1.el8.x86_64                                                                           + u% W3 X; G. P* T5 x: S
  gsettings-desktop-schemas-3.32.0-6.el8.x86_64                                                                   # @3 C2 q' S: b; W7 S
  json-glib-1.4.4-1.el8.x86_64                                                                                    
. Y! P6 ?  N. G7 @; C+ {  libmodman-2.0.1-17.el8.x86_64                                                                                   ; Q0 |( e; S  B: @- e% o
  libproxy-0.4.15-5.2.el8.x86_64                                                                                 
( c% `( ~" L2 y( O  netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                                          + A! D( R# [" F# |, z- E
  python3-chardet-3.0.4-7.el8.noarch                                                                              
5 h  G% N* N5 r6 D  python3-idna-2.5-5.el8.noarch                                                                                   
; g" e+ G& M- a0 r  python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                                                      * n/ E* H$ a5 W3 l# e- e$ u
  python3-pysocks-1.6.8-3.el8.noarch                                                                              
, \" E$ G9 v( V' s# k  python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                                                   & e9 j  Z8 }3 y' Y; T
  python3-pyxdg-0.25-16.el8.noarch                                                                                
7 }7 |2 S. o0 c* D" Q, H  python3-requests-2.20.0-2.1.el8_1.noarch                                                                        ' l- t7 h) b" N" Y4 [* w' K$ P
  python3-urllib3-1.24.2-5.el8.noarch                                                                             * X' X4 }. o) j( Q
  skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                                            4 h) L' {3 o2 @) W# t
  toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                                           
5 ?5 V# ~( n6 Y' c8 o7 f  udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                                               1 e2 Z. @0 D3 t
  yajl-2.1.0-11.el8.x86_64                                                                                       
' a7 S2 m% k4 W( u: W
4 [0 Z# ~9 c1 X; C' `Complete!
5 K8 u5 N5 F/ @/ N9 y, P[root@controller ~]# - y1 P" B5 k& M, {; l

6 g* g: g- K" @5 R# G3 e[root@controller ~]# podman version0 r" _) E7 N( m, b$ a6 L
Client:       Podman Engine
2 Q' i4 E% m) ~3 R- p7 F% [8 mVersion:      4.2.0
; m  n3 _2 |( m8 V/ y4 s) w9 U7 OAPI Version:  4.2.0$ _. H/ @! g' |
Go Version:   go1.18.4$ z$ M1 z0 r$ g6 x
Built:        Wed Sep 21 21:15:04 2022& P2 |: s1 B4 x( y* P" N* I- \: j
OS/Arch:      linux/amd645 J; w, v/ x1 Z( Z# }
# L* B8 G" w& Z; K- C

; }! [4 F3 w! O) P! P3 s: L0 ^
5 A  d/ V7 X) v, ~2 L* N, v- T3 j. ]$ ~: @1 ^  A$ M! T

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-2-10 22:07:55 | 显示全部楼层
可以发现,使用方式可以说和 docker 的丝毫不差,不用担心从 docker 切换到 podman 会有不习惯的。如果不习惯使用 podman 命令,可以使用 alias docker=podman 来对docker命令做一个命令映射即可:
% v( U6 x8 W  h& s. t+ X- }$ F
2 _) ]* [2 B  o3 _& O! p加速链接获取 详细请阅读docker 基本用法
  a$ A" D7 h+ }$ c2 V% S; Y- \4 W) f/ Y# g; k% t
默认镜像库 文件 /etc/containers/registries.conf 是设置镜像地址配置文件,默认会搜索 ['registry.access.redhat.com', 'registry.redhat.io', 'docker.io', 'quay.io']等几个镜像库& m' I* d" @3 ?% G! x6 }) x' ]
unqualified-search-registries = ["registry.access.redhat.com", "registry.redhat.io", "docker.io"]! q; }# z/ p* m0 b  }* X
- [) r4 {8 I. c+ i
- Z, V& r" O! q
     通常来说,这几个镜像库下载速度非常慢,有时候可能会无法顺利的将镜像拉下来。9 F, S' L! {0 G3 ~/ a- u
9 N) x* o* E5 r$ G. [
     所以,需要修改修改镜像库配置文件,也就是大家说的镜像加速方案。  ?6 z0 \0 d7 M% J# j. P; Q- G
镜像加速
+ l0 T) l) A- W' `     只需2个步骤实现镜像加速:
; L0 a/ z7 p5 P% T" w6 d* Z, p( N
           1.改名并备份好文件:/etc/containers/registries.conf.bak
9 S- v! z# l" o4 K: | ​cp /etc/containers/registries.conf{,.bak}
& M+ ?9 F* D. s. O: r7 l( V. K* Z* N9 z  P$ j6 M  d% y" N

7 q" w) l7 z# C0 H: X+ c  D8 t           2.再新建一个空的 registries.conf 文件,插入如下内容" n0 `0 W8 R9 ^" V: ^7 `3 L
                 unqualified-search-registries = ["docker.io"]
4 I# `: n' o5 r9 G# G& i: ~
5 [" u% w* ^' |% I2 ]' l( ]. o           #      [[registry]]
& {3 G) k4 M% _$ p' F( k1 a; U' n           #       prefix = "docker.io"4 s3 e3 l7 \, A* [5 l# }) u! E5 ^
            #      location = "******.mirror.aliyuncs.com"6 J5 L0 Z$ j6 J. m

: o: ?/ R: m$ ]  X3 }5 P           3.修改 location4 R. a( b7 F  V3 B7 B
                网易:https://hub-mirror.c.163.com/% Y6 a# U; v; W5 A6 z* |% T8 b- G
' R$ A! S  U1 h+ L
                阿里云:https://<你的ID>.mirror.aliyuncs.com, K  h, b/ B+ V
           4.保存8 o) [: s2 G' }; n
配置:1 q  w" g6 t8 ]- t( i  r/ g0 e
, ^1 ]: ^/ B* \4 L

1 D- u& n8 \7 Z0 Q. J7 v3 D3 @' t/ [" d/ S6 Z+ t. ]
  @8 p- X( B7 ]$ y/ w$ d0 @
# 修改podman镜像源
8 M0 f, t. q" ~7 M, K [root@podman ~]# vim /etc/containers/registries.conf& [) I7 H$ l5 |  Y+ ^2 k
unqualified-search-registries = ["docker.io"]  u( X! l3 B+ _2 [
  #podman默认的镜像拉取镜像地址第一个是红帽的,改成docker的  ,下面的也可以不配置:
; O+ C8 R9 \( v3 R1 G  # [[registry]]+ l( G% W$ X- a1 }' i/ u5 d/ v
# prefix = "docker.io"
) a6 p5 x5 b5 b4 V4 @7 r# location = "fi54miqv.mirror.aliyuncs.com", Q& H- Z5 ?% L4 @! x9 h
#试一下
' X3 f$ [  C0 [2 [6 P6 I0 g [root@podman ~]# podman login
7 K- D* W. `' N+ Y Username: **********
. H4 \- y% b. w0 d' [& Q6 z3 g$ f Password: % X2 F. f! I3 v6 Q, n2 N" `* G
Login Succeeded!
- Z% |/ _! ]+ b" x5 @操作! r7 v  R+ Y7 L

+ F/ F' J9 S1 E3 W4 t( s[root@controller containers]# podman pull httpd1 F; j( b& n& m, a& w3 }
Resolving "httpd" using unqualified-search registries (/etc/containers/registries.conf)
$ v# J) `, N: OTrying to pull docker.io/library/httpd:latest...
8 U- Y2 j: N8 D& i( LGetting image source signatures
8 {: g* O5 V8 I0 \& E: E9 o( b4 HCopying blob b7f64f2f8747 done  ; I1 [3 L/ o8 T7 F6 M& ^% Y
Copying blob b7f64f2f8747 done  
/ x" _5 B, [/ ?% a/ T. i% `0 X; hCopying blob 9e8776e4b876 done  & K3 U: [- T( f" g3 h; o
Copying blob bb263680fed1 done  
$ P" \- Y, \& S. dCopying blob f506d7aab652 done  
1 f, }7 m+ A6 l; e' J4 T1 W  D8 ~Copying blob 05289ee4f284 done  
' C: N- U: i) l: v- CCopying config 3a4ea134cf done  8 B8 s" `9 A3 U4 l
Writing manifest to image destination, [2 X) B6 p, E5 H# X8 v
Storing signatures
$ N9 Y, C: M. p5 n$ F5 b- b3a4ea134cf8e081516a776ce184dedc28986f941ed214b9012dc888049480f5a
; e) n* y& v1 n5 a6 G  E" w[root@controller containers]#
9 g$ k4 d" ?2 _  t! |* j[root@controller containers]# podman ps
5 z& X0 t( H# C0 ?( gCONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES4 p% ~' R7 O& u1 H
[root@controller containers]# podman image ls% G1 S1 g( O6 w- P
REPOSITORY               TAG         IMAGE ID      CREATED       SIZE
: f: F' o. Z+ F0 B6 ndocker.io/library/httpd  latest      3a4ea134cf8e  34 hours ago  150 MB
; t8 z2 {9 N  o8 A, o[root@controller containers]# podman  image rm 3a4ea134cf8e
3 f+ O+ R9 ]* j% LUntagged: docker.io/library/httpd:latest
6 U+ M9 Q$ u, l' Q2 nDeleted: 3a4ea134cf8e081516a776ce184dedc28986f941ed214b9012dc888049480f5a8 p/ w: j& j# O6 ~
+ Q5 G+ I8 b0 c# [; R9 u% v: }

  _2 R2 _8 u5 t1 N
8 X% T5 o* s7 Y5 t) B; j [root@podman ~]# podman run -d --name httpd docker.io/library/httpd:latest6 v+ k$ Z9 [! ~# y! F; [# G
2684bce8b0b52a51fe9fbb6081b057e51a3b455da68fedae2a69868607728eab; j! N2 U9 Z# I0 |$ b
[root@podman ~]# podman ps# p2 C" d# ~% b, U) B; `" R
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS            PORTS       NAMES
& i3 t- _4 G6 i; l/ g& i 2684bce8b0b5  docker.io/library/httpd:latest  httpd-foreground  5 seconds ago  Up 5 seconds ago              httpd
3 ~# f( E1 s  Y* I: P& n! d
: D- @9 j1 o7 u, o; Q  Q8 ^. v# _8 g$ r# G* K
[root@podman ~]# podman exec -it httpd /bin/bash$ T, k# V0 M  A. G( s: V
root@2684bce8b0b5:/usr/local/apache2# ' u2 i$ s- m: ^% E- B4 s" h
podman export将容器的文件系统内容导出为 tar 存档6 R* l1 z" r7 y6 o, D0 k
history显示指定图像的9 G( ?: u' |" y( j! q
images列出本地存储中的图像
$ ]8 j  q" \6 l3 o6 o2 p 导入tarball 以创建文件系统映像! O$ U$ R1 g$ N; b. r/ u% H0 p: ?
info显示 podman 系统信息
0 z. A. {) V% }" p2 E; b) ^1 I$ O, s init初始化一个或多个容器3 A% M& j' S. V; k# f9 U- f: C
kill用特定的信号杀死一个或多个正在运行的容器/ C; `# [4 }9 E6 m3 K; ^* ?6 n. B
kube play等) p5 W/ o: J; b# x
logs获取容器的日志、& X. f/ ~. C, f$ m
machine管理 podman 的虚拟机. U5 w8 N$ r6 b  O
manifest创建和操作清单列表和图像索引
9 T" E; e) J! d4 e mount挂载一个工作容器的根文件系统
, {* A/ J6 s' I% A2 ~ pause暂停一个或多个容器中的所有进程% Z* [, ]  }: p/ i
pod管理 pod
+ H9 D2 r. M9 f; w; ^& v3 [6 @ port列出端口映射或容器的特定映射
% d4 v! ~' c/ \, E5 C& A ps列出容器3 f2 U) O. Z7 R$ ^8 h0 S* p
push将图片推送到指定目的地0 z1 w7 a. e. W4 T+ n7 @2 M6 z
rename重命名现有容器
. w3 U/ f! [, l0 L
. O7 v1 b  H: j8 I( r. `. f* j
4 v( z) i  E  L' X

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-2-10 22:10:35 | 显示全部楼层
Podman是一个开源的容器管理工具,语法兼容 Docker,但是某些方面比原生 Docker 命令更好用,比如能够以非root用户的身份去运行容器,而且不需要守护进程。
6 u5 }/ Y7 }- J0 {+ S, q; c9 I, h  ?/ [1 p* S1 N" X5 J
Podman引入了一个注册表的概念,注册表就是包括 ​ ​docker.io​​ 在内的多个容器镜像源,默认的有 redhat docker fedora centos quay。
" C* i7 d. A* p) c! ]2 Q5 P
! P( P; Y+ u0 s$ F3 z% U' a7 {国内直接用 podman pull 拉取镜像会很慢,所以需要配置国内镜像源来加速访问。
3 x0 C+ h6 l' |( u& C/ m4 D' R& ~6 M3 N! P9 T* H
国内的镜像源有以下:
8 U0 v! q0 f0 L- p' c( T5 _. x9 n; b( D
docker官方中国区:  https://registry.docker-cn.com
. @" b9 A" _# n  R5 c* [  \. g网易:             http://hub-mirror.c.163.com5 w: a$ x( [6 K2 Z: x+ E
USTC:            http://docker.mirrors.ustc.edu.cn0 F; b+ i7 s  w4 y% F9 F) y
阿里云:           http://<你的ID>.mirror.aliyuncs.com
3 E& t) _# A0 {3 B* H- \/ {1.+ J" ?  H. d! r$ D. }1 n+ p3 G
2.
* _7 S" V6 o$ d: I8 w! A' d3.
9 N+ L* f( W, \7 d: B  O& k. S% P7 @4.
" q: ^! e& `3 B& c此处我使用的是阿里的镜像源( {0 y$ W# ^5 z% y& j8 `0 z& Q

) k5 v+ T2 n) t# E6 Y* G1.获取阿里的镜像源地址
5 j* a1 d! ^9 m* R8 P# g5 J6 E: `<你的ID>.mirror.aliyuncs.com3 P4 e7 f3 w' @! R0 c6 q" u- x
1.2 e) S0 W1 E0 Z. m0 l
2.修改Podman的注册表配置文件% b" [* G' Z9 E- z5 F7 `9 F
vim  /etc/containers/registries.conf+ Z1 N- i1 m: n
1.6 j! p4 Y' E+ ^, i' H/ j% r3 P  ^
修改内容8 n6 m; _0 ^/ T# K  i, u

. G/ _+ q9 P8 d% f登录后复制
) ~; J9 U5 ]; m7 O2 G( aunqualified-search-registries = ["docker.io"]
  N1 a% N5 @: `- I% v1.
5 W# ?7 }7 S% A  Z3 D: l增加内容/ W- _% `: n! E5 x2 x( x
/ j( C2 Y' j( N' e" c0 B' ]! B
[[registry]]) a/ u. L3 g% _9 c+ ]' L! d: U# c
prefix = "docker.io"
6 N& ?4 z0 p; S4 M7 O! O/ T. X8 jlocation="d1234.mirror.aliyuncs.com"8 w" d( C' Y) Y. j2 S6 a2 y
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 02:10 , Processed in 0.018496 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表