Skip to content

Commit 0e0b26b

Browse files
authored
Merge pull request #2067 from sdx-jkataja/CVE-2024-38428
fix: CVE-2024-38428 remove wget to close vuln, reduce image size
2 parents 74adad1 + c979545 commit 0e0b26b

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

pkg/azurefileplugin/Dockerfile

+18-14
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,28 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM registry.k8s.io/build-image/debian-base:bookworm-v1.0.3
16-
1715
ARG ARCH=amd64
16+
17+
FROM registry.k8s.io/build-image/debian-base:bookworm-v1.0.3 AS base
18+
19+
FROM base AS builder
20+
21+
ARG ARCH
22+
23+
RUN apt update \
24+
&& apt install -y curl \
25+
&& curl -Ls https://azcopyvnext.azureedge.net/releases/release-10.26.0-20240731/azcopy_linux_${ARCH}_10.26.0.tar.gz \
26+
| tar xvzf - --strip-components=1 -C /usr/local/bin/ --wildcards "*/azcopy"
27+
28+
FROM base
29+
30+
ARG ARCH
1831
ARG binary=./_output/${ARCH}/azurefileplugin
32+
1933
COPY ${binary} /azurefileplugin
34+
COPY --from=builder --chown=root:root /usr/local/bin/azcopy /usr/local/bin/azcopy
2035

21-
RUN apt update && apt upgrade -y && apt-mark unhold libcap2 && clean-install ca-certificates cifs-utils util-linux e2fsprogs mount udev xfsprogs nfs-common netbase wget
22-
23-
# install azcopy
24-
ARG azcopyURL=https://azcopyvnext.azureedge.net/releases/release-10.26.0-20240731/azcopy_linux_amd64_10.26.0.tar.gz
25-
RUN if [ "$ARCH" == "arm64" ] ; then \
26-
azcopyURL=https://azcopyvnext.azureedge.net/releases/release-10.26.0-20240731/azcopy_linux_arm64_10.26.0.tar.gz; fi
27-
RUN wget -O azcopy.tar.gz ${azcopyURL} && \
28-
tar xvzf azcopy.tar.gz -C . && rm azcopy.tar.gz && \
29-
mv ./azcopy_linux_$ARCH_*/azcopy /usr/local/bin/azcopy && \
30-
rm -rf ./azcopy_linux_$ARCH_*
31-
RUN chmod +x /usr/local/bin/azcopy
32-
RUN apt remove wget -y
36+
RUN apt update && apt upgrade -y && apt-mark unhold libcap2 && clean-install ca-certificates cifs-utils util-linux e2fsprogs mount udev xfsprogs nfs-common netbase
3337

3438
LABEL maintainers="andyzhangx"
3539
LABEL description="AzureFile CSI Driver"

0 commit comments

Comments
 (0)