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

Dockerfile

Use the below content to build your own docker image.

FROM amazonlinux:2 as installer
RUN yum update -y \
  && yum install -y unzip \
  && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \ 
  && unzip awscliv2.zip \
  # 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/
WORKDIR /aws

or Use the image from the public docker hub.

docker pull ahamedyaserarafath/awscli-bash

https://github.com/ahamedyaserarafath/awscli-bash

GitHub Link, Please feel free to fork and use it

Inspired from: https://hub.docker.com/r/amazon/aws-cli

Categorized in:

Tagged in:

,