Skip to content

Commit f8947a9

Browse files
committed
Don't verify Apt repo CA initially when using HTTPS in container build
The Ubuntu base image doesn't contain the ca-certificates package, so we can't verify an HTTPS package mirror to download the ca-certificates package. Using the upstream repos may result in a version conflict when we switch to another mirror.
1 parent 05e1995 commit f8947a9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

etc/kayobe/kolla.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,10 @@ kolla_build_blocks:
328328
RUN \
329329
rm /etc/apt/sources.list && \
330330
rm -f /etc/apt/auth.conf && \
331+
{% if stackhpc_repo_mirror_url | urlsplit('scheme') == 'https' %}
332+
{# We lack the ca-certificates package at this stage, so don't verify the CA #}
333+
echo 'Acquire::https::Verify-Peer "false";' > /etc/apt/apt.conf.d/90no-verify-peer && \
334+
{% endif %}
331335
{% if stackhpc_repo_mirror_username is truthy %}
332336
echo 'machine {{ stackhpc_repo_mirror_url }}' >> /etc/apt/auth.conf && \
333337
echo 'login {{ stackhpc_repo_mirror_username }}' >> /etc/apt/auth.conf && \
@@ -365,6 +369,7 @@ kolla_build_blocks:
365369
RUN \
366370
rm /etc/apt/sources.list && \
367371
rm -f /etc/apt/auth.conf && \
372+
rm -f /etc/apt/apt.conf.d/90no-verify-peer && \
368373
{% if stackhpc_repo_mirror_username is truthy %}
369374
echo 'machine {{ stackhpc_repo_mirror_url }}' >> /etc/apt/auth.conf && \
370375
echo 'login {{ stackhpc_repo_mirror_username }}' >> /etc/apt/auth.conf && \

0 commit comments

Comments
 (0)