Docker - Basic Information
- What is Docker?
Docker is a powerful platform for building, shipping, and running applications in lightweight, portable containers. It ensures that an application runs consistently across different environments, from development to production. This tutorial will guide you through the basics of Docker, including installation, basic commands, and running your first application in a container.
Installing Docker
Before you can use Docker, you need to install it. Here are the steps to install Docker on various operating systems:
On Windows and macOS
- Download Docker Desktop from the official Docker website.
- Follow the installation instructions for your operating system.
- Once installed, launch Docker Desktop and follow the on-screen instructions to complete the setup.
On Linux
For Ubuntu, you can install Docker by running the following commands:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce
To verify the installation, run:
docker --version