Files
configpolicy/roles/dockerhub-proxy/tasks/main.yml
Dustin C. Hatch f8f3dd5f83 docker-proxy: Deploy a proxy/cache for Docker Hub
Docker Hub's rate limits are so low now that they've started to affect
my home lab.  Deploying a caching proxy and directing all pull requests
through it should prevent exceeding the limit.  It will also help
prevent containers from starting if access to the Internet is down, as
long as their images have been cached recently.
2025-07-12 16:45:47 -05:00

39 lines
781 B
YAML

- name: ensure nginx is allowed to proxy
seboolean:
name: httpd_can_network_connect
state: true
persistent: true
tags:
- selinux
- name: ensure nginx docker proxy cache directory exists
file:
path: /var/cache/nginx/docker
owner: nginx
group: nginx
mode: u=rwx,go=
state: directory
tags:
- datadir
- name: ensure nginx docker proxy cache path is configured
copy:
src: dockerhub-proxy-cache.conf
dest: /etc/nginx/conf.d/
notify:
- reload nginx
tags:
- nginx-config
- name: ensure nginx is configured to proxy for docker hub
copy:
src: dockerhub-proxy.conf
dest: /etc/nginx/default.d/dockerhub-proxy.conf
owner: root
group: root
mode: u=rw,go=r
notify:
- reload nginx
tags:
- nginx-config