|
|
snap 方式安装的docker环境,默认访问是https协议,推镜像报错http: server gave HTTP response to HTTPS client. T6 @: m) ^6 L/ x
8 ?) L: V7 Z( G
! `( \$ ^. N( H: A
寻找了很多方法,后来想到snap方式安装的docker是不是需要在snap中去找配置文件:( H4 Z$ S1 F; f2 R: G6 i( M, x; x& H
$ S9 `; f1 p( c; z: ~
尝试着通过修改
# J, a/ D! E6 y' k+ ~! @$ a+ q! ]" S/var/snap/docker/current/config/daemon.json 文件' B3 F0 d# d$ q, q; |
: M2 S9 Z. B# _, P2 T9 a修改成我们需要的配置:% d4 N' v% d' }' Z1 B. B
$ M$ w# ~ r0 X' W' P
9 z/ T0 }# y; M* G3 u8 A/ B& {" I& j{+ w5 F2 l# ~- Y; J) p+ j- e/ c
" j" b0 \1 S7 ~# g1 S* V8 r9 h
"insecure-registries": ["ip:4000"]
, I/ V+ M3 h. h9 b$ W$ [}1 f# P2 ?& J- o6 O8 s$ L! k
2 @- _; h" y3 H# f V1 d
) P7 I: f$ _$ G, m% Y保存退出,+ F& k! K- {4 N7 _7 G8 ]: q
1 i. c3 p5 \4 `5 f+ z8 l- `8 nroot@localhost:~# snap stop docker$ ~3 E0 X' M# M% g. _) l
Stopped.
- s# L: F$ z/ u3 sroot@localhost:~# snap start docker- s$ v& Q. b1 @0 T: \2 E: m
Started.8 O5 D* K* k& g' c9 ^! M' |4 e
root@localhost:~# docker info
5 t: G1 T0 G- O& r |; r8 i- HClient:
' }$ Y- v+ S# |2 T' c Version: 28.1.1+1
! Q0 M& q# Z( H# `$ b; C Context: default! c4 V- B/ p4 C, d2 E7 ~6 {
Debug Mode: false+ X. k! P( w. `/ X& c# P& N
Plugins:/ i' R7 o4 P w X: H
buildx: Docker Buildx (Docker Inc.)
- W6 ^- g/ h, i0 ^$ G Version: v0.20.1
$ U1 ~- Z" R& Y/ ^/ f9 H6 m. r Path: /usr/libexec/docker/cli-plugins/docker-buildx
7 C9 {$ i/ A, {& t compose: Docker Compose (Docker Inc.)( z U; Z& }& A! e
Version: v2.33.1" ~% J6 M# D' `( u9 B
Path: /usr/libexec/docker/cli-plugins/docker-compose
% Z. q/ f6 b) @& c! q& p4 @9 U0 B, z& q; P% Z
Server:
, |% |( p" J* N5 T# a F Containers: 03 r/ E9 z V0 ?+ S
Running: 0( ]; P( E1 f/ x
Paused: 0
/ \7 @" u/ S8 Y* u: r# M; | Stopped: 0
. w$ t& S; A5 x" D Images: 896
% C5 _% e- [* ]1 t Server Version: 28.1.1+1
# Q, F4 g0 T% N1 q% k8 m; L Storage Driver: overlay2! i2 h5 ?* ?. H b" V' M. Z2 J
Backing Filesystem: xfs$ V5 b8 z" F2 ?9 w5 j' `# K; h
Supports d_type: true
" z `9 X8 x/ D' D w R3 z Using metacopy: false
5 T0 o' s; b2 X, r% ^& y2 }% u Native Overlay Diff: true
* b5 ]( {9 b" q0 g- r" { userxattr: false
2 F1 J! {. }$ j* q7 E Logging Driver: json-file" r9 S# Q- ], L5 f
Cgroup Driver: systemd, D8 p+ V K! ~# j
Cgroup Version: 24 Y2 n- M8 V. s5 K' L1 E
Plugins:
6 r6 D+ Y5 i: `- w, u Volume: local% O5 a' z2 m5 h& d& v2 G6 F- T
Network: bridge host ipvlan macvlan null overlay+ v5 w2 N& S3 I* [( P
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
5 c0 g7 Z& n+ w Swarm: inactive: V e: a. j4 A
Runtimes: io.containerd.runc.v2 runc/ L% @$ i$ e! a, V5 _' @8 c
Default Runtime: runc
% p4 D' s9 r# ?; b Init Binary: docker-init- K. v( Q0 p/ u
containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
' Z/ q* z0 S; v6 h% R8 [ runc version: 8 y7 K' y2 J# o# o
init version: de40ad08 Q5 B! R& h5 S. R
Security Options:# Y+ S; b& l( o+ A. u) x8 m
apparmor R) ?' \% ?1 C. p7 W% r" c0 A
seccomp
O0 A) i. R4 X- S$ l, G Profile: builtin
/ _# f( _2 w) ~0 C8 z' M cgroupns
. U! J% Y- y1 P E" i8 t Kernel Version: 6.14.0-32-generic0 R+ A* g' O3 S$ f; U
Operating System: Ubuntu Core 22
: i1 m. C4 w( g OSType: linux9 L" L4 s# [. {( b
Architecture: x86_64% `/ I- @4 l3 u
CPUs: 8
1 `0 y+ q9 l& e Total Memory: 3.276GiB
1 u# h ~& O q/ {* X Name: localhost2 ]/ `% c! N* A/ X
ID: 1055684e-1d55-40ec-91c8-ba9dc02cea24, u; p+ J) N- Z4 h8 ^) G. L
Docker Root Dir: /var/snap/docker/common/var-lib-docker, n( l) [! y% x) h6 J
Debug Mode: false
. I4 X! r' h/ m/ C Experimental: false
' r# A. B: |. C) ~ Insecure Registries:3 h2 X/ c7 Q" Q/ t$ P8 W8 A+ y/ F
ip:40007 [$ R1 Z B$ Z: |
::1/128- |# z2 I0 F t' e2 M
127.0.0.0/8
' [: ~! H/ y- D* w5 N8 [1 H' z Live Restore Enabled: false2 P" U; t! B, a# u* V d
9 ?- f& R* O% k7 s) z
N7 J, U- c! h' G: [8 K8 t+ o- w$ N
再次执行推送:2 R0 H/ y: A, B' I, w. W
9 i/ o9 g- h/ u% s. E& K+ f# docker push ip:4000/quay.io/centos/centos:stream9
& i$ J6 f2 v) OThe push refers to repository [ip:4000/quay.io/centos/centos]8 D0 \! _, a; y4 r- c% B5 y
dfe3535c047d: Pushed
4 c j+ B" |/ dstream9: digest: sha256:cdcbc5a0779feaee2c1e47fcb0c78cb92750d01129cf1085132c333fff8b39f9 size: 529
G# W8 g% T# d/ o( }! W
- v7 U4 Y* s# }0 f
6 w P0 x' l0 R$ W# A+ |/ d# \. k P5 K
推送成功。
# Z5 T( R. u) x9 X# ]+ M* W* J! V+ h! d
|
|