@@ -6,24 +6,36 @@ ARG USER_NAME=default
66ARG USER_HOME=/home/default
77ARG USER_ID=1000
88
9+ SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
10+
911# Upgrade python to 3.8 (best we can do with Amazon Linux 2)
1012RUN yum remove python3 \
1113 && amazon-linux-extras install python3.8 \
1214 && ln -s /usr/bin/python3.8 /usr/bin/python3
1315
14- # hadolint ignore=DL3033
1516RUN yum update -y \
16- && yum install -y bash curl git jq make python3-pip tar unzip xmlstarlet zip \
17+ && yum install -y \
18+ bash-4.2.46-34.amzn2 \
19+ curl-8.3.0-1.amzn2 \
20+ git-2.47.1-1.amzn2.0.2 \
21+ jq-1.5-1.amzn2.0.2 \
22+ make-3.82-24.amzn2 \
23+ python3-pip-20.2.2-1.amzn2.0.8 \
24+ tar-1.26-35.amzn2.0.4 \
25+ unzip-6.0-57.amzn2.0.1 \
26+ zip-3.0-11.amzn2.0.2 \
27+ && if yum list updates | grep -q -e '^Updated Packages' ; then \
28+ yum list updates ; \
29+ exit 1 ; \
30+ fi \
1731 && yum clean all \
1832 && rm -rf /var/cache/yum
1933
20- SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
21-
2234# @TL FIXME: cfn-policy-validator version is held back by Python 3.8.
2335# @TL FIXME: --break-system-packages not supported until Python 3.11.
2436RUN pip3 install --no-cache-dir --upgrade \
2537 cfn-policy-validator==0.0.29 \
26- && msg="$(pip list --outdated | grep -i -e cfn-policy-validator || true)" \
38+ && msg="$(pip3 list --outdated | grep -i -e '^ cfn-policy-validator ' || true)" \
2739 && if [ -n "${msg}" ]; then \
2840 >&2 echo "ERROR: outdated: ${msg}" ; \
2941 exit 1 ; \
0 commit comments