Install Docker on Windows

Go to Docker Community Store then download and install Docker Community Edition for Windows. The installation provides Docker Engine, Docker CLI client, Docker Compose, Docker Machine, and Kitematic.

NOTE:

  • Docker for Windows requires Microsoft Hyper-V. When you install Docker for windows it will enable Hyper-V which disables VirtualBox.
  • Virtualization must be enabled in BIOS and CPU SLAT-capable. Generally it is enabled by default. If you are having issues see: Virtualization must be enabled
  • Containers and images are shared between all user accounts on Windows.
  • Nested virtualization is not guaranteed. If this is what you are doing see: Running Docker for Windows in nested virtualization scenarios

Docker Account

Once you have installed Docker, it will ask you to log in to your Docker account. If you do not have an account yet, go to Docker Store and create an account.

Check that Docker is running

1. Open command prompt and type:

> docker version

The command should return docker version information. If not check docker is in the windows path variables.

2. Check your windows services and you should find "Docker for Windows Service" is "Running"

3. Once you have installed Docker and restarted your computer, you should see the icon in the system tray.

Right clicking the icon will bring up a bunch of options. "Switch to..." lets you change between windows and linix containers. Then there is a settings option which has a whole bunch of more stuff which you can go through.

collapse
Install Docker on CentOs 7

Step 1 - Update OS

Update the package database

$ sudo yum check-update

Step 2 - Install Docker

Download and install the latest version of Docker.

$ curl -fsSL https://get.docker.com/ | sh

Step 3 - Start Docker

Start the Docker daemon.

$ sudo systemctl start docker

Step 4 - Confirm Docker start

Confirm that Docker has started up.

$ sudo systemctl status docker

Example Response:

docker.service - Docker Application Container Engine

Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)

Active: active (running) since Mon 2017-02-27 19:19:28 SAST; 18s ago

Docs: https://docs.docker.com

Main PID: 1402 (dockerd)

Tasks: 18

Memory: 112.6M

CGroup: /system.slice/docker.service

$ sudo docker -v

Docker version 18.09.9-ce, build 039a7df

Step 5 - Enable Docker

Enable Docker so that it starts up with every reboot.

$ sudo systemctl enable docker

Step 6 - Docker privileges

Docker command requires root privileges (sudo prefix). If you run a Docker command without sudo you will get:

docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.

See 'docker run --help'.

Run the below command so that Docker does not require sudo. (Replace "myUsername" with your username)

$ sudo usermod -aG docker myUsername

To apply the privileges: log out and log back in.

collapse
Install Docker on Amazon Linux 2

Step 1 - Update OS

Update the package database

$ sudo yum update -y

Step 2 - Install Docker

Download and install the latest version of Docker.

$ sudo amazon-linux-extras install docker

Step 3 - Start Docker

Start the Docker daemon.

$ sudo service docker start

Step 4 - Confirm Docker start

Confirm that Docker has started up.

$ sudo systemctl status docker

Example Response:

docker.service - Docker Application Container Engine

Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)

Active: active (running) since Mon 2017-02-27 19:19:28 SAST; 18s ago

Docs: https://docs.docker.com

Main PID: 1402 (dockerd)

Tasks: 18

Memory: 112.6M

CGroup: /system.slice/docker.service

$ sudo docker -v

Docker version 18.09.9-ce, build 039a7df

Step 5 - Enable Docker

Enable Docker so that it starts up with every reboot.

$ sudo systemctl enable docker

Step 6 - Docker privileges

Docker command requires root privileges (sudo prefix). If you run a Docker command without sudo you will get:

docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.

See 'docker run --help'.

Run the below command so that Docker does not require sudo. (ec2-user is the standard user for amazon linux but replace if need)

$ sudo usermod -a -G docker ec2-user

To apply the privileges: log out and log back in.

collapse

Check out these links for more info:

My Docker Samples