k8s:services:docker_hub_local_mirror
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| k8s:services:docker_hub_local_mirror [2023/11/11 17:14] – admin | k8s:services:docker_hub_local_mirror [2023/11/11 17:15] (current) – admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # Docker Hub local mirror | ||
| + | |||
| + | Since docker.com has limited access to container images there it is necessary to mirror container images locally | ||
| + | and pull them with an account for more than personal use of a few images. | ||
| + | That is especially true for maintaining or restoring a K8s cluster as this will exhaust the free contingent fast. | ||
| + | |||
| + | # Using a storage node | ||
| + | |||
| + | This has the benefit of using the 10GB link, for example 10.3.6.58: | ||
| + | |||
| + | Config file `/ | ||
| + | ```yaml | ||
| + | version: 0.1 | ||
| + | http: | ||
| + | secret: <some string> | ||
| + | addr: 0.0.0.0: | ||
| + | debug: | ||
| + | addr: :5001 | ||
| + | prometheus: | ||
| + | enabled: false | ||
| + | path: /metrics | ||
| + | headers: | ||
| + | X-Content-Type-Options: | ||
| + | - nosniff | ||
| + | proxy: | ||
| + | remoteurl: https:// | ||
| + | username: <docker hub account> | ||
| + | password: <access token> | ||
| + | health: | ||
| + | storagedriver: | ||
| + | enabled: true | ||
| + | interval: 10s | ||
| + | threshold: 3 | ||
| + | log: | ||
| + | fields: | ||
| + | service: registry | ||
| + | storage: | ||
| + | filesystem: | ||
| + | rootdirectory: | ||
| + | cache: | ||
| + | blobdescriptor: | ||
| + | delete: | ||
| + | enabled: true | ||
| + | |||
| + | ``` | ||
| + | |||
| + | Launch: | ||
| + | ```bash | ||
| + | sudo podman run -d -p 10.6.16.58: | ||
| + | -v / | ||
| + | -v / | ||
| + | | ||
| + | | ||
| + | ``` | ||
| + | |||
| + | Restart with systemd (`/ | ||
| + | ```ini | ||
| + | [Unit] | ||
| + | Description=DockerHub Registry Proxy Server | ||
| + | |||
| + | [Service] | ||
| + | Restart=on-failure | ||
| + | ExecStart=/ | ||
| + | ExecStop=/ | ||
| + | |||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | ``` | ||