易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 407|回复: 2
收起左侧

linux8系统安装调试podman

[复制链接]
发表于 2023-2-10 21:51:16 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
[root@controller ~]# dnf module list  |grep container-tools
+ u" A3 w7 o" k! ]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.         
+ l# {$ K. }- Fcontainer-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.                                          1 m" m& P* T' F  L) A" T' L
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.            
; M) w+ l3 E0 vcontainer-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.* W! m# n: d7 Y2 K
container-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.3 z# \! {, S* q  n& m0 a& `2 j8 p3 f

9 p2 a4 g4 _9 |+ L  i8 }1 @5 Q% a4 H, J

7 W3 M+ z  ~1 S) E; R' k' g[root@controller ~]# dnf install -y @container-tools
6 Z/ Y& F; b" Z( wLast metadata expiration check: 0:43:52 ago on Fri 10 Feb 2023 09:03:30 PM CST.
. p9 A" R6 T. B
4 H6 \7 i7 j6 n(22/27): python3-chardet-3.0.4-7.el8.noarch.rpm                                   3.1 MB/s | 195 kB     00:00   
7 Y' C8 C# i) k* s5 R- E(23/27): python3-idna-2.5-5.el8.noarch.rpm                                        1.2 MB/s |  97 kB     00:00    : s9 ~4 O0 i" T+ v$ g0 q
(24/27): python3-pysocks-1.6.8-3.el8.noarch.rpm                                   765 kB/s |  34 kB     00:00    & L1 y8 D& i" D7 S
(25/27): python3-requests-2.20.0-2.1.el8_1.noarch.rpm                             2.3 MB/s | 123 kB     00:00    9 h: `8 A4 g  G4 o5 R' Z
(26/27): python3-urllib3-1.24.2-5.el8.noarch.rpm                                  2.9 MB/s | 177 kB     00:00   
  b+ q2 w6 J  W1 l(27/27): gsettings-desktop-schemas-3.32.0-6.el8.x86_64.rpm                        1.9 MB/s | 633 kB     00:00    % e- x  P, z; I1 Q: s+ l
------------------------------------------------------------------------------------------------------------------0 ?& ?, O+ F: a3 Z& D/ k/ s$ o
Total                                                                             8.7 MB/s |  24 MB     00:02     
5 t4 a! z4 K/ l6 R  `# g( oRunning transaction check2 J6 [# |: h6 M+ F3 u& c0 d4 G
Transaction check succeeded.
" r% l+ f3 n9 z1 z" y3 zRunning transaction test
& n8 N8 N2 |4 m4 jTransaction test succeeded.
$ T; W( [2 g- JRunning transaction' ]4 s' f! |6 U) a* z: l
  Preparing        :                                                                                          1/1
# C* B! w6 U; l* L- r  Installing       : fontpackages-filesystem-1.44-22.el8.noarch                                              1/27 & n; ^9 V" P2 m8 o! ~
  Installing       : abattis-cantarell-fonts-0.0.25-6.el8.noarch                                             2/27
, b8 l/ `9 I; e' g+ I7 x  Installing       : dejavu-fonts-common-2.35-7.el8.noarch                                                   3/27 $ d. F' x4 |9 N# ?( @0 I
  Installing       : dejavu-sans-mono-fonts-2.35-7.el8.noarch                                                4/27
$ e0 }: d4 @6 g3 |' v" T' i* b  Installing       : gsettings-desktop-schemas-3.32.0-6.el8.x86_64                                           5/27   O, G0 J# B; z3 W# W
  Installing       : python3-pysocks-1.6.8-3.el8.noarch                                                      6/27
, q- \# K( }$ E& t  Installing       : python3-urllib3-1.24.2-5.el8.noarch                                                     7/27
! c, m" F" I* _  Installing       : python3-idna-2.5-5.el8.noarch                                                           8/27
. K4 z) X" Q# q7 l" E5 h/ U' y  Installing       : python3-chardet-3.0.4-7.el8.noarch                                                      9/27 0 y5 O  I; }/ z0 |& g
  Installing       : python3-requests-2.20.0-2.1.el8_1.noarch                                               10/27
% G+ E: }$ o9 u5 o  Installing       : libmodman-2.0.1-17.el8.x86_64                                                          11/27 8 o% U* Y% u! N. y( t) g1 c( H
  Running scriptlet: libmodman-2.0.1-17.el8.x86_64                                                          11/27 9 i* F" J/ U: `. O$ X& }* u. M0 F# D
  Installing       : libproxy-0.4.15-5.2.el8.x86_64                                                         12/27
9 M, a: p6 O$ B+ }* k5 E  Running scriptlet: libproxy-0.4.15-5.2.el8.x86_64                                                         12/27
3 }3 f' G, l9 n; s1 P. ^9 l& _  Installing       : glib-networking-2.56.1-1.1.el8.x86_64                                                  13/27
! b0 H6 ]9 }3 o: N5 [5 Y9 {; t" A7 m  Installing       : json-glib-1.4.4-1.el8.x86_64                                                           14/27
4 i- a. Z+ a6 W* v( f0 b8 c  Installing       : cockpit-bridge-283-1.el8.x86_64                                                        15/27 9 }1 e2 }0 r3 p6 Q: U/ R4 Z
  Installing       : yajl-2.1.0-11.el8.x86_64                                                               16/27
) Q. Z1 Q5 j  p$ @) l5 u  Installing       : python3-pyxdg-0.25-16.el8.noarch                                                       17/27 " L3 [& e4 N" N& e; v" ~* ?1 F/ t' Q" S
  Installing       : python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                          18/27 , b- \9 Z+ o! M( S7 G, p
  Installing       : aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                             19/27
( a2 {% f8 K+ c) _: t  Installing       : netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                 20/27
0 z5 g7 H4 r; [3 h: H- t  Installing       : buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                 21/27 % K' G) P( Y# g
  Installing       : python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                             22/27
' h# B4 L* D$ ~* Q! C  Installing       : crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                         23/27
" q- ?7 J6 H; k1 ]- N  Installing       : cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                24/27 + Q5 g; j2 _) |: m; I; R
  Installing       : udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                      25/27 + Q, z, W5 W: Y3 l$ d& o
  Installing       : toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                  26/27
' L* ]/ k! G' T  Installing       : skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   27/27
$ i* F# y5 }' x) P( A3 R  Running scriptlet: skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   27/27
+ t$ a/ e- m) D2 A: @# a; a) V  Verifying        : aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                              1/27
# A7 C  J9 B/ @' j! v( i' u) [/ x  Verifying        : abattis-cantarell-fonts-0.0.25-6.el8.noarch                                             2/27 9 Y! a' K4 n$ I/ Q
  Verifying        : buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                  3/27 * M4 u7 J% a9 r& }
  Verifying        : cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                 4/27
7 ~2 D) U0 @+ }3 _  Verifying        : crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                          5/27 + a3 F% M) ?& Q+ x2 R! j2 q
  Verifying        : netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                  6/27
7 B0 m% w6 U( A6 p7 \( r  Verifying        : python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                              7/27
2 i+ A: y: D: f8 G& J1 @  t& I  Verifying        : python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                           8/27
! N( q1 N5 o8 s. X# K* I  Verifying        : python3-pyxdg-0.25-16.el8.noarch                                                        9/27 1 \4 p; \! _* b5 _1 L
  Verifying        : skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   10/27
5 b" |9 U4 X( f$ a8 z  Verifying        : toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                  11/27
5 ]' b+ A- e0 F" p6 p, \  Verifying        : udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                      12/27 : U5 w0 o' q# B/ ?1 Q
  Verifying        : yajl-2.1.0-11.el8.x86_64                                                               13/27 * u! C+ i2 h# b# n
  Verifying        : cockpit-bridge-283-1.el8.x86_64                                                        14/27 " b/ @# j# b8 k9 ^; \+ e' }( O) x
  Verifying        : dejavu-fonts-common-2.35-7.el8.noarch                                                  15/27 & m+ m0 j) k5 V6 }; u
  Verifying        : dejavu-sans-mono-fonts-2.35-7.el8.noarch                                               16/27
/ d/ g6 L' n; X) n1 D
& K; m7 k2 D! S' t% l4 v' Y+ Q* LInstalled:
7 r  C% k  U, I0 e8 b' e8 H  aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                                                      
! N; X7 c/ f+ e% E' i* ~1 n  abattis-cantarell-fonts-0.0.25-6.el8.noarch                                                                     
/ t  @8 E' R, v+ N# r2 o  buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                                         
. J- W. l$ W! F$ Z! F  cockpit-bridge-283-1.el8.x86_64                                                                                 
1 f, d: s. L' P5 L" M# i+ E0 n  cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                                           T1 I7 t4 J0 u. T
  crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                                                  
$ b" i: F' D) y2 L, n  dejavu-fonts-common-2.35-7.el8.noarch                                                                           ) x" {) k, U% l1 {$ B. P" Y6 d) J
  dejavu-sans-mono-fonts-2.35-7.el8.noarch                                                                        
0 v/ b- V4 Z( U7 F4 C- F1 i% _" n- C  fontpackages-filesystem-1.44-22.el8.noarch                                                                      0 `3 o) A; B, v+ J; Q% e
  glib-networking-2.56.1-1.1.el8.x86_64                                                                           7 q, S) w) T* L7 Y
  gsettings-desktop-schemas-3.32.0-6.el8.x86_64                                                                   ' r) j( a% h% h  I: J
  json-glib-1.4.4-1.el8.x86_64                                                                                    
: I2 k0 Q* o, [1 G5 Q( E  libmodman-2.0.1-17.el8.x86_64                                                                                   + p7 G$ e# Z" m0 e) k9 g5 W* l9 l
  libproxy-0.4.15-5.2.el8.x86_64                                                                                 
& o% o8 K% Y9 g& c- c7 y9 ?& w0 j  netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                                          ( n; S" U7 f$ S8 `0 m
  python3-chardet-3.0.4-7.el8.noarch                                                                              $ ~5 X" p- x# q, c' B
  python3-idna-2.5-5.el8.noarch                                                                                   
/ l% L# V, p3 [; a' \( M  python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                                                      
! D7 `( I# Z6 S+ q  python3-pysocks-1.6.8-3.el8.noarch                                                                              & M3 ~5 `% V5 c& i7 x; N
  python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                                                   $ M6 x. Z" {7 V; u; q
  python3-pyxdg-0.25-16.el8.noarch                                                                                  B6 D  U* O# a. C0 S8 \' N' E
  python3-requests-2.20.0-2.1.el8_1.noarch                                                                        . c/ p  A6 e8 o7 d' }, D4 q
  python3-urllib3-1.24.2-5.el8.noarch                                                                             
' P0 F* d" [  Z) ^  skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                                            7 |7 h7 b3 J3 y# o2 X/ P% _3 e
  toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                                           - K5 ^- [% G- k1 x6 `0 R2 c0 D. y
  udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                                               
: A0 [4 t; U) a+ n+ b  yajl-2.1.0-11.el8.x86_64                                                                                        8 L2 c1 ?& b# Q4 D

/ B. }: v8 J& PComplete!; C, G! k3 U" V% y( o9 s- m
[root@controller ~]# * C. w# S: ?0 p7 ^. o4 R3 A  i) I
+ o( v- I2 E+ Z
[root@controller ~]# podman version0 H0 T# B/ ?% }  ^
Client:       Podman Engine) f* Z; Q7 g; ]; K7 O2 R
Version:      4.2.0
0 [' [+ o: ~+ V* L; C* B$ Z/ wAPI Version:  4.2.02 _0 z6 b: b0 ~; v8 l& U
Go Version:   go1.18.4/ R4 D' H1 t+ V' D
Built:        Wed Sep 21 21:15:04 2022
% w2 \; ]- ]5 R0 mOS/Arch:      linux/amd64& ?8 G/ }, @/ h# X7 ^- z4 r. t/ M- D
5 Q" j+ D1 m4 r% S3 Z

# u8 g; `9 K; Q8 A4 l1 g4 h8 ?  T$ a& l+ |" N; w
* P& D7 U% D# g
 楼主| 发表于 2023-2-10 22:07:55 | 显示全部楼层
可以发现,使用方式可以说和 docker 的丝毫不差,不用担心从 docker 切换到 podman 会有不习惯的。如果不习惯使用 podman 命令,可以使用 alias docker=podman 来对docker命令做一个命令映射即可:
0 P( u5 \$ T& A" n2 R% K8 e) I, w6 |8 ^" ~. @8 y% l% |/ I
加速链接获取 详细请阅读docker 基本用法
: e, n9 c4 ?0 a" X( }# X6 ]0 h2 [. u
* ]8 h, q* C: s* `, B: @默认镜像库 文件 /etc/containers/registries.conf 是设置镜像地址配置文件,默认会搜索 ['registry.access.redhat.com', 'registry.redhat.io', 'docker.io', 'quay.io']等几个镜像库
5 T! H% G7 t4 u! H' ?  Tunqualified-search-registries = ["registry.access.redhat.com", "registry.redhat.io", "docker.io"]% B! I2 S9 r4 r7 m
. T9 C+ W( r; I: d. a' `
; ?% d" j  o9 `) r2 Z, h0 E" B
     通常来说,这几个镜像库下载速度非常慢,有时候可能会无法顺利的将镜像拉下来。  b, h9 F# I1 Q% o
4 ~  _" x, F: t$ f6 l
     所以,需要修改修改镜像库配置文件,也就是大家说的镜像加速方案。- B- `% s, _6 ]1 ~
镜像加速
% L: |5 [6 p9 F     只需2个步骤实现镜像加速:5 k5 n0 _; j* }5 }% Z

% f  J8 n; o2 M" Q           1.改名并备份好文件:/etc/containers/registries.conf.bak
) ]( I8 k7 S! d% a ​cp /etc/containers/registries.conf{,.bak}
9 n0 {7 H, e# S/ \6 \
% _" v7 q% F/ b) i6 H/ g9 ?; U" L0 A8 i# t
           2.再新建一个空的 registries.conf 文件,插入如下内容
. x8 M( _: B( [3 K                 unqualified-search-registries = ["docker.io"]
" `. S! {/ p; ?9 a3 `/ L
8 }* n2 Z% G% f& c2 K9 Z5 d           #      [[registry]]) ~5 g4 a! A  R: u3 V8 ]! J7 c
           #       prefix = "docker.io"
  N6 F& c5 m, {- B" J            #      location = "******.mirror.aliyuncs.com": ~1 I/ E) }+ c6 ~. P: _! T3 Q
+ n: j' ^, }2 E0 P5 l) I0 t
           3.修改 location
4 Y+ X' i; x' ~0 o1 M; g( P8 \                网易:https://hub-mirror.c.163.com/3 b% i( U4 a$ M: b- ]

- v) j2 q* n; {, s: @' `; w* Y# b, c                阿里云:https://<你的ID>.mirror.aliyuncs.com. s3 P; \) ]0 `# z; i
           4.保存
+ x$ a: J6 t9 s4 m- M, I/ L: M配置:
/ C! }- c5 m3 ~2 \+ z. m, m, R( o( `# _' l" s# Q
, a& i9 I5 a, W: @5 n2 I
) s# D% d* E; x* i5 |1 y* Q2 s* `

' E+ L& m4 V! M- j% \3 y0 m # 修改podman镜像源
3 c- H: E# y. j9 G7 ? [root@podman ~]# vim /etc/containers/registries.conf
" J' t3 p5 c) r1 D# y& O9 v unqualified-search-registries = ["docker.io"]
# o4 o0 J; ?& S# i+ D: h  #podman默认的镜像拉取镜像地址第一个是红帽的,改成docker的  ,下面的也可以不配置:
; Z! W4 E4 [9 i1 p, j  # [[registry]]
0 Q" q0 Q) F4 i: p# prefix = "docker.io", f& r3 u- X, @1 {( \- \: B
# location = "fi54miqv.mirror.aliyuncs.com"3 M  k: p" r) c' k. w1 Q% }" P
#试一下- y4 k  s* H  ~- c
[root@podman ~]# podman login( q' ~- Y' I' u* h% R5 \
Username: **********' z3 B. ^9 J- p/ O: R  @/ @* |2 E
Password:
8 d+ T. e, ]1 f, L Login Succeeded!
( B  P. R, W% s& p/ p操作7 \3 N, Z) x9 G

* m4 H" u3 i4 }4 {  z1 H[root@controller containers]# podman pull httpd
% [1 b3 F& T5 I7 m# \2 xResolving "httpd" using unqualified-search registries (/etc/containers/registries.conf)
8 O  O: u! @- B4 ?$ ~Trying to pull docker.io/library/httpd:latest...5 j8 X: f3 r% u( L: c6 x( n$ \
Getting image source signatures& P' F! \& V, B( Z, U- f
Copying blob b7f64f2f8747 done  
8 m0 n5 D' n1 s# j: R7 }6 \Copying blob b7f64f2f8747 done  
2 {( R9 R6 p: _) G5 ~/ M9 fCopying blob 9e8776e4b876 done  
: Y7 O2 m2 m2 _Copying blob bb263680fed1 done  7 Q3 X3 f/ {! C  b
Copying blob f506d7aab652 done  + V' g0 D* E- s/ b# s
Copying blob 05289ee4f284 done  
. n4 L: t' v, H" c2 Q; B" d3 V8 eCopying config 3a4ea134cf done  ; {+ j  B/ S+ t: n0 v7 J" A
Writing manifest to image destination* U: L: f" K4 T
Storing signatures
# G2 l* E3 E7 J, A3a4ea134cf8e081516a776ce184dedc28986f941ed214b9012dc888049480f5a  H* R6 u" ?/ W4 o5 c# V9 C% E
[root@controller containers]# " R; |% G6 K8 O: S3 m
[root@controller containers]# podman ps , {* \- d9 l2 x# Z" {
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES1 o* p" c- u* u0 ^) b1 t# L: m' u4 c
[root@controller containers]# podman image ls
; \$ D0 [/ B* Q: y# h+ I; {REPOSITORY               TAG         IMAGE ID      CREATED       SIZE
$ ?3 P6 O# h1 v, N4 Qdocker.io/library/httpd  latest      3a4ea134cf8e  34 hours ago  150 MB, w* {9 R$ }4 [1 h) Y( K
[root@controller containers]# podman  image rm 3a4ea134cf8e ' X$ O4 |/ X! a- B
Untagged: docker.io/library/httpd:latest$ T: a2 M6 x) t7 o
Deleted: 3a4ea134cf8e081516a776ce184dedc28986f941ed214b9012dc888049480f5a& d0 A0 I+ H" g

  ~) P% ?: |2 y8 U6 y
3 s9 z% b* R% }6 C3 x' |
; ]& Z- U, r" ~1 i [root@podman ~]# podman run -d --name httpd docker.io/library/httpd:latest, {7 C; Y# W* T. G+ l4 O: g
2684bce8b0b52a51fe9fbb6081b057e51a3b455da68fedae2a69868607728eab4 {1 b7 Y& L3 K4 Z
[root@podman ~]# podman ps
, k1 z, Y3 @% U, m. D/ A CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS            PORTS       NAMES
4 H% E$ t& K, D, M' H9 Z 2684bce8b0b5  docker.io/library/httpd:latest  httpd-foreground  5 seconds ago  Up 5 seconds ago              httpd. x# S# w, w8 K; d4 N: d2 Y" d
. f" ~# M0 n. O* ~; y! I1 z

9 A$ E0 D0 E/ e5 O; ` [root@podman ~]# podman exec -it httpd /bin/bash1 l" U7 M( ?: N" o: k4 l
root@2684bce8b0b5:/usr/local/apache2# 6 M$ Y5 w, A. G
podman export将容器的文件系统内容导出为 tar 存档
$ t* ?3 n1 s3 l. T history显示指定图像的2 H, b! N  p; @6 `. `' X
images列出本地存储中的图像: ]3 q0 ]6 C! i- O$ v+ S& L6 l) v# T. _& G  e
导入tarball 以创建文件系统映像
, `" S6 Z) F) g. N6 ? info显示 podman 系统信息# \! f0 p, H' |; o1 \
init初始化一个或多个容器
, M8 F7 ^" e7 H' O. V kill用特定的信号杀死一个或多个正在运行的容器
9 P2 g/ p# `3 K' C# u' W kube play等1 `+ P" G6 X# u+ @: w* j
logs获取容器的日志、
- s- }) o# @9 v( a$ T( O machine管理 podman 的虚拟机  w* w; z8 J$ s  N+ H  s: Q
manifest创建和操作清单列表和图像索引
! w7 q2 {" ?2 i* B) m mount挂载一个工作容器的根文件系统9 a% q& p1 [6 E& K
pause暂停一个或多个容器中的所有进程; f* }' R' b' d. i! M7 c6 h; J5 B
pod管理 pod9 C! ^) t; U0 E7 t$ Y
port列出端口映射或容器的特定映射
5 S% g+ P# h" o' }- w ps列出容器
, ^& i3 C9 r9 D& ?* p push将图片推送到指定目的地  W, n6 }6 J. n/ ]' x! d
rename重命名现有容器/ C8 w1 h* Z8 y# n* ?+ X: p  d
8 s1 {, Y2 t3 R; b' P
5 c3 X6 I$ R9 U; M
 楼主| 发表于 2023-2-10 22:10:35 | 显示全部楼层
Podman是一个开源的容器管理工具,语法兼容 Docker,但是某些方面比原生 Docker 命令更好用,比如能够以非root用户的身份去运行容器,而且不需要守护进程。% b8 [; S8 o% Y1 r* n
" e: j% l' u" b0 ?
Podman引入了一个注册表的概念,注册表就是包括 ​ ​docker.io​​ 在内的多个容器镜像源,默认的有 redhat docker fedora centos quay。
9 o, A# I" H+ F8 J0 y
- t( S, ?/ T( _! }, Z0 n国内直接用 podman pull 拉取镜像会很慢,所以需要配置国内镜像源来加速访问。9 A+ H, L# b/ M1 [  n/ `, X% D6 U
4 J) E$ o3 l9 N- G' h% e1 V: K" a
国内的镜像源有以下:
; ]% \; m. j! A: `* l9 T
2 [# ]% @+ B# V+ Y  j1 c" d! Xdocker官方中国区:  https://registry.docker-cn.com# f' l1 K, I6 t$ S" R$ y: L
网易:             http://hub-mirror.c.163.com
) k/ ^9 N" G8 M4 h. B& YUSTC:            http://docker.mirrors.ustc.edu.cn
' A& \, G& w+ z阿里云:           http://<你的ID>.mirror.aliyuncs.com1 q; L, `/ F$ V* @# e( I
1./ C. E/ o$ U. e& Q; {; y
2.
8 x8 @. S" h) @& w# W2 h  j3.  p1 A# k% i$ t
4.
7 W6 K* W: E9 q5 H, v8 ~* ~此处我使用的是阿里的镜像源
- e3 J' [* ^- L" h' u
- K) y5 c) m, k  ?0 z2 o6 b$ `1.获取阿里的镜像源地址
  }, O' y% H0 P+ G9 n2 ?<你的ID>.mirror.aliyuncs.com
, O5 X1 z" h% H/ s3 ^/ g4 N9 O4 C* L1.
+ `- m# l# n  x- h, i2.修改Podman的注册表配置文件
' f0 t5 `! g5 P% Nvim  /etc/containers/registries.conf
! B* i/ f9 s% g1.
0 F) V, u) y" W& b: C& W修改内容
% T, {% `. x6 ]* F3 ^5 q. h+ T( Y! g0 k8 g
登录后复制
0 n6 l+ p7 c: H9 \' [" x  |unqualified-search-registries = ["docker.io"]
# s% J8 m1 l& q1./ R% E  Q* e$ c% U7 ^" e
增加内容, G7 z( y. y$ Z# r3 ^, `9 j7 ~
0 N1 P$ O% b' _; [" p2 _$ f" X
[[registry]]) i* i  C" D2 Q
prefix = "docker.io"( g: E0 }( J& ]* l) r: R
location="d1234.mirror.aliyuncs.com"3 n5 }+ S  g8 F+ c1 c
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 21:38 , Processed in 0.054578 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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