MacOS can use Homebrew to install Docker
Homebrew Cask already supports Docker for Mac, so you can easily use Homebrew Cask to install:
Enter the command: brew cask install docker
The installation process is as shown in the figure above, and the
prompt docker was successfully installed! finally appears when the docker installation is successful, and finally you can see the downloaded docker.app in the startup console, as shown in the figure below:
Find the Docker icon at the top and click Run. You are prompted to enter the macOS login password. After entering the password, you can enter the following page
Click the Start button to start the basic docker operation steps (lazy operation, just click the docker command on the left, the command line on the right will automatically enter the docker command and execute it)
Step001: Clone a Repository (Clone a Repository)
Command explanation:
docker run --name repo alpine/git clone https://github.com/docker/getting-started.git
clone a container named alpine from the official github website and start it, and rename the container to repo
docker cp repo:/git/getting-started/.
Copy the directory of /git/getting-started/ of the container repo to the. directory of the host
When the prompt shown below appears on the right command line
Then click Next Step to enter step two
Step002: build the image (create a mirror)
Command explanation:
cd getting-started
into the getting-started directory
docker build -t docker101tutorial.
Use the Dockerfile in the current directory to create a mirror, labeled docker101tutorial
Click Next Step to enter step three
Step003: run your container (run container)
Command explanation:
docker run -d -p 80:80 --name docker-tutorial docker101tutorial
Use the mirror docker101tutorial to start a container in background mode and name the container docker-tutorial, and map the container's port 80 to the host's port 80
Click Next Step to go to step four
Step004: save and share your image (save and share your image)
The docker command indicated by the arrow in the above figure is grayed out and is not allowed to be clicked. The reason is that to share the image, you need to log in to the Docker Hub official website to perform this operation.
Click the Done button in Step004 to enter the following interface, indicating that the basic steps of using docker have been completed on the MacOS system
Welcome to pay attention to [The Way of Infinite Testing] public account , reply [receive resources],
Python programming learning resources dry goods,
Python+Appium framework APP UI automation,
Python+Selenium framework Web UI automation,
Python+Unittest framework API automation,
Resources and codes are sent for free~
There is a QR code of the official account at the bottom of the article, you can just scan it on WeChat and follow it.
Remarks: My personal public account has been officially opened, dedicated to the sharing of test technology, including: big data testing, functional testing, test development, API interface automation, test operation and maintenance, UI automation testing, etc., WeChat search public account: "Infinite The Way of Testing", or scan the QR code below:
Add attention and let us grow together!