Skip to content

Commit 1f70bba

Browse files
committed
Pin linux package versions
1 parent 166070b commit 1f70bba

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ output of the `aws` command. The tool `cfn-policy-validator` is also
2424
included to run IAM policies from a CloudFormation template through
2525
IAM Access Analyzer checks.
2626

27+
Another significant difference with the official image is that this
28+
image is not running using the `root` user. Running as `root` should
29+
not be necessary for CI/CD activities and it is considered a security
30+
risk.
31+
2732
## Usage
2833

2934
To run the AWS CLI using this image:

aws-cli/Dockerfile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,36 @@ ARG USER_NAME=default
66
ARG USER_HOME=/home/default
77
ARG 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)
1012
RUN 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
1516
RUN 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.
2436
RUN 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

Comments
 (0)