Skip to content

Commit 4454e38

Browse files
committed
Show TLS instructions for registry mirror
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent f732a85 commit 4454e38

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

docs/tasks/registry-mirror.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ Before doing so, you'll need to:
5858

5959
1. Create a file named `hub.txt` in your home directory.
6060
2. Set the `USERNAME` variable to your Docker Hub username.
61+
3. If you're using cloud-hypervisor, set the `BRIDGE` variable to `192.168.129.1`
6162

6263
```bash
6364
export USERNAME=""
6465
export TOKEN=$(cat ~/hub.txt)
66+
export BRIDGE="192.168.128.1"
6567

6668
cat >> /tmp/registry.yml <<EOF
6769
version: 0.1
@@ -83,14 +85,20 @@ proxy:
8385
password: $TOKEN
8486
8587
http:
86-
addr: 192.168.128.1:5000
88+
addr: $BRIDGE:5000
8789
relativeurls: false
8890
draintimeout: 60s
89-
EOF
9091
91-
sudo mv /tmp/registry.yml /etc/registry/config.yml
92+
# Enable self-signed TLS from the TLS certificate and key
93+
# managed by actuated for server <> microVM communication
94+
tls:
95+
certificate: /var/lib/actuated/certs/server.crt
96+
key: /var/lib/actuated/certs/server.key
97+
EOF
9298
```
9399

100+
As the certificate is expired, actuated will automatically restart the `registry` service to use the new certificate.
101+
94102
Install and start the registry with a systemd unit file:
95103

96104
```bash
@@ -140,7 +148,7 @@ on:
140148

141149
jobs:
142150
build:
143-
runs-on: [actuated]
151+
runs-on: [actuated-4cpu-8gb]
144152
steps:
145153

146154
- name: Setup mirror
@@ -167,10 +175,17 @@ find /var/lib/registry/ -name "alpine"
167175
/var/lib/registry/docker/registry/v2/repositories/library/alpine
168176
```
169177

178+
Add actuated's bridge <> VM CA bundle to the trust store on the server, to test the registry via curl:
179+
180+
```bash
181+
sudo cp /var/lib/actuated/certs/ca.crt /usr/local/share/ca-certificates/actuated-ca.crt
182+
sudo update-ca-certificates
183+
```
184+
170185
You can also use the registry's API to query which images are available:
171186

172187
```bash
173-
curl -i http://192.168.128.1:5000/v2/_catalog
188+
curl -i https://192.168.128.1:5000/v2/_catalog
174189

175190
HTTP/1.1 200 OK
176191
Content-Type: application/json; charset=utf-8

0 commit comments

Comments
 (0)