Skip to content

Commit

Permalink
Upgrade python distro and create symlink to stunnel5
Browse files Browse the repository at this point in the history
  • Loading branch information
dankova22 committed Jan 10, 2025
1 parent 12a3912 commit 34e0fce
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ENV EFS_CLIENT_SOURCE=$client_source

RUN OS=${TARGETOS} ARCH=${TARGETARCH} make $TARGETOS/$TARGETARCH

FROM public.ecr.aws/eks-distro-build-tooling/python:3.9.14-gcc-al2 as rpm-provider
FROM public.ecr.aws/eks-distro-build-tooling/python:3.11-gcc-al23 as rpm-provider

# Install efs-utils from github by default. It can be overriden to `yum` with --build-arg when building the Docker image.
# If value of `EFSUTILSSOURCE` build arg is overriden with `yum`, docker will install efs-utils from Amazon Linux 2's yum repo.
Expand All @@ -55,7 +55,7 @@ RUN mkdir -p /tmp/rpms && \
RUN pip3 install --user botocore

# This image is equivalent to the eks-distro-minimal-base-python image but with pip installed as well
FROM public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-python-builder:3.9.14-al2 as rpm-installer
FROM public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-python-builder:3.11-al23 as rpm-installer

COPY --from=rpm-provider /tmp/rpms/* /tmp/download/

Expand All @@ -76,22 +76,25 @@ RUN clean_install amazon-efs-utils true && \
/usr/bin/openssl \
/usr/bin/sed \
/usr/bin/stat \
/usr/bin/stunnel5 \
/usr/bin/stunnel \
/usr/sbin/tcpdump \
/usr/bin/which && \
cleanup "efs-csi"

# Create a symbolic link for stunnel5 to stunnel (for backward compatibility)
RUN if [ -f /usr/bin/stunnel ]; then ln -s /usr/bin/stunnel /usr/bin/stunnel5; fi

# At image build time, static files installed by efs-utils in the config directory, i.e. CAs file, need
# to be saved in another place so that the other stateful files created at runtime, i.e. private key for
# client certificate, in the same config directory can be persisted to host with a host path volume.
# Otherwise creating a host path volume for that directory will clean up everything inside at the first time.
# Those static files need to be copied back to the config directory when the driver starts up.
RUN mv /newroot/etc/amazon/efs /newroot/etc/amazon/efs-static-files

FROM public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-python:3.9.14-al2 AS linux-amazon
FROM public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-python:3.11-al23 AS linux-amazon

COPY --from=rpm-installer /newroot /
COPY --from=rpm-provider /root/.local/lib/python3.9/site-packages/ /usr/lib/python3.9/site-packages/
COPY --from=rpm-provider /root/.local/lib/python3.11/site-packages/ /usr/lib/python3.11/site-packages/

COPY --from=go-builder /go/src/github.com/kubernetes-sigs/aws-efs-csi-driver/bin/aws-efs-csi-driver /bin/aws-efs-csi-driver
COPY THIRD-PARTY /
Expand Down

0 comments on commit 34e0fce

Please sign in to comment.