In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the "Mac Docker installation and use tutorial", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and study the "Mac Docker installation and use tutorial" bar!
Mac Docker installation and use
[toc]
A brief introduction to Docker
Docker is an open source application container engine that allows developers to package their applications and dependencies into a portable image, publish them to any popular Linux or Windows machine, and virtualize them. Containers are fully sandboxed and will not have any interface with each other.
Entrance to the official website: http://www.docker.com
II. Docker installation
You can download the Docker installation package directly and install it manually, or you can install it through the Homebrew tool. Due to network reasons, it is recommended to install directly by downloading the installation package.
2.1 Homebrew install Docker
Execute the brew installation command directly in the terminal.
Note: the installation process may be due to network reasons may appear in the download failure prompt, directly re-execute the installation command to continue the installation.
Brew cask install docker;2.2 manually downloads the .dmg installation package for installation
As the Docker official website is deployed abroad, it can be downloaded through domestic images. The installation image of Aliyun can be used here.
Mac installation package:
Docker Toolbox is recommended for users below 10.10.3
Mac installation file: http://mirrors.aliyun.com/docker-toolbox/mac/docker-toolbox/
Docker for Mac is recommended for users above 10.10.3.
Mac installation file: http://mirrors.aliyun.com/docker-toolbox/mac/docker-for-mac/Windows installation package:
For users below Windows 10, Docker Toolbox is recommended.
Windows installation file: http://mirrors.aliyun.com/docker-toolbox/windows/docker-toolbox/
Docker for Windows is recommended for users with Windows 10 or above.
Windows installation files: http://mirrors.aliyun.com/docker-toolbox/windows/docker-for-windows/Linux installation package
Linux users can choose to download according to their own distribution.
Download address: http://mirrors.aliyun.com/docker-ce/linux/ 3. Configure Docker image agent
Open "Docker.app"
Go to the preferences page (shortcut key ⌘,)
Open the Daemon tab
Add https://docker.mirrors.ustc.edu.cn/ to "Registry mirrors"
Click the "Apply & Restart" button below
4. Docker command
After the Docker installation is finished, you can view the current Docker version information through the docker-v command.
We can type docker directly into the terminal to view all Docker customer order commands, or we can use docker-- help to view the detailed description of the specified command.
Common command description docker-v view current Docker version docker search find image docker pull pull or update specified image docker images view local image list docker rmi delete specified image docker run create a container and run docker ps view container startup docker start run specified container (one or more) docker stop stop specified running container docker restart restart specified container docker port view instruction Port mapping of the specified container docker rm deletes the specified container 5. Operation instructions (take Redis as an example)
Find Redis Mirror
Docker search redis
Pull the latest image of Redis
Docker pull redis:latest
View the images pulled locally
The docker images display information is as follows: REPOSITORY TAG IMAGE IDCREATED SIZEredis latest 63130206b0fa 2 days ago 98.2MB Information description: REPOSITORY: indicates the repository TAG of the current image: image label. Generally, the version is used to identify IMAGE ID: the unique IDCREATED of the image: image creation time SIZE: image size.
Create and run a Redis container
Docker run-- name mRedis-p 6379data:/data 6379-v / data:/data-d redis Startup parameters description:-- name: specify the alias of the container. Once specified, you can operate the container directly through the alias-p: map the container port to the local port, the front is the local port, followed by the container port-v: map the local directory to the container directory Here, map the local user directory ~ / data to the / data-d in the container: after the background running container starts successfully, check the container startup: docker ps displays the following information: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES8c283c2a4876 redis "docker-entrypoint.s …" 13 seconds ago Up 12 seconds 0.0.0.06379/tcp mRedis 6379-> 6379/tcp mRedis
Stop the Redis container
You can stop the container docker stop mRedis or docker stop 8c283c2a4876 through the container's CONTAINER ID or alias to thank you for reading, the above is the "installation and use of Mac Docker tutorial" content, after the study of this article, I believe you have a deeper understanding of the installation and use of Mac Docker tutorial, the specific use of the need for practice to verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.