mac上Docker安裝&初體驗

Docker是什麼?

Docker是一個虛擬環境容器,能夠將你的開發環境、代碼、配置文件等一併打包到這個容器中,併發布和應用到任意平臺中。nginx

官方文檔:https://docs.docker.comweb

Homebrew安裝

Homebrew的Cask已經支持Docker for Mac,所以能夠方便的使用Homebrew Cask來進行安裝。docker

➜  ~ brew cask install docker
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 4197, done.
remote: Counting objects: 100% (4197/4197), done.
remote: Compressing objects: 100% (4178/4178), done.
remote: Total 4197 (delta 26), reused 661 (delta 16), pack-reused 0
Receiving objects: 100% (4197/4197), 1.33 MiB | 931.00 KiB/s, done.
Resolving deltas: 100% (26/26), done.
Tapped 1 command and 4098 casks (4,207 files, 4.2MB).
==> Satisfying dependencies
==> Downloading https://download.docker.com/mac/stable/30215/Docker.dmg
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'docker'.
==> Installing Cask docker
==> Moving App 'Docker.app' to '/Applications/Docker.app'.
🍺  docker was successfully installed!

安裝完成以後,桌面有一個小鯨魚icon,雙擊就能夠啓動docker.服務器

docker簡單驗證

一、基本信息查看併發

➜  ~ docker --version
Docker version 18.09.1, build 4c52b90
➜  ~ docker-compose --version
docker-compose version 1.23.2, build 1110ad01
➜  ~ docker-machine --version
docker-machine version 0.16.1, build cce350d7
➜  ~ docker info
Containers: 0
 Running: 0

二、運行nginx服務器:app

docker run -d -p 80:80 --name webserver nginx

三、中止刪除Nginx服務器ui

➜  ~ docker stop webserver
webserver
➜  ~ docker rm webserver
webserver

四、鏡像下載code

docker pull katalonstudio/katalon

五、查看運行的鏡像server

docker images
相關文章
相關標籤/搜索