|
1 | 1 | # docker-compose-container-registry-pull-through-caches |
2 | 2 |
|
| 3 | +# Deployment |
3 | 4 |
|
4 | | -# Requirements |
| 5 | +To deploy in hetzner, go to Hetzner cloud console and look for the project called "container-registry-cache". |
| 6 | + |
| 7 | +Create a new instance in hetzner cloud: |
| 8 | +- 3 or more vCPU's (e.g. CPX21 or CPX32) |
| 9 | +- Keep a public IPv4 |
| 10 | +- Remove IPv6 address |
| 11 | +- Attach the firewall rule that blocks all incoming connections |
| 12 | +- Use cloud-init config below but update the --authKey for tailscale. |
| 13 | + |
| 14 | + |
| 15 | +You can create an authKey in tailscale as follows: |
| 16 | + |
| 17 | +<img width="745" height="1164" alt="image" src="https://github.com/user-attachments/assets/bfced0e9-e3e0-4f89-87ca-21b0497ad988" /> |
5 | 18 |
|
6 | | -Install the basics: |
7 | | -```bash |
8 | | -curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh && sudo apt-get update && sudo apt install tmux git -y && sudo apt-get clean |
9 | | -``` |
10 | 19 |
|
| 20 | +# cloud-init/config: |
11 | 21 |
|
| 22 | +```yaml |
| 23 | +#cloud-config |
12 | 24 |
|
13 | | -# To deploy |
| 25 | +# --- 1. System Configuration --- |
| 26 | +# Sets the system hostname and manages the /etc/hosts file. |
| 27 | +# :exclamation:️ Replace "container-registry-cache-for-dev" with your desired hostname. |
| 28 | +hostname: container-registry-cache-for-dev |
| 29 | +manage_etc_hosts: true |
14 | 30 |
|
15 | | -```bash |
16 | | -git clone https://github.com/GlueOps/docker-compose-container-registry-pull-through-caches.git |
17 | | -cd docker-compose-container-registry-pull-through-caches/ |
18 | | -docker compose up -d |
| 31 | +# --- 2. Setup Commands --- |
| 32 | +runcmd: |
| 33 | + # Install Tailscale and Docker |
| 34 | + - 'curl -fsSL https://tailscale.com/install.sh | sh' |
| 35 | + - 'curl -fsSL https://get.docker.com -o get-docker.sh' |
| 36 | + - 'sh get-docker.sh' |
| 37 | + - 'sudo apt-get update && sudo apt install tmux git -y && sudo apt-get clean' |
| 38 | + |
| 39 | + # Configure and connect to Tailscale in a single step |
| 40 | + # :exclamation:️ Replace "tskey-auth-..." with your actual Tailscale auth key. |
| 41 | + - ['tailscale', 'up', '--authkey=YOUR_TAILSCALE_AUTH_KEY_HERE', '--ssh'] |
| 42 | + |
| 43 | + # Secure the root account by disabling password login |
| 44 | + - ['passwd', '-d', 'root'] |
| 45 | + |
| 46 | + # Deploy the Docker Compose application |
| 47 | + # :exclamation:️ Replace the URL with the actual link to your compose file. |
| 48 | + - 'cd /opt && git clone https://github.com/GlueOps/docker-compose-container-registry-pull-through-caches.git' |
| 49 | + - 'cd /opt/docker-compose-container-registry-pull-through-caches && docker compose up -d' |
19 | 50 | ``` |
| 51 | +
|
| 52 | +
|
| 53 | +Once you have an instance running, update the `dev-only-registry` DNS entry to use the new tailscale IP of the node you just added and assuming everything is working destroy the old hetzner node and remove it from tailscale |
0 commit comments