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

linux8系统安装调试podman

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-2-10 21:51:16 | 显示全部楼层 |阅读模式
[root@controller ~]# dnf module list  |grep container-tools
8 f* a7 m/ [6 B$ u- J8 ]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.         ) R; ]- P4 x$ a' N* b4 ~
container-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.                                          
, o  {( `+ _6 r; l& pcontainer-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.            
& |0 j, R$ N$ C  k) B0 I0 Z  zcontainer-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.% |7 A  F/ z: E4 a4 x0 y
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.5 r( S- B, N( F( E8 @7 e

: c* s% Y; F+ F3 l5 M1 O4 G- W  a) `9 }3 Z* w
9 x2 R/ n7 t- L& ~* Z
[root@controller ~]# dnf install -y @container-tools5 e( P) P" R" m- Q9 A) M
Last metadata expiration check: 0:43:52 ago on Fri 10 Feb 2023 09:03:30 PM CST.
4 @+ X" y! x, z3 j, T- \, h8 r( ^
  {" J: q5 y9 B4 k(22/27): python3-chardet-3.0.4-7.el8.noarch.rpm                                   3.1 MB/s | 195 kB     00:00      r9 m2 {8 U+ w6 O
(23/27): python3-idna-2.5-5.el8.noarch.rpm                                        1.2 MB/s |  97 kB     00:00   
( z0 @8 e0 \  C* J& ?(24/27): python3-pysocks-1.6.8-3.el8.noarch.rpm                                   765 kB/s |  34 kB     00:00   
, P$ ?# w( ~# c' R& r0 x  q& O(25/27): python3-requests-2.20.0-2.1.el8_1.noarch.rpm                             2.3 MB/s | 123 kB     00:00    8 |6 v7 I0 p; g1 ^5 z# C8 m4 }& A
(26/27): python3-urllib3-1.24.2-5.el8.noarch.rpm                                  2.9 MB/s | 177 kB     00:00   
) R% k4 Q/ X. N- \% u2 l' G(27/27): gsettings-desktop-schemas-3.32.0-6.el8.x86_64.rpm                        1.9 MB/s | 633 kB     00:00   
! W0 ~0 J: v% e5 @: A$ W4 p) h------------------------------------------------------------------------------------------------------------------
( U9 m$ }# B$ U0 h4 d. l0 v# cTotal                                                                             8.7 MB/s |  24 MB     00:02     
; C1 X# x- m2 j- J& aRunning transaction check
! D6 j! C. T( d1 L- ITransaction check succeeded.
; f: i) a+ ?0 e7 A. z" ?! B. O' _' yRunning transaction test3 L& B4 D: J/ V
Transaction test succeeded.
- P% Y# g2 ~) f8 D( ^Running transaction& b8 v9 D) l+ A+ K/ Y# X' @
  Preparing        :                                                                                          1/1
. N  |0 m! G+ O* k  Installing       : fontpackages-filesystem-1.44-22.el8.noarch                                              1/27
* d! z% t+ N5 l  Installing       : abattis-cantarell-fonts-0.0.25-6.el8.noarch                                             2/27 - g0 Q/ _: @( j! _0 v+ ]1 N5 h
  Installing       : dejavu-fonts-common-2.35-7.el8.noarch                                                   3/27 % R2 o. \6 Z- ^/ f
  Installing       : dejavu-sans-mono-fonts-2.35-7.el8.noarch                                                4/27
0 S8 g; |* q5 T+ h1 [  Installing       : gsettings-desktop-schemas-3.32.0-6.el8.x86_64                                           5/27
$ S9 _6 q; Z# z' }3 V0 X  Installing       : python3-pysocks-1.6.8-3.el8.noarch                                                      6/27
  \4 d5 E$ C# r1 `  Installing       : python3-urllib3-1.24.2-5.el8.noarch                                                     7/27 $ p" O, u7 S+ E# ]7 Z/ B9 x* }5 ^- L
  Installing       : python3-idna-2.5-5.el8.noarch                                                           8/27
8 _4 s1 n, P& v2 Y" @, q  Installing       : python3-chardet-3.0.4-7.el8.noarch                                                      9/27
0 l/ U; D) f+ c  Installing       : python3-requests-2.20.0-2.1.el8_1.noarch                                               10/27 3 ~" U$ ?' D. l6 {9 o* ]8 H
  Installing       : libmodman-2.0.1-17.el8.x86_64                                                          11/27 ; s) d, z2 P! U9 ~8 H$ c0 |
  Running scriptlet: libmodman-2.0.1-17.el8.x86_64                                                          11/27
2 c8 Z$ X+ L! O4 y3 w6 _" I  Installing       : libproxy-0.4.15-5.2.el8.x86_64                                                         12/27 ( X5 ]1 Q% Z. m5 v1 V
  Running scriptlet: libproxy-0.4.15-5.2.el8.x86_64                                                         12/27
( b2 n: R+ Q9 C" @" [3 {  Installing       : glib-networking-2.56.1-1.1.el8.x86_64                                                  13/27 * c! r% l2 R  y$ j! f
  Installing       : json-glib-1.4.4-1.el8.x86_64                                                           14/27
5 x7 J  m  V0 j# Q3 m, {  Installing       : cockpit-bridge-283-1.el8.x86_64                                                        15/27 ! ^* v0 S# N7 P# o8 E6 z% ?* p2 R6 K
  Installing       : yajl-2.1.0-11.el8.x86_64                                                               16/27 : v* c1 _/ Z5 i/ O6 p0 I
  Installing       : python3-pyxdg-0.25-16.el8.noarch                                                       17/27 2 Q  |& N$ t: r. M
  Installing       : python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                          18/27
. ]! n' i. {/ Z  G9 O; T1 ?7 j  Installing       : aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                             19/27
) a) n+ Y' ?( x; F5 b  Installing       : netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                 20/27 7 R) m5 j7 L' \# u, w3 r
  Installing       : buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                 21/27
$ ~% T" L# r; X6 h7 I, N9 v  Installing       : python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                             22/27
, n/ ?. [, ?5 H3 B  Installing       : crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                         23/27 ; v" X- ~: M) g
  Installing       : cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                24/27 ; {+ k* x+ U2 ]3 \3 H* i
  Installing       : udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                      25/27 * F, T: e2 j+ o$ {) H
  Installing       : toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                  26/27
: X& K+ _' ]( [! }$ n) o) w  Installing       : skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   27/27 - N$ E  S% T: `) l# p
  Running scriptlet: skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   27/27 / D4 [3 \. W" L, B) E/ a: Q$ Z
  Verifying        : aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                              1/27 5 P) I# i& g" P! c8 p
  Verifying        : abattis-cantarell-fonts-0.0.25-6.el8.noarch                                             2/27 8 k' {+ ~8 \+ O: {6 J
  Verifying        : buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                  3/27
( N8 T9 a/ ]' a% t1 L  g' B  Verifying        : cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                 4/27
4 ~+ D( _- M! u9 Q  Verifying        : crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                          5/27 $ h/ n! p' K5 F+ E. w/ C
  Verifying        : netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                  6/27
8 U3 y4 X7 y3 c5 T  Verifying        : python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                              7/27 , V7 r: P' M$ z9 m( Z
  Verifying        : python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                           8/27
# C+ H. ^4 d, Z" d* v6 w3 O$ r  {  Verifying        : python3-pyxdg-0.25-16.el8.noarch                                                        9/27
' z/ W, i9 m0 q! p2 I4 s  D" e5 `1 T  Verifying        : skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   10/27
( }- i/ O6 H: y& u# ~  Verifying        : toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                  11/27 ) p& C+ M1 A) Y" T6 V3 k5 N0 K9 R5 o; h
  Verifying        : udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                      12/27
, O% v6 g" ~+ ~) N! D" A  Verifying        : yajl-2.1.0-11.el8.x86_64                                                               13/27
0 x+ o  M% u( o3 v5 l: Z) ^% e: K  Verifying        : cockpit-bridge-283-1.el8.x86_64                                                        14/27 % Q5 j3 L, P" e4 H+ i- m
  Verifying        : dejavu-fonts-common-2.35-7.el8.noarch                                                  15/27
; O0 [7 n8 @% q! \3 w& J3 U2 R  Verifying        : dejavu-sans-mono-fonts-2.35-7.el8.noarch                                               16/27 - v5 |$ F2 J# }& g. {" L2 E
) Y1 O% I+ @; o& H- f# E
Installed:
& @" |& w8 w5 k) ?  aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                                                      3 ]; g* d, W; v- `, O
  abattis-cantarell-fonts-0.0.25-6.el8.noarch                                                                     ) e& N  @( K1 e; x: D$ ^4 b5 ^
  buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                                          # t6 e6 L& E+ B* {6 o; Z
  cockpit-bridge-283-1.el8.x86_64                                                                                 
# y) J/ E  ~& G9 p7 x) N* C: ]  V  cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                                         : g0 Q; E- Q- ?; ?" C8 g
  crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                                                  * D4 j# Y- _& t; S3 E+ r1 u
  dejavu-fonts-common-2.35-7.el8.noarch                                                                           & }. p- L! g0 Q# `4 I. r5 ]( ^
  dejavu-sans-mono-fonts-2.35-7.el8.noarch                                                                        8 M# }5 |) p8 I$ j$ @! P5 a1 L
  fontpackages-filesystem-1.44-22.el8.noarch                                                                      & o) o4 \; u/ b6 M1 d9 h
  glib-networking-2.56.1-1.1.el8.x86_64                                                                           
; b2 @# w& R7 d' @  gsettings-desktop-schemas-3.32.0-6.el8.x86_64                                                                   9 k; o* F8 k# @8 p5 _& E5 _
  json-glib-1.4.4-1.el8.x86_64                                                                                    
$ k. c1 d  Z) a2 {: u  libmodman-2.0.1-17.el8.x86_64                                                                                   ( ?7 u" A/ |8 B: q+ j0 o8 e
  libproxy-0.4.15-5.2.el8.x86_64                                                                                  " _! @# M/ x5 }. x/ W( I
  netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                                         
, _, x# t* F; ?: [/ M  python3-chardet-3.0.4-7.el8.noarch                                                                              
* q. i$ [4 b7 L9 A: H  python3-idna-2.5-5.el8.noarch                                                                                   # H# k0 a5 U0 W& M: L! m. ?3 [
  python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                                                      
1 A6 a! E/ \; j5 H+ n" k% q  python3-pysocks-1.6.8-3.el8.noarch                                                                              
+ V' R# v1 B1 M& F2 y1 j5 K  python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                                                   ; m9 S% j: G! F
  python3-pyxdg-0.25-16.el8.noarch                                                                                # j9 j6 F7 V' m1 e" [- O5 m  j
  python3-requests-2.20.0-2.1.el8_1.noarch                                                                        
  ~) b+ m( q' I% f% s) ~7 F  python3-urllib3-1.24.2-5.el8.noarch                                                                             
: \+ Z8 Q. }, }& a, t  skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                                            9 ]# G* d; |# o& D6 w. t! K( i8 R
  toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                                           
# I! {, {( B5 F) E5 g8 h5 j2 D  udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                                               
- z  ?1 D7 ]7 L2 U% q( u: w  yajl-2.1.0-11.el8.x86_64                                                                                       
; M" X. s9 e2 }7 o+ x$ X$ I* X( }6 Y. a: P+ j# f
Complete!% l9 `3 s, r6 a' F; H1 u, R
[root@controller ~]# : i9 j! p. i$ s2 y5 a3 o

: u+ K9 d8 {1 X[root@controller ~]# podman version
9 F# e% T$ T' i' @, M) U; OClient:       Podman Engine
2 A3 I9 n. G7 m2 j% ZVersion:      4.2.0
; O8 N/ f9 @. f& vAPI Version:  4.2.0, h7 Q. S( y/ x
Go Version:   go1.18.4
1 I$ j2 s+ y. F$ _4 [Built:        Wed Sep 21 21:15:04 20222 [; [* x; s  W2 z8 d
OS/Arch:      linux/amd64% _( T3 I' u4 h7 {; s

: \+ E- i1 x: Z: t- f# s$ \/ l" Q( V& W- C, m9 f" b- \

8 G/ D$ B  G2 @, Y4 W. |& F
- G: o' c7 @7 ^4 J% N( p7 \( A; K9 p

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-2-10 22:07:55 | 显示全部楼层
可以发现,使用方式可以说和 docker 的丝毫不差,不用担心从 docker 切换到 podman 会有不习惯的。如果不习惯使用 podman 命令,可以使用 alias docker=podman 来对docker命令做一个命令映射即可:. d  v: t- F4 Z; N& i" d
3 b( i. j4 ?, M$ p; [
加速链接获取 详细请阅读docker 基本用法
5 i- O4 O) C4 z2 F# N' w* _  n2 }6 \0 B: V- b+ `! M8 k) D
默认镜像库 文件 /etc/containers/registries.conf 是设置镜像地址配置文件,默认会搜索 ['registry.access.redhat.com', 'registry.redhat.io', 'docker.io', 'quay.io']等几个镜像库$ a5 N# P' w, H7 I1 \+ \  }
unqualified-search-registries = ["registry.access.redhat.com", "registry.redhat.io", "docker.io"]
+ f2 a0 ^, P% L  ]+ J4 C3 z9 @( x% x: F" O' C: D" \
0 e7 U! B  p; @: G0 H) t
     通常来说,这几个镜像库下载速度非常慢,有时候可能会无法顺利的将镜像拉下来。
% Y' h' @8 @/ Q* o5 z8 D! M$ o( {& Q
     所以,需要修改修改镜像库配置文件,也就是大家说的镜像加速方案。
  U2 H: ?( b$ R镜像加速, N. c% ?: A) y4 U* @
     只需2个步骤实现镜像加速:! A3 D( N$ @8 {5 @
* d+ y; I  N, z- j
           1.改名并备份好文件:/etc/containers/registries.conf.bak
8 ]4 e& T2 }! {5 N4 }" o  C- \# k2 C ​cp /etc/containers/registries.conf{,.bak}; Z4 M) I: i( m3 K
4 M" ]4 O  `/ J3 `9 P: ]9 {
/ Z: o+ X$ D1 q5 Z. F& ^) R
           2.再新建一个空的 registries.conf 文件,插入如下内容
( N" ~. W# P3 ~                 unqualified-search-registries = ["docker.io"]% w# g. N9 g( G# h6 f; _7 h1 o

) T  H$ l4 t) j4 E           #      [[registry]]" F; w8 _) r; A; p1 V! H" i' ]* ]0 ^
           #       prefix = "docker.io"
6 n# E* j, B' F& I9 r( i            #      location = "******.mirror.aliyuncs.com"
, r) U1 L0 L2 B+ {
/ B& e* M, w( U; G4 _, i' t* k           3.修改 location  f7 ~0 T: d( }' z7 h) V
                网易:https://hub-mirror.c.163.com/; P8 y* t4 H! W
2 x  T7 g. L& _# I
                阿里云:https://<你的ID>.mirror.aliyuncs.com) M9 h7 l% f  I) w% s2 h
           4.保存3 ^5 v5 P; b, l5 u3 i2 I) c+ S) {
配置:
$ m+ ?) M* s4 X& F' B; x3 ^6 g6 o6 b# f+ G8 Y( O% n

% L3 Q5 g. |$ ~" v/ y* \0 k( M
( r# Q6 Q; R' y8 W. g$ v1 Q. V/ `, `8 N0 q# `$ y, p% }4 r
# 修改podman镜像源, w3 f: q; l! _, J# Y9 K$ w% P
[root@podman ~]# vim /etc/containers/registries.conf
% e" t7 [; G6 u" N9 P* H unqualified-search-registries = ["docker.io"]
& Q# g) t: m  W& g8 T  #podman默认的镜像拉取镜像地址第一个是红帽的,改成docker的  ,下面的也可以不配置:4 ]  z* ~7 A. [' P
  # [[registry]]3 f- a, e+ Z. _- q
# prefix = "docker.io"8 b6 `7 Z: I$ k, s' k8 c0 L+ b
# location = "fi54miqv.mirror.aliyuncs.com"
2 ~' E3 f, K# ~/ V7 v+ }+ p #试一下* o3 g$ |2 q6 A/ s: r7 W
[root@podman ~]# podman login* h; _, y9 L! S3 @1 G
Username: **********
' C6 R: y6 q; f6 y Password:
8 m) ~; j6 F/ F1 s1 v& B  m3 t$ _! b) D Login Succeeded!. y8 U" B* v+ A
操作) N( e+ g8 M8 Y( w7 `; p- r+ E

" q" @" v- ^$ p* ~[root@controller containers]# podman pull httpd1 Z. _3 H' b* m+ h+ Z+ i
Resolving "httpd" using unqualified-search registries (/etc/containers/registries.conf)# U7 f% R& D- ]0 R# f3 N: J9 z
Trying to pull docker.io/library/httpd:latest...& x/ s# A, |0 b  l7 h/ m( I
Getting image source signatures$ e  f0 C, a0 [, c9 n* x2 v% A
Copying blob b7f64f2f8747 done  7 c3 M- V% K* d* A8 H- t
Copying blob b7f64f2f8747 done  
* w. H1 V8 D% DCopying blob 9e8776e4b876 done  # e# u% ~3 z3 U( K& ]3 F( J- w# R. o
Copying blob bb263680fed1 done  7 i# f3 J4 x9 P2 s/ |) q9 X
Copying blob f506d7aab652 done  5 ?2 O4 O5 L8 G6 F; Y: L
Copying blob 05289ee4f284 done  
, O* `0 v: \% N/ J) E0 iCopying config 3a4ea134cf done  4 R8 {2 m1 f1 _$ F- ?5 N5 ]+ o
Writing manifest to image destination& y* z% t/ j% [7 J$ P
Storing signatures4 f0 t2 T6 D2 S  ^# R( t
3a4ea134cf8e081516a776ce184dedc28986f941ed214b9012dc888049480f5a% r" ~0 M' |) J3 z/ E( h9 u
[root@controller containers]#   i: |2 [2 c7 W2 \
[root@controller containers]# podman ps
5 B6 S; H7 b' T# \3 FCONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
/ g. {  [7 K1 o9 K& [1 [  h* ^[root@controller containers]# podman image ls
! E) |. s' i. G8 `( ~REPOSITORY               TAG         IMAGE ID      CREATED       SIZE
! H9 ]8 I; d, K& zdocker.io/library/httpd  latest      3a4ea134cf8e  34 hours ago  150 MB
- T  Z2 V$ L; F  S5 y# @[root@controller containers]# podman  image rm 3a4ea134cf8e
4 S  P! X2 u) Z5 B; {, YUntagged: docker.io/library/httpd:latest
+ U, M5 L. u+ c8 U; d' J9 F0 {Deleted: 3a4ea134cf8e081516a776ce184dedc28986f941ed214b9012dc888049480f5a
" y8 G: h2 {5 S; V; }/ D6 Z
& P5 V' F5 x  c* O! T/ [( H
) ^4 J4 j, w. ^: U* D. @) T2 ~. W3 J8 \
[root@podman ~]# podman run -d --name httpd docker.io/library/httpd:latest
* f" J8 W) H0 @* U& @5 S- U$ z! e 2684bce8b0b52a51fe9fbb6081b057e51a3b455da68fedae2a69868607728eab7 A6 [9 J* m, B5 H: x" M0 l7 v: ~/ r/ v
[root@podman ~]# podman ps
  d+ [3 r+ r4 `0 D8 ]% r8 G4 C CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS            PORTS       NAMES) ]. m7 ?- Q! }$ E5 P5 E2 M
2684bce8b0b5  docker.io/library/httpd:latest  httpd-foreground  5 seconds ago  Up 5 seconds ago              httpd
; W& E- ^1 f3 H* r4 T9 i; ~
$ ?; K! g: U& _- l+ Q' }1 K! H2 J$ T  A) u) t9 W: D
[root@podman ~]# podman exec -it httpd /bin/bash" @3 c7 K0 t. `/ r! s. x
root@2684bce8b0b5:/usr/local/apache2#
. b& }( ^  s, D: Z( u4 l# w" E6 ?2 l' [ podman export将容器的文件系统内容导出为 tar 存档
3 Z+ q" B6 r6 c+ F2 E history显示指定图像的
5 P1 u! m, w8 W6 L% C. w images列出本地存储中的图像
. @1 g3 A+ b3 S# K  Z9 d 导入tarball 以创建文件系统映像
: _* X; ^( U* f" i1 a9 _) [; P3 q4 c info显示 podman 系统信息+ G3 v% S$ P% ]
init初始化一个或多个容器
' O& _& T1 ?0 J' D" t kill用特定的信号杀死一个或多个正在运行的容器
. b" ^- m8 M5 A2 e kube play等# E, [. O5 `% O- K* R1 O% V, n. G
logs获取容器的日志、
5 K/ g' C- J- c' K machine管理 podman 的虚拟机) y3 F. X, s* A) x9 U- Y9 k/ G
manifest创建和操作清单列表和图像索引
0 M) k! ^- g& w$ d% e mount挂载一个工作容器的根文件系统4 L1 M! u: t0 H0 U
pause暂停一个或多个容器中的所有进程
% J7 _; C% }5 A$ N+ `. p  c, i pod管理 pod
3 Z% d7 _+ S5 \6 U1 O, U port列出端口映射或容器的特定映射) B8 ]. V3 ?  U$ v
ps列出容器( I% P/ m8 O$ C: E) O
push将图片推送到指定目的地
* J5 p9 x  i. w# E; [6 |6 F rename重命名现有容器
0 H9 y! o) D  I; g/ B
- h9 w( F" G3 w( o! b' K
6 L1 Y* O0 P( P/ w" ^$ I

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-2-10 22:10:35 | 显示全部楼层
Podman是一个开源的容器管理工具,语法兼容 Docker,但是某些方面比原生 Docker 命令更好用,比如能够以非root用户的身份去运行容器,而且不需要守护进程。" ^8 c7 T5 a4 s4 o& o

6 S! @3 ?* Q7 LPodman引入了一个注册表的概念,注册表就是包括 ​ ​docker.io​​ 在内的多个容器镜像源,默认的有 redhat docker fedora centos quay。( ?, n9 p7 J2 k

" O7 S/ M0 L2 R1 O国内直接用 podman pull 拉取镜像会很慢,所以需要配置国内镜像源来加速访问。
& X; O: {5 c1 q9 L8 f5 x" o: l7 s2 B  M3 {
国内的镜像源有以下:
  c; o9 _$ i8 F) w3 }9 X% W3 ~# k
docker官方中国区:  https://registry.docker-cn.com8 h& u8 L$ i* c) V
网易:             http://hub-mirror.c.163.com- Y$ W3 ~0 K  p5 R  @
USTC:            http://docker.mirrors.ustc.edu.cn
1 m- O7 {  f* H- w1 W阿里云:           http://<你的ID>.mirror.aliyuncs.com
  e) G2 O- t+ D( x1 m1.
" q8 M$ \2 b; M5 S6 l2 p2.8 a- q, `/ c8 @2 g0 I; M/ ~
3./ @/ S4 Q6 ]: Y: k% e
4.2 A* D5 q& y5 M3 _$ O# p
此处我使用的是阿里的镜像源! n3 G; H4 v* c" p% F
2 c$ Q8 l: }5 p7 |  {( p: d, A
1.获取阿里的镜像源地址/ i/ q& `/ L0 ?+ m: b# G
<你的ID>.mirror.aliyuncs.com  n8 s5 X  ?) g% J, |7 F
1.# F1 s: o" |# U6 q: Y6 Q1 J
2.修改Podman的注册表配置文件9 J# ~8 z0 W/ a; X+ ]3 [% J1 q
vim  /etc/containers/registries.conf
' z, g0 Q) u# Q: m9 t1.
" b& [8 q3 X: A$ a* u修改内容
  M. B7 h2 h( C% E# D% |+ Z; d, r4 x( s( H' }9 ~$ H. P# z: W
登录后复制
6 W$ ?. d5 @4 G. v$ J+ k0 H; n# x0 Dunqualified-search-registries = ["docker.io"]
( Q: C; _2 F/ N2 c! ^6 N1.9 R% p3 l1 i8 a4 Q4 d' m1 M5 [
增加内容+ r, r4 i5 I: p3 \" A* F
; ?* p% s  \* O7 }6 r
[[registry]]; K; u; x) G8 H! P  \
prefix = "docker.io"
3 ^/ |0 P' ]  j6 O3 \! R' Ulocation="d1234.mirror.aliyuncs.com"2 W. N" {/ q) O: B1 [
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 04:23 , Processed in 0.017242 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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