Skip to content

Commit

Permalink
Make registry available from squid proxy as well
Browse files Browse the repository at this point in the history
  • Loading branch information
stbenjam committed Sep 17, 2024
1 parent d7ce3f4 commit 451d83f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 02_configure_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,12 @@ fi
sudo sed -i "/${LOCAL_REGISTRY_DNS_NAME}/d" /etc/hosts
echo "${PROVISIONING_HOST_EXTERNAL_IP} ${LOCAL_REGISTRY_DNS_NAME}" | sudo tee -a /etc/hosts

# Make sure any squid containers get the registry name too
for container in $(podman ps --format "{{.Names}}" | grep squid); do
echo "Updating /etc/hosts in container: $container"
podman exec -it "$container" sh -c "grep -v '${LOCAL_REGISTRY_DNS_NAME}' /etc/hosts > /tmp/hosts && echo '${PROVISIONING_HOST_EXTERNAL_IP} ${LOCAL_REGISTRY_DNS_NAME}' >> /tmp/hosts && cp -f /tmp/hosts /etc/hosts"
done

if use_registry "podman"; then
# Remove any previous file, or podman login panics when reading the
# blank authfile with a "assignment to entry in nil map" error
Expand Down

0 comments on commit 451d83f

Please sign in to comment.