Amazon Linux AMI (Amazon Machine Image) which is based on Red Hat Enterprise Linux is a Linux Image available on Amazon Cloud to provide a stable, secure, and high-performance server platform. Just like CentOS, it is a derivative of RHEL, however, supported and maintained by Amazon Web Services to use on Amazon EC2 (Amazon Elastic Compute Cloud). This ensures the AWS users wouldn’t face any problems such as abandoning the project, remove long-term support, or delayed updates.
In case you want to experience AmazonLinux then we can install it on Docker Container, here are the steps to follow…
Install Docker -CE
Your existing system or server must have a pre-installed docker machine to download and use Amazon Linux. However, if you not, then follow the below links to set it up as per your OS.
- How to install Docker CE on Rocky Linux/CentOS/AlamaLInux 8
- Setup Docker on Ubuntu 20.04
- For Windows 10, use the Desktop version of Docker
Pull Amazonlinux 2.0 on Docker
Now, using the command tool of Docker, we will fetch the latest available version of this Linux server operating system.
docker pull amazonlinux
Using default tag: latest latest: Pulling from library/amazonlinux 3c2c91c7c431: Pull complete Digest: sha256:06b9e2433e4e563e1d75bc8c71d32b76dc49a2841e9253746eefc8ca40b80b5e Status: Downloaded newer image for amazonlinux:latest docker.io/library/amazonlinux:latest
Once the downloading of the AmazonLinux docker image is done, let’s use the
run command to create its container.
docker run -it --name amazon -d amazonlinux
Check running containers-
Connect Amazon Linux bash with root user rights
To connect the running container bash, execute the follwing command with root rights-
docker exec -it --user root amazond /bin/bash
To stop and start container:
docker stop amazon docker start amazon
- How to install and setup Docker Container on AlmaLinux 8
- Install Debian 11 Bullseye on Docker CE to test it
- Commands to Install & Run MariaDB on Docker Container