Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cdk): Change Docker base image to Amazon Linux #2625

Merged
merged 1 commit into from
May 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note on this change: This format causes ./link-all.sh to return with exit code 1, because the last module doesn't have a bin directory, which fails the Docker image build.

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note on this change (-perm +111 to -perm /111). The syntax -perm +omode was removed in findutils 4.5.12, in favour of -perm /omode. Ubuntu 18.04 has findutils 4.6.0. AL2 has findutils 4.5.11, which provides this warning:
The interpretation of -perm +omode changed in findutils-4.5.11 and returns no values.

echo "${script} => node_modules/.bin/$(basename $script)"
ln -fs ${script} node_modules/.bin
done
fi
done