Skip to content

Commit

Permalink
chore(cdk): Change Docker base image to Amazon Linux (#2625)
Browse files Browse the repository at this point in the history
  • Loading branch information
clareliguori authored and rix0rrr committed May 24, 2019
1 parent ca6c342 commit 7fa68fa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/**/node_modules
.dockerignore
Dockerfile
20 changes: 16 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
FROM node:8.15-alpine
FROM amazonlinux:2

WORKDIR /app

RUN apk add --update \
bash \
ENV NODE_VERSION 8.16.0

RUN yum -y --security update \
&& yum install -y \
git \
rsync \
zip \
unzip \
tar \
xz \
python3 \
python3-dev \
py3-setuptools \
&& rm -rf /var/cache/apk/*
&& yum clean all \
&& rm -rf /var/cache/yum \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt" \
&& grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt

COPY . .

Expand Down
10 changes: 6 additions & 4 deletions link-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ for module in ${modules}; do
# Symlink executable scripts into place as well. This is not completely
# according to spec (we look in the bin/ directory instead of the { "scripts"
# } entry in package.json but it's quite a bit easier.
[[ -d $module/bin ]] && for script in $(find $module/bin -perm +111); do
echo "${script} => node_modules/.bin/$(basename $script)"
ln -fs ${script} node_modules/.bin
done
if [[ -d $module/bin ]]; then
for script in $(find $module/bin -perm /111); do
echo "${script} => node_modules/.bin/$(basename $script)"
ln -fs ${script} node_modules/.bin
done
fi
done

0 comments on commit 7fa68fa

Please sign in to comment.