Simple Dockerfile with AWS CLI without entry point and this is useful during the continuous build process.


Use the below content to build your own docker image.

FROM amazonlinux:2 as installer
RUN yum update -y \
  && yum install -y unzip \
  && curl "" -o "" \ 
  && unzip \
  # The --bin-dir is specified so that we can copy the
  # entire bin directory from the installer stage into
  # into /usr/local/bin of the final stage without
  # accidentally copying over any other executables that
  # may be present in /usr/local/bin of the installer stage.
  && ./aws/install --bin-dir /aws-cli-bin/

FROM amazonlinux:2
RUN yum update -y \
  && yum install -y less groff git \
  && yum clean all \
  && rm -rf /var/cache/yum 
COPY --from=installer /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=installer /aws-cli-bin/ /usr/local/bin/

or Use the image from the public docker hub.

docker pull ahamedyaserarafath/awscli-bash

GitHub Link, Please feel free to fork and use it

Inspired from:

Categorized in:

Tagged in: