Skip to content

Commit ca16202

Browse files
committed
docs: podman登录非https的私有仓库
1 parent 338e26a commit ca16202

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: podman登录非https的私有仓库
3+
date: 2025-08-11 22:33:06
4+
tags: [podman]
5+
categories: [后端]
6+
---
7+
8+
# 前言
9+
10+
本文的目的是为了解决podman登陆非https的私有仓库。
11+
这里使用192.168.31.220:5000威力
12+
13+
# 方案1:禁用 TLS 验证(临时解决方案)
14+
15+
对于测试环境或内部信任的网络,可以临时禁用 TLS 验证:
16+
17+
```bash
18+
podman login --tls-verify=false 192.168.31.220:5000
19+
```
20+
21+
> 注意:生产环境不建议禁用 TLS 验证,这会降低安全性。
22+
23+
# 方案2: 配置仓库为不安全仓库
24+
25+
编辑 /etc/containers/registries.conf文件,添加以下内容:
26+
27+
```bash
28+
[[registry]]
29+
location = "192.168.31.220:5000"
30+
insecure = true
31+
```
32+
33+
# 方案3:正确配置 HTTPS(生产环境推荐)
34+
35+
如果这是生产环境,建议为您的私有仓库配置正确的 HTTPS。

0 commit comments

Comments
 (0)