Pre-Requisites:
1. 1. Verify the Machine is Enabled with
Virtualization or not
Steps to Enable Hyper-V
2. Select Hyper-V and select both the Hyper-V Management Tools and Hyper-V Platform options
Pre-Requisites:
1. 1. Verify the Machine is Enabled with
Virtualization or not
Steps to Enable Hyper-V
2. Select Hyper-V and select both the Hyper-V Management Tools and Hyper-V Platform options
As an initial step to loading of docker images in Amazon ECR, Host machine installed with Docker and AWS CLI or AWSCLIV2
Docker on Ubuntu: https://devops-learner.blogspot.com/2019/10/how-to-install-and-setup-docker-in.html
Docker on AWS EC2: https://devops-learner.blogspot.com/2021/11/how-to-install-docker-on-amazon-ec2.html
Step 1: Let`s create dockerfile with a customized Apache httpd server
Step 2: Type the following command to build the Docker image using dockerfile
$ docker build -t apache-server -f httpd-Dockerfile .
Step 3: It will create a docker image, and you can check it by typing:
$ docker images
Step 4: Just for testing purposes, let's run a docker container using this docker image to check if everything works fine at the local host! We will run this container at port 9091 of localhost. Type the following command for that :
$ docker run -it --name apache-server -p 9091:80 httpd:latest
Now, since our docker image named “httpd” is been already created, it's time to move that image to AMAZON ECR!
Step 5: Log in to your amazon aws console and search for an ECR service to get started:
AWS CLIV2 on Windows: https://devops-learner.blogspot.com/2021/11/how-to-install-aws-cli-in-windows-10-64.html
AWS CLIV2 on Linux: https://devops-learner.blogspot.com/2022/01/how-to-install-aws-cli2-on-linux-ubuntu.html
Note: Login as the root user
Step 8: Once you type aws configure, it will ask the whole set of information to configure your account, like "access key", "secret access key", "region name" etc.Provide all the details and make sure your AWS user has permission to access AMAZON ECR service.
$ aws configure
$ vi config.json
Step 9: Once the ".docker" and "config.json" were created then update the necessary AWS ECR login credentials in the config.json file.
Step 10: once you get "Login succeeded", you are good to send your images to AWS ECR. Now you need to tag the image before you push it to the repo. Since our image is already created by <name>:<tag> i.e. apache-server:latest, let us tag this image, but here is the catch
AWS CLIV2 Installation instructions :
1. Use the curl command to download the "awscliv2.zip"
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
2. Unzip the installer
$ unzip awscliv2.zip
3. Run the install program. The installation command uses a file named install in the newly unzipped aws directory.by default files are all installed to /usr/local/aws-cli, and symbolic link is created in /usr/local/bin
$ sudo ./aws/install or ./aws/install -i
Optional: export PATH=/usr/local/bin/aws:$PATH
4. Use the which command to find your symlink and Use the ls command to find the directory that your symlink points to
$ which aws
$ ls -l /usr/local/bin/aws
5. Confirm the installation
$ aws --version
Kops: Kops is also known as Kubernetes Operations, it is an open-source project which helps you to create, upgrade, destroy, and maintain ...