Skip to content

Commit ed40c19

Browse files
ensure that al2 image is actually al2
1 parent 31307c8 commit ed40c19

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM amazonlinux:2
2+
3+
4+
###############################################################################
5+
# Install prereqs
6+
###############################################################################
7+
RUN yum -y update \
8+
&& yum -y install \
9+
tar \
10+
git \
11+
sudo \
12+
# Python
13+
python3 \
14+
python3-devel \
15+
python3-pip \
16+
make \
17+
cmake3 \
18+
gcc \
19+
gcc-c++ \
20+
which \
21+
&& yum clean all \
22+
&& rm -rf /var/cache/yum \
23+
&& cmake --version \
24+
&& ctest --version
25+
26+
###############################################################################
27+
# Python/AWS CLI
28+
###############################################################################
29+
RUN python3 -m pip install setuptools virtualenv \
30+
&& python3 -m pip install --upgrade awscli \
31+
&& aws --version
32+
33+
###############################################################################
34+
# Install pre-built CMake
35+
###############################################################################
36+
WORKDIR /tmp
37+
RUN curl -sSL https://d19elf31gohf1l.cloudfront.net/_binaries/cmake/cmake-3.13-manylinux1-x64.tar.gz -o cmake.tar.gz \
38+
&& tar xvzf cmake.tar.gz -C /usr/local \
39+
&& cmake --version \
40+
&& rm -f /tmp/cmake.tar.gz
41+
42+
###############################################################################
43+
# Install entrypoint
44+
###############################################################################
45+
ADD entrypoint.sh /usr/local/bin/builder
46+
RUN chmod a+x /usr/local/bin/builder
47+
ENTRYPOINT ["/usr/local/bin/builder"]

.github/docker-images/al2-x64/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amazonlinux:latest
1+
FROM amazonlinux:2023
22

33

44
###############################################################################

builder/core/host.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ def current_host():
7070
def _discover_host():
7171
platform = current_os()
7272
if platform == 'linux':
73-
if _file_contains('/etc/system-release', 'Amazon Linux release 2'):
73+
# Note: that AL2 and AL2023 have the same substring. Check for AL2023 explicitly.
74+
# And also check that AL2 has "2 (", which is common to all base distributions of AL2
75+
if _file_contains('/etc/system-release', 'Amazon Linux release 2023'):
76+
return 'al2023'
77+
if _file_contains('/etc/system-release', 'Amazon Linux release 2 ('):
7478
return 'al2'
7579
if _file_contains('/etc/system-release', 'Bare Metal') or _file_contains('/etc/system-release', 'Amazon Linux AMI'):
7680
return 'al2012'

0 commit comments

Comments
 (0)