0% found this document useful (0 votes)
58 views

Mac Os: Chapter 1 Getting Started

This document provides instructions for installing Docker Desktop on Mac, Windows, and Linux systems. It explains how to download and install Docker Desktop on Mac by dragging the Docker icon to the Applications folder. For Linux, it provides commands to install Docker Engine and containerd using apt. It also explains how to install Docker Compose, which is used to define and run multi-container Docker applications using a YAML file.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Mac Os: Chapter 1 Getting Started

This document provides instructions for installing Docker Desktop on Mac, Windows, and Linux systems. It explains how to download and install Docker Desktop on Mac by dragging the Docker icon to the Applications folder. For Linux, it provides commands to install Docker Engine and containerd using apt. It also explains how to install Docker Compose, which is used to define and run multi-container Docker applications using a YAML file.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Chapter 1 Getting Started

administrator and navigate to Local Users and


Groups ➤ Groups ➤ docker-users. Right-click to
add the user to the group. Log out and log back in
for the changes to take effect.

Docker Desktop does not start automatically after installation. To


start Docker Desktop, search for Docker, and select Docker Desktop in the
search results. When the whale icon in the status bar stays steady, Docker
Desktop is up, running, and accessible from any terminal window.

Mac OS
Go to https://docs.docker.com/docker-for-mac/install/, shown in
Figure 1-2.

Figure 1-2. Download options for Docker for Mac

Double-click Docker.dmg to open the installer and then drag the


Docker icon to the Applications folder, as shown in Figure 1-3.

6
Chapter 1 Getting Started

Figure 1-3. Moving the Docker application to the Applications folder

Double-click Docker.app in the Applications folder to start Docker.


(In Figure 1-4, the Applications folder is in grid view mode.)

Figure 1-4. Docker Applications folder

The Docker menu in the top status bar indicates that Docker Desktop
is running and accessible from a terminal.

Linux
Go to https://docs.docker.com/engine/install/. Here you will find
links to instructions on how to install Docker on several popular Linux

7
Chapter 1 Getting Started

distributions. If you are using Debian/Ubuntu, you can follow these


instructions (https://docs.docker.com/engine/install/ubuntu/):

1) Ensure that any older installation is removed from


the system.

<code>
sudo apt-get remove docker docker-engine docker.io
containerd runc
</code>

2) Update the apt package index and install packages


to allow apt to use a repository over HTTPS.

<code>
sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
</code>

3) Add Docker’s official GPG key.

<code>
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo
gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
</code>

4) Use the following command to set up the stable


repository. To add the nightly or test repository,
add the word nightly or test (or both) after the
word stable.

8
Chapter 1 Getting Started

<code>
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
</code>

5) Update the apt package index and install the latest


version of Docker Engine and container.

<code>
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
</code>

If you have any difficulties or need to install a specific version of


Docker for your system, please visit https://docs.docker.com/engine/
install/ where they cover many more options and configurations than is
possible in the scope of this section.
Once Docker is installed, you will need to install docker-compose.
Compose is a tool for defining and running multi-container Docker
applications. Compose allows you to define an application within the
confines of a YAML (Yet Another Markup Language) file. This allows you to
spin up all of the defined services for your Docker container with a single
command. This is often used within development teams to ensure version
control and maintain use of third-party applications. Other features of
Compose are

• Multiple isolated environments on a single host

• Preserving volume data when containers are created

• Only recreating containers that have changed

9
Chapter 1 Getting Started

• Variables and moving a composition between


environments

More on these features can be found at https://docs.docker.com/


compose/#features.

Installing Docker-Compose
Mac and Windows users that have installed Docker Desktop can skip the
installation step because Compose is included with the installed package.

1) For Linux users, run this command to download the


current stable release of Docker Compose:

<code>
sudo curl -L "https://github.com/docker/compose/releases/
download/1.29.1/docker-compose-$(uname -s)-$(uname -m)" -o /
usr/local/bin/docker-compose
</code>

2) Apply executable permissions to the binary.

<code>
sudo chmod +x /usr/local/bin/docker-compose
</code>

Note If the command docker-compose fails after installation,


check your path. You can also create a symbolic link to /usr/bin or
any other directory in your path.

10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy