網站首頁 編程語言 正文
1. 配置/etc/docker/daemon.json
# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://0nth4654.mirror.aliyuncs.com"],
"insecure-registries": ["harbor.domain.io"]
}
2. 配置systemd啟動文件
和方法1配置會有沖突,不可同時配置
[0 root@vps harbor]# cat /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket containerd.service
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --insecure-registry harbor.domain.io
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
docker client insecure-registries配置
- docker客戶端如果配置中添加了insecure-registary配置,就不需要在docker 客戶端配置上對應證書
- 如果不配置就需要在/etc/docker/certs.d/目錄中添加對應證書才能正常登錄
[0 root@vps harbor.domain.io]# docker login harbor.domain.io
Username: admin
Password:
Error response from daemon: Get https://harbor.domain.io/v2/: x509: certificate signed by unknown authority
[1 root@vps harbor.domain.io]# cp /data/secret/certs/harbor.domain.io.crt .
[0 root@vps harbor.domain.io]# docker login harbor.domain.io
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
[0 root@vps ~]# cat /root/.docker/config.json
{
"auths": {
"harbor.domain.io": {
"auth": "YWRtaW46cm9vdC4xMjM0"
}
}
[0 root@vps harbor.domain.io]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2021-04-21 15:06:49 CST; 9min ago
Docs: https://docs.docker.com
Main PID: 32439 (dockerd)
Tasks: 39
Memory: 63.4M
CGroup: /system.slice/docker.service
├─ 920 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.18.0.10 -container-port 8443
├─ 932 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-ip 172.18.0.10 -container-port 8080
├─32439 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
└─32646 /usr/bin/docker-proxy -proto tcp -host-ip 127.0.0.1 -host-port 1514 -container-ip 172.18.0.2 -container-port 10514
...
原文鏈接:https://www.cnblogs.com/firewalld/p/14684565.html
相關推薦
- 2022-07-16 ssh遠程連接docker
- 2022-06-09 ASP.NET?Core使用EF為關系數據庫建模_實用技巧
- 2022-12-11 C語言執行時,程序控制臺輸出窗口?一閃而過問題及解決_C 語言
- 2022-10-24 iOS開發之Objective-c的Runtime理解指南_IOS
- 2021-12-16 C++?OpenCV實現圖像雙三次插值算法詳解_C 語言
- 2022-04-16 Python繪圖示例程序中的幾個語法糖果你知道嗎_python
- 2022-07-13 IO流詳解之字符流與File類
- 2022-05-03 C++中引用的相關知識點小結_C 語言
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支