Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions incus/backend.func
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,10 @@ incus_customize_container() {
http://dl-cdn.alpinelinux.org/alpine/${alpine_rel}/main
http://dl-cdn.alpinelinux.org/alpine/${alpine_rel}/community
EOF"
if ! incus_ct_exec /bin/sh -c 'getent hosts dl-cdn.alpinelinux.org >/dev/null 2>&1'; then
msg_warn "Alpine repository DNS resolution failed in container, injecting public DNS servers"
incus_ct_exec /bin/sh -c 'printf "nameserver 8.8.8.8\nnameserver 1.1.1.1\n" >/etc/resolv.conf'
fi
incus_ct_exec ash -c "apk add bash newt curl openssh nano mc ncurses jq >/dev/null" || msg_warn "Alpine base package install had issues"
elif [[ "${var_os:-debian}" =~ ^(debian|ubuntu|devuan)$ ]]; then
sleep 2
Expand Down
5 changes: 5 additions & 0 deletions pve/backend.func
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,11 @@ EOF
https://dl-cdn.alpinelinux.org/alpine/latest-stable/main
https://dl-cdn.alpinelinux.org/alpine/latest-stable/community
EOF'
# As for Debian below: with a dead resolver every mirror fails alike.
if ! pct exec "$CTID" -- /bin/sh -c 'getent hosts dl-cdn.alpinelinux.org >/dev/null 2>&1'; then
msg_warn "Alpine repository DNS resolution failed in container, injecting public DNS servers"
pct exec "$CTID" -- /bin/sh -c 'printf "nameserver 8.8.8.8\nnameserver 1.1.1.1\n" >/etc/resolv.conf'
fi
_cs_shield_hangup pct exec "$CTID" -- ash -c 'set -a; [ -f /etc/profile.d/90-http-proxy.sh ] && . /etc/profile.d/90-http-proxy.sh; set +a; apk add bash newt curl openssh nano mc ncurses jq' >>"$BUILD_LOG" 2>&1 || {
msg_warn "apk install failed (dl-cdn.alpinelinux.org), trying alternate mirrors..."
local alpine_exit=0
Expand Down
Loading