Skip to content

Commit 8cfd0fc

Browse files
committed
Make registry available from squid proxy as well
1 parent d7ce3f4 commit 8cfd0fc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

02_configure_host.sh

+6
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,12 @@ fi
365365
sudo sed -i "/${LOCAL_REGISTRY_DNS_NAME}/d" /etc/hosts
366366
echo "${PROVISIONING_HOST_EXTERNAL_IP} ${LOCAL_REGISTRY_DNS_NAME}" | sudo tee -a /etc/hosts
367367

368+
# Make sure any squid containers get the registry name too
369+
for container in $(podman ps --format "{{.Names}}" | grep squid); do
370+
echo "Updating /etc/hosts in container: $container"
371+
podman exec -it "$container" sh -c "sed -i '/${LOCAL_REGISTRY_DNS_NAME}/d' /etc/hosts && echo '${PROVISIONING_HOST_EXTERNAL_IP} ${LOCAL_REGISTRY_DNS_NAME}' >> /etc/hosts"
372+
done
373+
368374
if use_registry "podman"; then
369375
# Remove any previous file, or podman login panics when reading the
370376
# blank authfile with a "assignment to entry in nil map" error

0 commit comments

Comments
 (0)