日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

docker-machine

發布時間:2024/4/14 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 docker-machine 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

docker-machine

  • 查看可用鏡像
    docker-machine ls
  • 建立一個節點[root@localhost tmp]# docker-machine create --driver virtualbox default
[root@localhost tmp]# docker-machine create --driver virtualbox default Running pre-create checks... Creating machine... (default) Copying /root/.docker/machine/cache/boot2docker.iso to /root/.docker/machine/machines/default/boot2docker.iso... (default) Creating VirtualBox VM... (default) Creating SSH key... (default) Starting the VM... (default) Check network to re-create if needed... (default) Found a new host-only adapter: "vboxnet0" (default) Waiting for an IP... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with boot2docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Checking connection to Docker... Docker is up and running! To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env default

(如果系統沒有預先安裝好boot2docker,需要FQ下載該鏡像。)

[root@localhost tmp]# proxychains4 wget https://github.com/boot2docker/boot2docker/releases/download/v17.06.2-ce/boot2docker.iso[root@localhost tmp]# cp boot2docker.iso /root/.docker/machine/cache/
  • 顯示可用的節點 docker-machine ls
[root@localhost tmp]# docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default - virtualbox Running tcp://192.168.99.100:2376 v17.06.2-ce
  • 告知 Docker 去 聯系新的機器
[centos@localhost tmp]$ docker-machine env Error checking TLS connection: machine does not exist [centos@localhost tmp]$ sudo -s [sudo] password for centos: [root@localhost tmp]# docker-machine env export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/root/.docker/machine/machines/default" export DOCKER_MACHINE_NAME="default" # Run this command to configure your shell: # eval $(docker-machine env) [root@localhost tmp]# eval $(docker-machine env)
  • 獲取節點的ip地址 docker-machine ip default
[root@localhost tmp]# docker run -d -p 8000:80 nginx [root@localhost tmp]# curl $(docker-machine ip default):8000 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style>body {width: 35em;margin: 0 auto;font-family: Tahoma, Verdana, Arial, sans-serif;} </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p><p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p><p><em>Thank you for using nginx.</em></p> </body> </html>
  • 停止一個節點
[root@localhost tmp]# docker-machine stop Stopping "default"... Machine "default" was stopped.

轉載于:https://www.cnblogs.com/Ethan2lee/p/7508442.html

總結

以上是生活随笔為你收集整理的docker-machine的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。