Skip to content

Commit

Permalink
chore(dockerfile): deprecated the al1 and al2 build images
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay2113 committed May 25, 2023
1 parent 21e9c15 commit 6437f80
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 445 deletions.
6 changes: 5 additions & 1 deletion images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
</a>
</p>
<h1 align="center">
Amplify Hosting - Build Images
Amplify Hosting - Build Images [DEPRECATED]
</h1>

<a href="https://docs.aws.amazon.com/amplify/latest/userguide/welcome.html">Amplify Hosting</a> provides 2 build images that are based on Amazon Linux. The latest build image is based on Amazon Linux 2, but we also provide the orginal build image that is based on Amazon Linux 1 for backwards compatibility. These images are used as defaults for builds in Amplify Console, we also provide the option to use a <a href="https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html#setup">custom image</a> however.

### Building the images

Build the latest Docker image:

```bash
$ docker build -t amplify-console/buildimage:latest -f latest/Dockerfile
```
Expand All @@ -22,11 +24,13 @@ $ docker build -t amplify-console/buildimage:amazonlinux1 -f amazonlinux1/Docker
```

Launch the latest Docker image locally:

```bash
$ docker run -it amplify-console/buildimage:latest /bin/bash
```

This will launch a container locally and drop you into the container with Bash.

### Updates to Amplify Hosting build images

These images are maintained by the Amplify Hosting team and automatically published to GitHub. We appreciate and encourage contributions from the community! The process for merging pull-requests happens outside of GitHub however, and will then be automatically published to GitHub.
244 changes: 1 addition & 243 deletions images/amazonlinux1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,243 +1 @@
# Use the standard Amazon Linux base, provided by ECR/KaOS
# It points to the standard shared Amazon Linux image, with a versioned tag.
FROM amazonlinux:1
MAINTAINER Amazon AWS

# Framework Versions
ENV VERSION_NODE_8=8.12.0
ENV VERSION_NODE_6=6
ENV VERSION_NODE_10=10
ENV VERSION_NODE_DEFAULT=$VERSION_NODE_8
ENV VERSION_RUBY_2_3=2.3.6
ENV VERSION_RUBY_2_4=2.4.3
ENV VERSION_RUBY_DEFAULT=$VERSION_RUBY_2_3
ENV VERSION_HUGO=0.51
ENV VERSION_YARN=1.13.0
ENV VERSION_AMPLIFY=1.7.0

# UTF-8 Environment
ENV LANGUAGE en_US:en
ENV LANG=en_US.UTF-8
ENV LC_ALL en_US.UTF-8

## Install OS packages
RUN touch ~/.bashrc
RUN yum -y update && \
yum -y install \
autoconf \
automake \
bzip2 \
bison \
bzr \
cmake \
expect \
fontconfig \
git \
gcc-c++ \
libpng \
libpng-devel \
libffi-devel \
libtool \
libX11 \
libXext \
libxml2 \
libxml2-devel \
libxslt \
libxslt-devel \
libyaml \
libyaml-devel \
openssl-devel \
openssh-clients \
patch \
procps \
python34 \
python34-devel \
python34-pip \
readline-devel \
sqlite-devel \
tar \
tree \
unzip \
wget \
which \
zip \
zlib \
zlib-devel \
yum clean all && \
rm -rf /var/cache/yum

## Install Node 6 & 8 & 10
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
RUN curl -o- -L https://yarnpkg.com/install.sh > /usr/local/bin/yarn-install.sh
RUN /bin/bash -c ". ~/.nvm/nvm.sh && \
nvm install $VERSION_NODE_6 && nvm use $VERSION_NODE_6 && \
nvm install $VERSION_NODE_10 && nvm use $VERSION_NODE_10 && \
nvm install $VERSION_NODE_8 && nvm use $VERSION_NODE_8 && \
npm install -g sm grunt-cli bower vuepress gatsby-cli && \
bash /usr/local/bin/yarn-install.sh --version $VERSION_YARN && \
nvm alias default node && nvm cache clear"

## Install Ruby 2.3.x and 2.4.x
RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys D39DC0E3 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
curl -sL https://get.rvm.io | bash -s stable --with-gems="bundler"

ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN /bin/bash --login -c "\
rvm install $VERSION_RUBY_2_3 && rvm use $VERSION_RUBY_2_3 && gem install bundler -v 1.17.3 && gem install jekyll && \
rvm install $VERSION_RUBY_2_4 && rvm use $VERSION_RUBY_2_4 && gem install bundler -v 1.17.3 && gem install jekyll && \
rvm cleanup all"

## Install awscli
RUN /bin/bash -c "\
mv /usr/bin/python /usr/bin/python2 && \
ln -s /usr/bin/python3 /usr/bin/python && \
pip-3.4 install awscli && rm -rf /var/cache/apk/*"

## Install Hugo
RUN wget https://github.com/gohugoio/hugo/releases/download/v${VERSION_HUGO}/hugo_${VERSION_HUGO}_Linux-64bit.tar.gz && \
tar -xf hugo_${VERSION_HUGO}_Linux-64bit.tar.gz hugo -C / && \
mv /hugo /usr/bin/hugo && \
rm -rf hugo_${VERSION_HUGO}_Linux-64bit.tar.gz

## Install AWS Amplify CLI for VERSION_NODE_DEFAULT and VERSION_NODE_10
RUN /bin/bash -c ". ~/.nvm/nvm.sh && nvm use ${VERSION_NODE_DEFAULT} && \
npm install -g @aws-amplify/cli@${VERSION_AMPLIFY}"
RUN /bin/bash -c ". ~/.nvm/nvm.sh && nvm use ${VERSION_NODE_10} && \
npm install -g @aws-amplify/cli@${VERSION_AMPLIFY}"

## Environment Setup
RUN echo export PATH="\
/usr/local/rvm/gems/ruby-${VERSION_RUBY_DEFAULT}/bin:\
/usr/local/rvm/gems/ruby-${VERSION_RUBY_DEFAULT}@global/bin:\
/usr/local/rvm/rubies/ruby-${VERSION_RUBY_DEFAULT}/bin:\
/usr/local/rvm/bin:\
/root/.yarn/bin:\
/root/.config/yarn/global/node_modules/.bin:\
/root/.nvm/versions/node/${VERSION_NODE_DEFAULT}/bin:\
$PATH" >> ~/.bashrc && \
echo export GEM_PATH="/usr/local/rvm/gems/ruby-${VERSION_RUBY_DEFAULT}" >> ~/.bashrc && \
echo "nvm use ${VERSION_NODE_DEFAULT} 1> /dev/null" >> ~/.bashrc

ENTRYPOINT [ "bash", "-c" ]

# Use the standard Amazon Linux base, provided by ECR/KaOS
# It points to the standard shared Amazon Linux image, with a versioned tag.
FROM 137112412989.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:1
MAINTAINER Amazon AWS

# Framework Versions
ENV VERSION_NODE_8=8.12.0
ENV VERSION_NODE_6=6
ENV VERSION_NODE_10=10
ENV VERSION_NODE_DEFAULT=$VERSION_NODE_8
ENV VERSION_RUBY_2_3=2.3.6
ENV VERSION_RUBY_2_4=2.4.3
ENV VERSION_RUBY_DEFAULT=$VERSION_RUBY_2_3
ENV VERSION_HUGO=0.51
ENV VERSION_YARN=1.13.0
ENV VERSION_AMPLIFY=1.7.0

# UTF-8 Environment
ENV LANGUAGE en_US:en
ENV LANG=en_US.UTF-8
ENV LC_ALL en_US.UTF-8

## Install OS packages
RUN touch ~/.bashrc
RUN yum -y update && \
yum -y install \
autoconf \
automake \
bzip2 \
bison \
bzr \
cmake \
expect \
fontconfig \
git \
gcc-c++ \
libpng \
libpng-devel \
libffi-devel \
libtool \
libX11 \
libXext \
libxml2 \
libxml2-devel \
libxslt \
libxslt-devel \
libyaml \
libyaml-devel \
openssl-devel \
openssh-clients \
patch \
procps \
python34 \
python34-devel \
python34-pip \
readline-devel \
sqlite-devel \
tar \
tree \
unzip \
wget \
which \
zip \
zlib \
zlib-devel \
yum clean all && \
rm -rf /var/cache/yum

## Install Node 6 & 8 & 10
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
RUN curl -o- -L https://yarnpkg.com/install.sh > /usr/local/bin/yarn-install.sh
RUN /bin/bash -c ". ~/.nvm/nvm.sh && \
nvm install $VERSION_NODE_6 && nvm use $VERSION_NODE_6 && \
nvm install $VERSION_NODE_10 && nvm use $VERSION_NODE_10 && \
nvm install $VERSION_NODE_8 && nvm use $VERSION_NODE_8 && \
npm install -g sm grunt-cli bower vuepress gatsby-cli && \
bash /usr/local/bin/yarn-install.sh --version $VERSION_YARN && \
nvm alias default node && nvm cache clear"

## Install Ruby 2.3.x and 2.4.x
RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys D39DC0E3 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
curl -sL https://get.rvm.io | bash -s stable --with-gems="bundler"

ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN /bin/bash --login -c "\
rvm install $VERSION_RUBY_2_3 && rvm use $VERSION_RUBY_2_3 && gem install bundler -v 1.17.3 && gem install jekyll && \
rvm install $VERSION_RUBY_2_4 && rvm use $VERSION_RUBY_2_4 && gem install bundler -v 1.17.3 && gem install jekyll && \
rvm cleanup all"

## Install awscli
RUN /bin/bash -c "\
mv /usr/bin/python /usr/bin/python2 && \
ln -s /usr/bin/python3 /usr/bin/python && \
pip-3.4 install awscli && rm -rf /var/cache/apk/*"

## Install Hugo
RUN wget https://github.com/gohugoio/hugo/releases/download/v${VERSION_HUGO}/hugo_${VERSION_HUGO}_Linux-64bit.tar.gz && \
tar -xf hugo_${VERSION_HUGO}_Linux-64bit.tar.gz hugo -C / && \
mv /hugo /usr/bin/hugo && \
rm -rf hugo_${VERSION_HUGO}_Linux-64bit.tar.gz

## Install AWS Amplify CLI for VERSION_NODE_DEFAULT and VERSION_NODE_10
RUN /bin/bash -c ". ~/.nvm/nvm.sh && nvm use ${VERSION_NODE_DEFAULT} && \
npm install -g @aws-amplify/cli@${VERSION_AMPLIFY}"
RUN /bin/bash -c ". ~/.nvm/nvm.sh && nvm use ${VERSION_NODE_10} && \
npm install -g @aws-amplify/cli@${VERSION_AMPLIFY}"

## Environment Setup
RUN echo export PATH="\
/usr/local/rvm/gems/ruby-${VERSION_RUBY_DEFAULT}/bin:\
/usr/local/rvm/gems/ruby-${VERSION_RUBY_DEFAULT}@global/bin:\
/usr/local/rvm/rubies/ruby-${VERSION_RUBY_DEFAULT}/bin:\
/usr/local/rvm/bin:\
/root/.yarn/bin:\
/root/.config/yarn/global/node_modules/.bin:\
/root/.nvm/versions/node/${VERSION_NODE_DEFAULT}/bin:\
$PATH" >> ~/.bashrc && \
echo export GEM_PATH="/usr/local/rvm/gems/ruby-${VERSION_RUBY_DEFAULT}" >> ~/.bashrc && \
echo "nvm use ${VERSION_NODE_DEFAULT} 1> /dev/null" >> ~/.bashrc

ENTRYPOINT [ "bash", "-c" ]
# This docker file has been deprecated. Please refer to https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html to configure your own custom build image.

0 comments on commit 6437f80

Please sign in to comment.