diff options
| author | Yang Youseok <ileixe@gmail.com> | 2019-10-30 14:35:14 +0900 |
|---|---|---|
| committer | Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | 2021-12-08 15:50:00 +0100 |
| commit | c0c2076c856975e83a624eb793b586f2a4354a7f (patch) | |
| tree | 0020ca01541e6bc48a73bc259f3e93aa57a11dae | |
| parent | 077f13681c330d5d57583dec90aa46c323d04e33 (diff) | |
| download | kolla-c0c2076c856975e83a624eb793b586f2a4354a7f.tar.gz kolla-c0c2076c856975e83a624eb793b586f2a4354a7f.zip | |
Add HTTP proxy support for fetching APT keys
In network isolated environments the only way to go outside is through
HTTP proxy. Make use of it if set.
Co-authored-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Closes-Bug: #1850575
Change-Id: I2718884c4742cb81a3900e38fee62fbd27b472d7
| -rw-r--r-- | docker/base/Dockerfile.j2 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index b659ed580..20406546f 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -343,12 +343,17 @@ COPY apt_preferences /etc/apt/preferences.d/kolla-custom {% block base_ubuntu_package_installation %} {%- block base_ubuntu_package_key_installation %} {% for key in base_apt_keys | customizable('apt_keys') %} - {%- if loop.first %}RUN mkdir -p /etc/kolla/apt-keys/{% endif %} && gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 {{ key.keyid }} && gpg --export {{ key.keyid }} >/etc/kolla/apt-keys/{{ key.name }}.gpg + {%- if loop.first %}RUN mkdir -p /etc/kolla/apt-keys/{% endif %} \ + && gpg --keyserver hkp://keyserver.ubuntu.com:80 \ + {% if env.http_proxy %} --keyserver-options "http-proxy={{ env.http_proxy }}" {% endif %}\ + --recv-keys {{ key.keyid }} \ + && gpg --export {{ key.keyid }} >/etc/kolla/apt-keys/{{ key.name }}.gpg {%- if not loop.last %} \ {% endif -%} {% endfor %} {% for key in remote_apt_keys | customizable('remote_apt_keys') %} - {%- if loop.first %} RUN mkdir -p /etc/kolla/apt-keys/ {% endif %} && curl {{ key.url }} -o /etc/kolla/apt-keys/{{ key.name }}.{{ key.type | default('asc') }} + {%- if loop.first %} RUN mkdir -p /etc/kolla/apt-keys/ {% endif %} \ + && curl {{ key.url }} -o /etc/kolla/apt-keys/{{ key.name }}.{{ key.type | default('asc') }} {%- if not loop.last %} \ {% endif -%} {% endfor %} |
