安裝
由于我本人使用的linux系統,原生支持docker,相對安裝還是比較簡單的
1:使用下面的官方腳本安裝:
wget -qO- https://get.docker.com/ | sh
2:輸入下面的命令驗證是否可以查看版本號,可以就是安裝成功
sudo docker version
3:建議把當前使用的用戶加到Docker用戶組,就可以不用很次都sudo了
sudo usermod -aG docker your_username
4:重新登錄,sudo權限才會成效
logout
至此,你的docker環境就已經很快的安裝完了
簡單使用
一切從hello world開始,如下命令
docker run hello-world
你大致會看到如下內容
Hello from Docker!This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/For more examples and ideas, visit: https://docs.docker.com/engine/userguide/
現在就開始開始自己的docker學習之旅吧!
以上所述是小編給大家介紹的Docker安裝和簡單使用入門教程,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對VEVB武林網網站的支持!
新聞熱點
疑難解答
圖片精選