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

linux8系统安装调试podman

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-2-10 21:51:16 | 显示全部楼层 |阅读模式
[root@controller ~]# dnf module list  |grep container-tools
! P& \" t% e' I; W/ B4 [1 S0 ccontainer-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.         
! m  e& Q3 N. U) v0 S  p6 f; w; N9 [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.                                          1 F6 R' _& L* M9 l' j) B) 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.            
% Y" q& G/ y5 xcontainer-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.
( X9 Z: {2 P9 E% E: Vcontainer-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.
1 R, ^5 ]3 E+ f+ R( z5 w% T
2 Y5 W1 `: g3 {3 p0 q! h8 c/ d
, l: u/ k. D" t" S$ }
1 h) V4 F- C1 c+ O5 @* x2 b9 y: F: N[root@controller ~]# dnf install -y @container-tools- |' ?+ _* Z# z) i) ?
Last metadata expiration check: 0:43:52 ago on Fri 10 Feb 2023 09:03:30 PM CST.
/ m) N2 O. c5 T# ]. J" s
4 Q( j/ i# J) f% J) V; X( y+ f. Z(22/27): python3-chardet-3.0.4-7.el8.noarch.rpm                                   3.1 MB/s | 195 kB     00:00   
# P* ?3 x2 @2 G' v$ d(23/27): python3-idna-2.5-5.el8.noarch.rpm                                        1.2 MB/s |  97 kB     00:00    # e' p/ m7 ]: p  ^, `6 Z2 e2 z
(24/27): python3-pysocks-1.6.8-3.el8.noarch.rpm                                   765 kB/s |  34 kB     00:00   
& P  E% |5 m7 l6 Z+ ?: ?4 [(25/27): python3-requests-2.20.0-2.1.el8_1.noarch.rpm                             2.3 MB/s | 123 kB     00:00    % z7 m% b2 z6 U3 z( V3 \
(26/27): python3-urllib3-1.24.2-5.el8.noarch.rpm                                  2.9 MB/s | 177 kB     00:00    ! T( d6 U4 N: e- m/ `
(27/27): gsettings-desktop-schemas-3.32.0-6.el8.x86_64.rpm                        1.9 MB/s | 633 kB     00:00    1 t( f- L) u& _( ^. e5 i
------------------------------------------------------------------------------------------------------------------
& R' U% p+ w0 sTotal                                                                             8.7 MB/s |  24 MB     00:02     
8 w9 {5 u5 S  j- ?$ }3 x4 ^  ]1 KRunning transaction check
  t8 p( ^% }% j# Q6 rTransaction check succeeded.
$ J4 e" d$ Z/ s- V5 iRunning transaction test
2 x6 }% k4 {6 t1 ]Transaction test succeeded.8 b* w3 d) A) Q7 V
Running transaction7 g# t8 l! o7 c% \5 j
  Preparing        :                                                                                          1/1 9 x! f' M2 {5 u1 S5 P
  Installing       : fontpackages-filesystem-1.44-22.el8.noarch                                              1/27 4 ^/ e; H' T- ?4 Q2 ^
  Installing       : abattis-cantarell-fonts-0.0.25-6.el8.noarch                                             2/27 , r9 c4 O( a, [
  Installing       : dejavu-fonts-common-2.35-7.el8.noarch                                                   3/27 " u$ s% f# ]) I7 X1 Q$ x- {: z1 H
  Installing       : dejavu-sans-mono-fonts-2.35-7.el8.noarch                                                4/27 7 Q0 K: D/ F. m9 K8 d1 I5 L
  Installing       : gsettings-desktop-schemas-3.32.0-6.el8.x86_64                                           5/27 9 J7 `7 a$ x' w, m  t; y0 Q
  Installing       : python3-pysocks-1.6.8-3.el8.noarch                                                      6/27 $ d2 i2 _% k9 X. r. z
  Installing       : python3-urllib3-1.24.2-5.el8.noarch                                                     7/27
8 P  u: w6 {! e' g. v  Installing       : python3-idna-2.5-5.el8.noarch                                                           8/27
: R+ v% X( }! [+ \  Installing       : python3-chardet-3.0.4-7.el8.noarch                                                      9/27 ! i% P2 O2 V* D' x0 X) C
  Installing       : python3-requests-2.20.0-2.1.el8_1.noarch                                               10/27
8 N% W3 r. W  t5 R4 Q  Installing       : libmodman-2.0.1-17.el8.x86_64                                                          11/27 2 f$ ?2 X& E' _( k8 a6 K( z& ]
  Running scriptlet: libmodman-2.0.1-17.el8.x86_64                                                          11/27
3 B3 M" b- D* c" l- m2 {8 o  Installing       : libproxy-0.4.15-5.2.el8.x86_64                                                         12/27   ~$ z4 h& @. }
  Running scriptlet: libproxy-0.4.15-5.2.el8.x86_64                                                         12/27
% M4 y. F- m0 v- q! a: q- \& M  Installing       : glib-networking-2.56.1-1.1.el8.x86_64                                                  13/27 0 p/ Y: D6 ]% R& j  `7 Y
  Installing       : json-glib-1.4.4-1.el8.x86_64                                                           14/27
, g5 I8 z9 G8 a2 W8 `  Installing       : cockpit-bridge-283-1.el8.x86_64                                                        15/27 " c* k: r; M9 ^4 H7 N7 i
  Installing       : yajl-2.1.0-11.el8.x86_64                                                               16/27
: `% P: i+ A" N' R, L3 C" c6 A. j  Installing       : python3-pyxdg-0.25-16.el8.noarch                                                       17/27   d" R# J2 s1 O
  Installing       : python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                          18/27 $ g8 x" Q/ y  H
  Installing       : aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                             19/27 - W, w" X8 a' X
  Installing       : netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                 20/27 $ K; z& |" \$ |6 w. @7 O7 O: L
  Installing       : buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                 21/27
2 k5 {, m% h4 g) @* T$ c  Installing       : python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                             22/27 # i$ J2 J& A8 |5 K
  Installing       : crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                         23/27 7 ?/ Y" O: s1 _7 N+ }( U1 M! V% d
  Installing       : cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                24/27
: m: x  T/ N6 [0 W) T. f4 z  Installing       : udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                      25/27
2 K7 k' I) s% `6 p9 u  Installing       : toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                  26/27
9 Q% W1 D0 v7 h/ s  Installing       : skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   27/27 2 X/ v2 J2 a% Q  g
  Running scriptlet: skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   27/27
$ D& W, k* l* A  Verifying        : aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                              1/27
8 F5 ^% Y7 {' s7 f2 g  Verifying        : abattis-cantarell-fonts-0.0.25-6.el8.noarch                                             2/27
- a, [) D/ [/ I: U- R, b  Verifying        : buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                  3/27   r4 O2 A: c7 S- @, v5 J2 i3 Q! d4 d! ?
  Verifying        : cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                 4/27 . j0 p$ M1 X, c4 ~; a" I
  Verifying        : crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                          5/27
% x1 K4 e4 c( P" |+ o  Verifying        : netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                  6/27 % E& @  |) T- y4 ~3 F8 B
  Verifying        : python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                              7/27 & U7 D. |( k: J8 `5 a
  Verifying        : python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                           8/27
; j& g0 p8 Q/ ?6 C' _! [  Verifying        : python3-pyxdg-0.25-16.el8.noarch                                                        9/27 8 f  B/ p+ G  j
  Verifying        : skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                   10/27 ; _5 l# t3 o$ S0 u
  Verifying        : toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                  11/27
% W7 Z% V+ e8 K3 \2 }  Verifying        : udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                      12/27
$ y  u, k8 s! k' i8 x0 K* H; M  Verifying        : yajl-2.1.0-11.el8.x86_64                                                               13/27
) t1 c, c7 g- F  Verifying        : cockpit-bridge-283-1.el8.x86_64                                                        14/27 ; O6 w$ N( S1 Y; F. m
  Verifying        : dejavu-fonts-common-2.35-7.el8.noarch                                                  15/27 0 x0 S. n( k, R6 @3 N  y
  Verifying        : dejavu-sans-mono-fonts-2.35-7.el8.noarch                                               16/27   ~( t& f5 g) ]! e  B0 q8 `% F  w* ~
6 v: k: ~: ]7 o" o0 E8 H
Installed:
) }6 @3 k* T! a  aardvark-dns-2:1.1.0-4.module_el8.7.0+1216+b022c01d.x86_64                                                      ( T; [" |! |- v9 C0 r3 O+ t
  abattis-cantarell-fonts-0.0.25-6.el8.noarch                                                                     2 q/ Q# t! e$ R. t7 F+ p
  buildah-1:1.27.0-2.module_el8.7.0+1216+b022c01d.x86_64                                                         
8 G  n0 h$ i& q# k  cockpit-bridge-283-1.el8.x86_64                                                                                 * d" t" M3 g/ @. m5 ]% W: H4 P8 r
  cockpit-podman-53-1.module_el8.7.0+1216+b022c01d.noarch                                                         6 O4 L$ b/ a3 o3 r, f( C
  crun-1.5-1.module_el8.7.0+1216+b022c01d.x86_64                                                                    e  [3 D2 ?4 d( r' z1 {/ C
  dejavu-fonts-common-2.35-7.el8.noarch                                                                           
, N! W- _# T, c  B  dejavu-sans-mono-fonts-2.35-7.el8.noarch                                                                        & m5 s6 U) d0 o# Q, {
  fontpackages-filesystem-1.44-22.el8.noarch                                                                      : ~. m1 S* a( ?, O2 \( h
  glib-networking-2.56.1-1.1.el8.x86_64                                                                           4 N3 N, R* T% r
  gsettings-desktop-schemas-3.32.0-6.el8.x86_64                                                                   $ F  d* L  ?# O% k
  json-glib-1.4.4-1.el8.x86_64                                                                                    9 k9 @, R0 u8 q9 B% r
  libmodman-2.0.1-17.el8.x86_64                                                                                   4 p8 h& Z3 ?! g4 E- A4 o
  libproxy-0.4.15-5.2.el8.x86_64                                                                                 
. V. S: L6 B7 k  netavark-2:1.1.0-6.module_el8.7.0+1216+b022c01d.x86_64                                                         
. h: I: ?# D9 b4 ~  python3-chardet-3.0.4-7.el8.noarch                                                                              7 b9 G! L' R: B9 p8 i
  python3-idna-2.5-5.el8.noarch                                                                                   
5 l% Q1 Y& m$ u; Y  h  python3-podman-4.2.0-1.module_el8.7.0+1216+b022c01d.noarch                                                        K+ _8 U: ]5 t% t. b
  python3-pysocks-1.6.8-3.el8.noarch                                                                              - _" Z; z; X. S
  python3-pytoml-0.1.14-5.git7dea353.el8.noarch                                                                   6 i& ~4 `. b1 ~- ?  v/ o7 s4 e
  python3-pyxdg-0.25-16.el8.noarch                                                                                
: U2 K# c6 s5 ^- h  python3-requests-2.20.0-2.1.el8_1.noarch                                                                          U$ S* i; |2 m4 g& N
  python3-urllib3-1.24.2-5.el8.noarch                                                                             
9 }" k3 ~% a1 E; l) ~: S  skopeo-2:1.9.2-1.module_el8.7.0+1216+b022c01d.x86_64                                                            
6 y7 U+ M8 t2 E) B9 c  toolbox-0.0.99.3-1.module_el8.5.0+877+1c30e0c9.x86_64                                                           & Q& c3 b* Z9 u; |7 D9 |4 O
  udica-0.2.6-3.module_el8.7.0+1216+b022c01d.noarch                                                               3 H, x3 d2 p3 ^
  yajl-2.1.0-11.el8.x86_64                                                                                        / p" {3 b$ Z" D. p) w2 r7 U. i

8 f5 l& U# z$ p  T6 pComplete!
4 d. Y# k& h2 Y* z3 H% s9 q: N[root@controller ~]# 8 I8 L; W" H. S* \
. Y- t  r/ E) c; L2 z" R
[root@controller ~]# podman version$ E/ z8 M) K! @
Client:       Podman Engine0 }. K) Z5 L  C
Version:      4.2.01 {8 V# z! J# @$ J
API Version:  4.2.0: M7 A  @9 K$ {, T" D' Y
Go Version:   go1.18.4* X% d, a2 J* g( s) @
Built:        Wed Sep 21 21:15:04 2022
# m8 O" t" X% a; lOS/Arch:      linux/amd64
5 K$ G3 X$ D: A% C( \' ~* s0 ?+ T7 g" H: h: V, J$ L" v

; ?( u3 m8 g' D3 x4 j) ^
+ r3 }9 g; P" v* x9 m5 q: i/ X- x! d# h& b

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-2-10 22:07:55 | 显示全部楼层
可以发现,使用方式可以说和 docker 的丝毫不差,不用担心从 docker 切换到 podman 会有不习惯的。如果不习惯使用 podman 命令,可以使用 alias docker=podman 来对docker命令做一个命令映射即可:( v! ^% A6 n6 `8 A# ^. ?
( d, Q# L: F% d/ I
加速链接获取 详细请阅读docker 基本用法
0 b( q  X3 M' |% O1 B6 T" q  ~& c# q# E! l1 y% F$ K/ l3 s0 M
默认镜像库 文件 /etc/containers/registries.conf 是设置镜像地址配置文件,默认会搜索 ['registry.access.redhat.com', 'registry.redhat.io', 'docker.io', 'quay.io']等几个镜像库
( f. G% T6 P. N6 o% S4 Punqualified-search-registries = ["registry.access.redhat.com", "registry.redhat.io", "docker.io"]
& H9 k( I, t* ?8 H9 a/ a* p4 [. b
/ Z" G4 F8 H% w
  m- o- Y+ `- w1 ?2 t     通常来说,这几个镜像库下载速度非常慢,有时候可能会无法顺利的将镜像拉下来。, w& M8 ^& ^* p1 G9 C
7 b( Q9 P6 ]7 t( r# b) V3 d; N
     所以,需要修改修改镜像库配置文件,也就是大家说的镜像加速方案。
4 N" e: T( N: V2 s' F5 u( ?4 c镜像加速
$ v. j2 _! D" |- [8 j8 K1 W; r     只需2个步骤实现镜像加速:
. s! K4 Z9 O* v# r& o( h. c6 O8 _; L' y  `9 d7 ]: B6 J
           1.改名并备份好文件:/etc/containers/registries.conf.bak6 M4 F: |# j) \5 ^
​cp /etc/containers/registries.conf{,.bak}2 D  d- ?! l8 F% ^

0 V% U- t0 }: ~3 V% L. u* ?# y  f1 o
           2.再新建一个空的 registries.conf 文件,插入如下内容
/ }/ p( B1 U3 h                 unqualified-search-registries = ["docker.io"]
4 d: e, J# N8 [% K
8 i* f( i! Q9 i6 {. C+ X( F7 e           #      [[registry]]' i, G# |# x" ]  A0 C# h* e
           #       prefix = "docker.io"
) _# [! {8 W! `6 f- T            #      location = "******.mirror.aliyuncs.com"" a' d' H" |9 b4 \4 z' ?( K  n
0 i' m" Z" {2 \" N
           3.修改 location
4 u$ e$ b. \0 ~- l9 V7 z& o                网易:https://hub-mirror.c.163.com/
6 i  ?2 a2 [* _
; f7 Y6 l' l$ L. a/ a                阿里云:https://<你的ID>.mirror.aliyuncs.com' S. D$ D8 H  I/ J- }' g3 z
           4.保存  O  g/ y$ a% [- e- P4 H0 j& r
配置:) g! t2 r: {6 J
; _4 a& _3 g" W$ y+ h
0 ~, `5 l& Y* f+ _3 [8 P7 @# ]
: G% M8 O2 u! P( i# F: |
4 ]. M; t* Q8 P
# 修改podman镜像源9 ]* n* w9 v: i* z( Z
[root@podman ~]# vim /etc/containers/registries.conf' i. O: Q( B! L( t. }
unqualified-search-registries = ["docker.io"]/ _2 A5 }# E, b: G( a5 ]9 I" Q
  #podman默认的镜像拉取镜像地址第一个是红帽的,改成docker的  ,下面的也可以不配置:0 u% I/ a& h5 t2 v
  # [[registry]], a- s( n+ `4 V, w
# prefix = "docker.io"
/ D1 D* U3 D3 [3 E( b( T# location = "fi54miqv.mirror.aliyuncs.com"
) y, ]7 t3 h9 ^, w% z# N8 f #试一下( V  T5 Y$ a1 a. O1 N3 ?* w$ ^
[root@podman ~]# podman login
5 n, A% C5 C9 [2 p Username: **********) q+ o4 X" Q# o" j; \
Password: ! x! V7 C3 `. ^; C" E. {. [. _
Login Succeeded!. X+ }1 E+ k. C/ Y# n  W# D1 f/ h' {5 r
操作
  r. K6 W# l5 S$ ~7 j# W
% W, J0 z3 i1 q8 g# H[root@controller containers]# podman pull httpd" _7 c1 c1 i7 C
Resolving "httpd" using unqualified-search registries (/etc/containers/registries.conf)5 Q5 {* @* C3 H# W
Trying to pull docker.io/library/httpd:latest...+ m5 ~8 T" Q9 a
Getting image source signatures, ^5 i7 o+ C$ _* c7 ^0 V7 e
Copying blob b7f64f2f8747 done  * P0 X2 r3 \0 R' d$ Q6 `
Copying blob b7f64f2f8747 done  
$ }3 f- w  e4 S/ c" u+ g! W9 o( ?Copying blob 9e8776e4b876 done  
; \6 n1 \# h- `6 s* L# P) P( SCopying blob bb263680fed1 done  
- ]& ?) B9 P4 H- F' A7 {Copying blob f506d7aab652 done  
0 z0 G  k0 A& S2 _8 t( jCopying blob 05289ee4f284 done    L6 q# s3 g7 R/ s, q' V
Copying config 3a4ea134cf done  
9 K& ]4 _  ~/ q! NWriting manifest to image destination
$ ?" _# n& R# S( G& q* X) t7 Z9 m. ?Storing signatures
+ x4 G+ m$ T7 @/ ^% B+ s& ^3a4ea134cf8e081516a776ce184dedc28986f941ed214b9012dc888049480f5a
* x( X: k! M" M1 m+ n[root@controller containers]# 5 c9 Y) t" V/ m& }2 x
[root@controller containers]# podman ps 7 ^2 I, A1 B3 b  F5 D4 B& R
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES/ A0 w. }# X( w' h
[root@controller containers]# podman image ls
  x. q+ m) P6 @# o0 wREPOSITORY               TAG         IMAGE ID      CREATED       SIZE
) \: H: |7 K3 }8 }docker.io/library/httpd  latest      3a4ea134cf8e  34 hours ago  150 MB
% P! F$ s- H1 H/ p1 F3 `' n, q[root@controller containers]# podman  image rm 3a4ea134cf8e - c: G  f8 l) e) y) m6 F
Untagged: docker.io/library/httpd:latest
  x8 f5 ^$ L0 ~2 f1 r+ pDeleted: 3a4ea134cf8e081516a776ce184dedc28986f941ed214b9012dc888049480f5a
+ U* S/ D/ B' b" Y3 u* u
* J& L) h/ T* K' O: i
- a' M4 O" [. J" L% B( A8 I) L4 n- \+ ]- m
[root@podman ~]# podman run -d --name httpd docker.io/library/httpd:latest; S3 R+ |2 h" G! ]  D
2684bce8b0b52a51fe9fbb6081b057e51a3b455da68fedae2a69868607728eab
/ j* R! m" ^( g" F  W [root@podman ~]# podman ps) Z' N( T0 z, j, X
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS            PORTS       NAMES( Y& n. H/ C  w) D7 s: n6 Z
2684bce8b0b5  docker.io/library/httpd:latest  httpd-foreground  5 seconds ago  Up 5 seconds ago              httpd
  |3 u  Y+ J+ z, z- L0 L1 ?2 E
7 f! G% t6 _2 _* E+ n$ L+ F; \( G& z9 o2 l
[root@podman ~]# podman exec -it httpd /bin/bash
" e9 [. |- v# n! W$ a( @+ o root@2684bce8b0b5:/usr/local/apache2#
/ }& y3 h. g! C* p podman export将容器的文件系统内容导出为 tar 存档  i  b. @8 [& M. M7 |3 [! l2 X: ?
history显示指定图像的3 A( S3 a4 G. f- y
images列出本地存储中的图像
4 G1 F9 n+ p  k% j7 v 导入tarball 以创建文件系统映像
3 q1 t" m, R8 r7 n( d+ } info显示 podman 系统信息0 g' ?! j+ y, X% t
init初始化一个或多个容器
0 l5 B6 E0 j7 L4 p kill用特定的信号杀死一个或多个正在运行的容器
$ n, I" n) K) U* \* P kube play等  w7 @. I  ^* ^6 l5 z) a# l
logs获取容器的日志、
- t8 c) Q: \  |% \ machine管理 podman 的虚拟机
5 [! C, s+ d& R+ A manifest创建和操作清单列表和图像索引- M  a$ C4 a% K; N8 Z5 Y
mount挂载一个工作容器的根文件系统1 S" x. e( k; p  F
pause暂停一个或多个容器中的所有进程& n  o- p$ @, M8 l
pod管理 pod
1 U  d( r- G  i8 V( o% S7 q7 V8 t. t port列出端口映射或容器的特定映射
9 V" K0 j+ |+ k$ \ ps列出容器
9 g* P; V) {/ b4 V$ R+ {  |: _9 O push将图片推送到指定目的地
3 N4 Q# d9 _* o' ]7 G rename重命名现有容器! o8 |5 M1 N- X2 _1 S6 Y, E

/ \7 {2 y$ y  F$ h5 G
% A. N) G2 b! N" p2 {0 E+ i

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-2-10 22:10:35 | 显示全部楼层
Podman是一个开源的容器管理工具,语法兼容 Docker,但是某些方面比原生 Docker 命令更好用,比如能够以非root用户的身份去运行容器,而且不需要守护进程。
9 F; u( i. L; W9 F. l$ \" R. D. W0 v) p, i5 a$ Y
Podman引入了一个注册表的概念,注册表就是包括 ​ ​docker.io​​ 在内的多个容器镜像源,默认的有 redhat docker fedora centos quay。4 [8 }$ \4 S9 B& Y( O$ j; ~

* p1 q% h' c! f2 ^国内直接用 podman pull 拉取镜像会很慢,所以需要配置国内镜像源来加速访问。3 F7 A% g% T& V- R

! B( e  _& ^4 t9 o国内的镜像源有以下:8 l1 r1 Q0 R4 A7 r( g5 j. ?
" c2 U. k/ u3 G* m) O: h4 j
docker官方中国区:  https://registry.docker-cn.com/ z) s! q: M9 `; w
网易:             http://hub-mirror.c.163.com: e. @9 l4 a, w# Y$ b( T) n& u$ P; {6 K
USTC:            http://docker.mirrors.ustc.edu.cn
3 W9 H" t& Z4 M* P3 w3 T0 g/ ~阿里云:           http://<你的ID>.mirror.aliyuncs.com8 y: `7 _$ T0 `2 |
1.
2 ~: P3 f3 Q! h- k0 T2.
6 _2 I% B8 @' i% g3.5 a- M; M. L0 Q, @
4.
5 b" o4 w$ P6 ~1 C: \- G此处我使用的是阿里的镜像源
' n- j' ], y( b) X  X
' x% X/ D6 l2 O% N* U1.获取阿里的镜像源地址
$ n% ?& Z; m; q<你的ID>.mirror.aliyuncs.com
9 C. Q& A' c% d) \( v1.( b' X: }! z2 g% g( K$ R( h3 g
2.修改Podman的注册表配置文件
- b' N3 R& `9 S% h4 W; Bvim  /etc/containers/registries.conf: H* ~7 A8 ]8 }7 L, N+ Q. `( P/ j0 ~9 \
1.$ U( [6 w! p! m8 n+ D5 w
修改内容
' ^6 V( ^  S) l) p6 R$ k/ p( l" F3 Q7 L$ h6 g" z1 P
登录后复制
8 r8 R2 p7 l' w/ P5 t8 ?6 P7 ]unqualified-search-registries = ["docker.io"]
3 s# x9 f+ S+ K4 M8 _1.
1 _% x7 x$ L( Y/ I5 l& d- P增加内容
% _( P* H( k2 w, j( _" \9 |
, T6 W9 Y  O7 b) }[[registry]]
' |  G' c) z  jprefix = "docker.io"& U/ C  f5 I" m1 m/ k1 u
location="d1234.mirror.aliyuncs.com"
0 F3 {1 s, H( l5 T
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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