Skip to content

Instantly share code, notes, and snippets.

@SingingBush
Created November 27, 2020 16:26
Show Gist options
  • Save SingingBush/1328d98a38e528c51912ae85e5efd7e3 to your computer and use it in GitHub Desktop.
Save SingingBush/1328d98a38e528c51912ae85e5efd7e3 to your computer and use it in GitHub Desktop.
docker image of Amazon Linux with the aws-cli tools and Corretto installed with UK locale
# Amazon Linux with Amazon Corretto and the aws-cli tools for use in the UK (Amazon Linux uses yum)
FROM amazon/aws-cli:latest
# Set the default region for aws-cli
RUN mkdir /root/.aws && echo -e "[default]\nregion = eu-west-1" >> /root/.aws/config
# Set the locale to UK
ENV LANG en_GB.UTF-8
ENV LANGUAGE en_GB:en
ENV LC_ALL en_GB.UTF-8
## following taken drectly from amazoncorreto docker file:
ARG version=11.0.9.12-1
# In addition to installing the Amazon corretto, we also install
# fontconfig. The folks who manage the docker hub's
# official image library have found that font management
# is a common usecase, and painpoint, and have
# recommended that Java images include font support.
#
# See:
# https://github.com/docker-library/official-images/blob/master/test/tests/java-uimanager-font/container.java
# The logic and code related to Fingerprint is contributed by @tianon in a Github PR's Conversation
# Comment = https://github.com/docker-library/official-images/pull/7459#issuecomment-592242757
# PR = https://github.com/docker-library/official-images/pull/7459
RUN set -eux \
&& export GNUPGHOME="$(mktemp -d)" \
&& curl -fL -o corretto.key https://yum.corretto.aws/corretto.key \
&& gpg --batch --import corretto.key \
&& gpg --batch --export --armor '6DC3636DAE534049C8B94623A122542AB04F24E3' > corretto.key \
&& rpm --import corretto.key \
&& rm -r "$GNUPGHOME" corretto.key \
&& curl -fL -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo \
&& grep -q '^gpgcheck=1' /etc/yum.repos.d/corretto.repo \
&& yum install -y java-11-amazon-corretto-devel-$version \
&& (find /usr/lib/jvm/java-11-amazon-corretto -name src.zip -delete || true) \
&& yum install -y fontconfig \
&& yum clean all
ENV JAVA_HOME=/usr/lib/jvm/java-11-amazon-corretto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment