How to install Docker on Amazon Linux 2

How to install Docker on Amazon Linux 2

To install Docker on Amazon Linux 2, you can use the following steps:

  1. Update the package manager index:
    sudo yum update

  2. Install the dependencies for Docker:
    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    This installs the required packages for managing Docker packages and storage drivers.

  3. Add the Docker repository:
    sudo yum-config-manager --add-repo https://download.docker.com/linux/amazon/2/x86_64/stable/
    This adds the Docker repository to the package manager.

  4. Install Docker:
    sudo yum install docker-ce
    This installs the Docker engine and the docker command-line utility.

  5. Start the Docker daemon:
    sudo systemctl start docker
    This starts the Docker daemon, which is required to run Docker containers.

  6. Enable the Docker daemon to start at boot time:
    sudo systemctl enable docker
    This ensures that the Docker daemon is automatically started when the system boots.

You can verify the installation by running the docker --version command, which should display the version of Docker that you have installed.

Docker is a containerization platform that allows you to run and manage containers. It is useful for packaging and deploying applications and their dependencies in a lightweight and portable way.

Note: These steps assume that you are using Amazon Linux 2, which uses the yum package manager and the systemctl command to manage services. If you are using a different Linux distribution, you may need to use different commands to install and configure Docker.

Created Time:2017-10-16 14:38:46  Author:lautturi