Installing AWS CLI with Dockers

  • Setting up Docker container with help of plain Docker-Image.
  • Installing simple softwares like GIT & JDK on container.
  • Installing softwares like sudo, curl, zip, unzip, python3 and python3.8-venv, aws-cli, sam-cli onto our container.
  • Generating custom image with work(i.e. softwares installed) being saved.
  • Pushing the custom image to our public DockerHub repository.
docker image pull ubuntu
docker container run -it ubuntu
apt-get update && apt-get install git
apt-get update && apt-get install -y openjdk-8-jdk
javac -version
docker container commit -a “Ubuntu + JDK + Git image” 98 ubuJdkGitAdityaImage
docker container ls -a
docker container rm <container_id>
docker images
docker container run -itd <NAME_OF_DOCKER_IMAGE>
OR
docker container run -itd <DOCKER_IMAGE_ID>
  • We had ran the container with “-i” option which means interactive mode.
  • We had ran the container with “-t” option which means, we shall connect to the container’s terminal as well.
  • We had ran the container with “-d” option which means, we shall run this container in detached mode.
  • In the fresh container that we just launched, observe that both GIT & JDK are already installed, as we did the same in it’s previous container from which we formed this image.
docker container ps -a
docker container exec -it <CONTAINER_ID> bash
apt update && apt upgrade
apt install curl
apt install sudo
apt-get install zip
apt-get install unzip
apt-get install python3
apt install python3.8-venv
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
ls
unzip <PACKAGE_NAME>
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
aws --version
docker cp aws-sam-cli-linux-x86_64.zip 9090f8d966d0:/aws-sam-cli-linux-x86_64.zip
ls
unzip aws-sam-cli-linux-x86_64.zip -d sam-installation
ls
sudo ./sam-installation/install
sam --version
docker container ps -a
docker container commit -a "ubun+jdk+git+aws_sam docker image" 9090f8d966d0 ubu-with-aws-enhanced-image-by-aditya
docker images
docker login
docker image tag 80ae6e7c21e9 adityagoel123/ubuwithawsdockimage
docker images
docker image push adityagoel123/ubuwithawsdockimage

--

--

--

Software Engineer for Big Data distributed systems

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A tip for using AWS SDK on EC2 with role to get security credentional

[2022] How to set a notification from GitLab to Slack

Insertion Sort Linked List

RE-COM Can Clip Bluetooth Interface For Renault OBD Diagnostic&Programming

Jamstack FAQ — What? Why? And Why Not?

Building Enterprise Apps with Unity — Separating our UI elements from the information pages.

The irony of software engineering

How to avoid BroadcastNestedJoin in Spark

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
aditya goel

aditya goel

Software Engineer for Big Data distributed systems

More from Medium

How To Deploy NodeJS APIs on AWS EKS using HELM

Deploy Apache NiFi on Docker with AWS EC2 instance and Connect to Web Interface

user groups

Serverless applications in AWS using Chalice — #18

AWS Lambda Hands-On| Part-3