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 18, 2024
1 parent d7ce3f4 commit 77fedd8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions 02_configure_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,13 @@ 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, and make squid
# reload it's config.
for container in $(podman ps --format "{{.Names}}" | grep squid); do
echo "Updating /etc/hosts in container: $container"
sudo 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 && kill -HUP 1"
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 77fedd8

Please sign in to comment.