Skip to content

Commit 7fa68fa

Browse files
clareliguoririx0rrr
authored andcommitted
chore(cdk): Change Docker base image to Amazon Linux (aws#2625)
1 parent ca6c342 commit 7fa68fa

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
**/**/node_modules
12
.dockerignore
23
Dockerfile

Dockerfile

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
FROM node:8.15-alpine
1+
FROM amazonlinux:2
22

33
WORKDIR /app
44

5-
RUN apk add --update \
6-
bash \
5+
ENV NODE_VERSION 8.16.0
6+
7+
RUN yum -y --security update \
8+
&& yum install -y \
79
git \
810
rsync \
911
zip \
12+
unzip \
13+
tar \
14+
xz \
1015
python3 \
1116
python3-dev \
1217
py3-setuptools \
13-
&& rm -rf /var/cache/apk/*
18+
&& yum clean all \
19+
&& rm -rf /var/cache/yum \
20+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
21+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt" \
22+
&& grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
23+
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
24+
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
25+
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt
1426

1527
COPY . .
1628

link-all.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ for module in ${modules}; do
2525
# Symlink executable scripts into place as well. This is not completely
2626
# according to spec (we look in the bin/ directory instead of the { "scripts"
2727
# } entry in package.json but it's quite a bit easier.
28-
[[ -d $module/bin ]] && for script in $(find $module/bin -perm +111); do
29-
echo "${script} => node_modules/.bin/$(basename $script)"
30-
ln -fs ${script} node_modules/.bin
31-
done
28+
if [[ -d $module/bin ]]; then
29+
for script in $(find $module/bin -perm /111); do
30+
echo "${script} => node_modules/.bin/$(basename $script)"
31+
ln -fs ${script} node_modules/.bin
32+
done
33+
fi
3234
done

0 commit comments

Comments
 (0)