Lework Study hard, improve every day.

学习周报「2024」7月

2024-07-01
lework
本文 1340 字,阅读全文约需 4 分钟

以每周一个节点,记录知识点。

2024-07-15~21

代理Docker hub的镜像

最近 hub 域名被xx了,企业内部只能自己搭建代理了。

docker client (国内) —>(海外专线)—> gost(海外节点)—> docker hub

gost 配置

# docker-compose.yml
version: '3'

services:
  gost:
    container_name: gost
    image: gogost/gost
    restart: always
    volumes:
      - ./gost.yaml:/etc/gost/gost.yaml
    ports:
      - '443:443'
# gost.yaml
services:
- name: https
  addr: :443
  handler:
    type: tcp
    metadata:
      sniffing: true
  listener:
    type: tcp
  forwarder:
    nodes:
    - name: docker-hub
      addr: hub.docker.com:443
      host: hub.docker.com
    - name: docker-io
      addr: index.docker.io:443
      host: "*.docker.io"
    - name: production-cloudflare-docker-com
      addr: production.cloudflare.docker.com:443
      host: production.cloudflare.docker.com

docker client 配置

这里有条件的,可以直接在dns上面做解析

# /etc/hosts

# gost host ==> 192.168.1.1
192.168.1.1 docker.io
192.168.1.1 auth.docker.io
192.168.1.1 registry-1.docker.io
192.168.1.1 production.cloudflare.docker.com

docker pull 拉镜像

docker pull debian

docker buildx 编译

docker buildx ls
docker buildx rm mybuilder
docker buildx create --use --name mybuilder --driver-opt network=host --buildkitd-flags '--allow-insecure-entitlement network.host'

docker buildx build -t docker_image_proxy:latest --push .

网友分享的代理节点

/etc/docker/daemon.json

{
    "registry-mirrors": [
        "https://dockerpull.com",
        "https://hub.rat.dev",
        "https://docker.1panel.dev",
        "https://docker.amingg.com",
        "https://hub.nat.tf",
        "https://hub1.nat.tf",
        "https://hub2.nat.tf",
        "https://docker.awsl9527.cn"
    ]
}
原文地址 https://lework.github.io/2024/07/01/July/

Similar Posts

Comments