Skip to content

Commit f49dd1a

Browse files
committed
chore: disable hsts for wget calls
wget creates a .wget-hsts file to keep track of HSTS. This makes the container build non-reproducable. Since we use https for all endpoints anyway disable hsts for wget altogether.
1 parent c5a2014 commit f49dd1a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.devcontainer/cpp/Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RUN --mount=type=bind,source=.devcontainer/cpp/apt-requirements-base.json,target
3434
&& jq -r 'to_entries | .[] | .key + "=" + .value' /tmp/apt-requirements-base.json | \
3535
xargs apt-get install -y --no-install-recommends \
3636
# Include the Cisco Umbrella PKI Root
37-
&& wget -qO /usr/local/share/ca-certificates/Cisco_Umbrella_Root_CA.crt https://www.cisco.com/security/pki/certs/ciscoumbrellaroot.pem \
37+
&& wget --no-hsts -qO /usr/local/share/ca-certificates/Cisco_Umbrella_Root_CA.crt https://www.cisco.com/security/pki/certs/ciscoumbrellaroot.pem \
3838
&& update-ca-certificates \
3939
# Install some tools via pip to get more recent versions, clean up afterwards
4040
&& python3 -m pip install --break-system-packages --require-hashes --no-cache-dir --no-compile -r /tmp/requirements.txt \
@@ -47,8 +47,8 @@ RUN --mount=type=bind,source=.devcontainer/cpp/apt-requirements-clang.json,targe
4747
--mount=type=cache,target=/var/lib/apt,sharing=locked \
4848
--mount=type=cache,target=/var/log,sharing=locked \
4949
--mount=type=cache,target=/tmp,sharing=locked,mode=1777 \
50-
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-snapshot-keyring.gpg \
51-
&& wget -qO - https://dl.cloudsmith.io/public/mull-project/mull-stable/gpg.41DB35380DE6BD6F.key | gpg --dearmor -o /usr/share/keyrings/mull-project-mull-stable-archive-keyring.gpg \
50+
wget --no-hsts -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-snapshot-keyring.gpg \
51+
&& wget --no-hsts -qO - https://dl.cloudsmith.io/public/mull-project/mull-stable/gpg.41DB35380DE6BD6F.key | gpg --dearmor -o /usr/share/keyrings/mull-project-mull-stable-archive-keyring.gpg \
5252
&& UBUNTU_CODENAME=$(grep '^UBUNTU_CODENAME=' /etc/os-release | cut -d= -f2) \
5353
&& echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot-keyring.gpg] http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-${CLANG_VERSION} main" | tee /etc/apt/sources.list.d/llvm.list > /dev/null \
5454
&& echo "deb [signed-by=/usr/share/keyrings/mull-project-mull-stable-archive-keyring.gpg] https://dl.cloudsmith.io/public/mull-project/mull-stable/deb/ubuntu ${UBUNTU_CODENAME} main" | tee /etc/apt/sources.list.d/mull-project-mull-stable.list > /dev/null \
@@ -58,23 +58,23 @@ RUN --mount=type=bind,source=.devcontainer/cpp/apt-requirements-clang.json,targe
5858

5959
# Install arm-gcc toolchain
6060
RUN mkdir /opt/gcc-arm-none-eabi \
61-
&& wget -qO - "https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-$(uname -m)-arm-none-eabi.tar.xz" | tar --exclude='*arm-none-eabi-gdb*' --exclude='share' --strip-components=1 -xJC /opt/gcc-arm-none-eabi
61+
&& wget --no-hsts -qO - "https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-$(uname -m)-arm-none-eabi.tar.xz" | tar --exclude='*arm-none-eabi-gdb*' --exclude='share' --strip-components=1 -xJC /opt/gcc-arm-none-eabi
6262

6363
# Install bats
6464
RUN batstmp="$(mktemp -d /tmp/bats-core-${BATS_VERSION}.XXXX)" \
65-
&& wget -qO - https://github.com/bats-core/bats-core/archive/refs/tags/v${BATS_VERSION}.tar.gz | tar xz -C "${batstmp}" \
65+
&& wget --no-hsts -qO - https://github.com/bats-core/bats-core/archive/refs/tags/v${BATS_VERSION}.tar.gz | tar xz -C "${batstmp}" \
6666
&& bash "${batstmp}/bats-core-${BATS_VERSION}/install.sh" /usr/local \
6767
&& rm -rf "${batstmp}" \
6868
&& git -C /usr/local clone -b v0.3.0 https://github.com/bats-core/bats-support.git \
6969
&& git -C /usr/local clone -b v2.1.0 https://github.com/bats-core/bats-assert.git
7070

7171
# Install xwin
72-
RUN wget -qO - "https://github.com/Jake-Shadle/xwin/releases/download/${XWIN_VERSION}/xwin-${XWIN_VERSION}-$(uname -m)-unknown-linux-musl.tar.gz" | tar -xzv -C /usr/local/bin --strip-components=1 "xwin-${XWIN_VERSION}-$(uname -m)-unknown-linux-musl/xwin"
72+
RUN wget --no-hsts -qO - "https://github.com/Jake-Shadle/xwin/releases/download/${XWIN_VERSION}/xwin-${XWIN_VERSION}-$(uname -m)-unknown-linux-musl.tar.gz" | tar -xzv -C /usr/local/bin --strip-components=1 "xwin-${XWIN_VERSION}-$(uname -m)-unknown-linux-musl/xwin"
7373

7474
# Compile and install additional clang tools; often necessary as binary arm64 builds are lacking, or packages are out-of-date
7575
# Install ccache from source for a recent version
7676
RUN --mount=type=cache,target=/cache,sharing=locked \
77-
wget -qO - https://github.com/ccache/ccache/archive/refs/tags/v${CCACHE_VERSION}.tar.gz | tar xz -C /tmp \
77+
wget --no-hsts -qO - https://github.com/ccache/ccache/archive/refs/tags/v${CCACHE_VERSION}.tar.gz | tar xz -C /tmp \
7878
&& CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=Off -DENABLE_DOCUMENTATION=Off -S /tmp/ccache-${CCACHE_VERSION} -B /tmp/ccache-${CCACHE_VERSION}/build \
7979
&& cmake --build /tmp/ccache-${CCACHE_VERSION}/build --target install \
8080
&& rm -rf /tmp/ccache-${CCACHE_VERSION}
@@ -85,7 +85,7 @@ RUN --mount=type=cache,target=/cache,sharing=locked \
8585
--mount=type=cache,target=/var/cache/apt,sharing=locked \
8686
--mount=type=cache,target=/var/lib/apt,sharing=locked \
8787
apt-get update && apt-get install -y --no-install-recommends libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev \
88-
&& wget -qO - https://github.com/include-what-you-use/include-what-you-use/archive/refs/tags/${INCLUDE_WHAT_YOU_USE_VERSION}.tar.gz | tar xz -C /tmp \
88+
&& wget --no-hsts -qO - https://github.com/include-what-you-use/include-what-you-use/archive/refs/tags/${INCLUDE_WHAT_YOU_USE_VERSION}.tar.gz | tar xz -C /tmp \
8989
&& CC=clang CXX=clang++ cmake -S /tmp/include-what-you-use-${INCLUDE_WHAT_YOU_USE_VERSION} -B /tmp/include-what-you-use-${INCLUDE_WHAT_YOU_USE_VERSION}/build \
9090
&& cmake --build /tmp/include-what-you-use-${INCLUDE_WHAT_YOU_USE_VERSION}/build --target install \
9191
&& rm -rf /tmp/include-what-you-use-${INCLUDE_WHAT_YOU_USE_VERSION} \
@@ -112,6 +112,6 @@ RUN --mount=type=cache,target=/var/log,sharing=locked \
112112
# - Install CPM.cmake to the CMake module path
113113
# - Configure a default profile for Conan and set the CMake generator to Ninja
114114
RUN --mount=type=cache,target=/cache,sharing=locked \
115-
wget -qP /usr/local/lib/python*/dist-packages/cmake/data/share/cmake-*/Modules/ https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_VERSION}/CPM.cmake \
115+
wget --no-hsts -qP /usr/local/lib/python*/dist-packages/cmake/data/share/cmake-*/Modules/ https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_VERSION}/CPM.cmake \
116116
&& conan profile detect \
117117
&& echo -e "\n[conf]\ntools.cmake.cmaketoolchain:generator=Ninja" >> "$(conan profile path default)"

0 commit comments

Comments
 (0)