Windows 下安装使用docker swarm machine docker toolbox
发布日期:2021-09-08 15:09:30 浏览次数:1 分类:技术文章

下载docker 集成安装环境

http://get.daocloud.io/#install-toolbox 这个网站很不错,下载

这个集成了 docker docker-machine ,还有git 环境

 

docker-machine 使用的官方网站在 http://docs.docker.com/machine/get-started/ 按照官方的一部一部的来

C:\Users\jackluo>shsh-3.1$ docker-machine create --driver virtualbox dev #创建机器Creating VirtualBox VM...Creating SSH key...Starting VirtualBox VM...Starting VM...To see how to connect Docker to this machine, run: d:\Program Files\Docker Toolbox\docker-machine.exe env devsh-3.1$ env "$(docker-machine env dev)"HOMEPATH=\Users\jackluoAPPDATA=C:\Users\jackluo\AppData\RoamingPROGRAMW6432=C:\Program FilesTERM=cygwinPROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntelWINDIR=C:\WindowsCOMMONPROGRAMW6432=C:\Program Files\Common FilesPUBLIC=C:\Users\PublicPROGRAMDATA=C:\ProgramDataUSERDOMAIN=jackluo-PCCOMMONPROGRAMFILES(X86)=C:\Program Files (x86)\Common FilesOS=Windows_NTALLUSERSPROFILE=C:\ProgramData!::=::\TEMP=/tmpCOMMONPROGRAMFILES=C:\Program Files (x86)\Common FilesUSERNAME=jackluoPROCESSOR_LEVEL=6PATH=/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/d/Program Files/TortoiseSVN/bin:/d/Program Files/nodejs/:/d/Program Files/TortoiseGit/bin:/cmd:/bin:/d/Go/bin:/d/program files/skype/Phone/:/d/HashiCorp/Vagrant/bin:/c/Wtem32/WindowsPowerShell/v1.0/:.:/d/Program Files/Boot2Docker for Windows:/c/Users/jackluo/AppData/Roaming/npm:/d/golang/bin:/bin:.:/d/Program Files/Docker ToolboxPSMODULEPATH=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\FP_NO_HOST_CHECK=NOPWD=/c/Users/jackluoSYSTEMDRIVE=C:PROCESSOR_ARCHITEW6432=AMD64USERPROFILE=C:\Users\jackluoLOGONSERVER=\\JACKLUO-PCPROCESSOR_ARCHITECTURE=x86LOCALAPPDATA=C:\Users\jackluo\AppData\Local!C:=C:\Users\jackluoSHLVL=1PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSCGOROOT=D:\Go\HOMEDRIVE=C:WINDOWS_TRACING_FLAGS=3WINDOWS_TRACING_LOGFILE=C:\BVTBin\Tests\installpackage\csilogfile.logVBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\PROMPT=$P$GCOMSPEC=C:\Windows\system32\cmd.exeTMP=/tmpSYSTEMROOT=C:\WindowsPROCESSOR_REVISION=3a09GOPATH=D:/golang;PROGRAMFILES=C:\Program Files (x86)NUMBER_OF_PROCESSORS=4PROGRAMFILES(X86)=C:\Program Files (x86)SESSIONNAME=ConsoleCOMPUTERNAME=JACKLUO-PC_=/bin/envexport DOCKER_TLS_VERIFY="1"export DOCKER_HOST="tcp://192.168.99.103:2376"export DOCKER_CERT_PATH="C:\Users\jackluo\.docker\machine\machines\dev"export DOCKER_MACHINE_NAME="dev"# Run this command to configure your shell:# eval "$(d:\Program Files\Docker Toolbox\docker-machine.exe env dev)"sh-3.1$ docker ps -a #可以执行命令了读取的就是

如果报了

Get http://127.0.0.1:2375/v1.20/containers/json?all=1: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it..
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running? 

这个错,就是机器没有初始化好,先删除了,再慢慢等吧,创建

 

 

 

整个流程基本都是按照 http://docs.docker.com/swarm/install-manual/ 这个操作

sh-3.1$ docker run --rm swarm createe6b07677f1fff45ebec4198ecbcb35f7sh-3.1$ docker ps -aCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMESsh-3.1$ docker run -d swarm join --addr=192.168.99.101:2376 token://e6b07677f1fff45ebec4198ecbcb35f7fd1fc6b456efd4df4e648b34ca301d8329052ff8c67dace2bf7fcf70be1db5c1sh-3.1$ docker ps -aCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMESfd1fc6b456ef        swarm               "/swarm join --addr=1"   4 seconds ago       Up 2 seconds        2375/tcp            lonely_lovelacesh-3.1$ docker ps -aCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMESsh-3.1$ docker run -d swarm join --addr=192.168.99.102:2376 token://4600de8f0e1340f4128ef072224cf7b563b9f7f29dd99bb04d8a83c0d5c7dcae8ed41e3fe19cf5d11a7d7d5655e51b2esh-3.1$ docker ps -aCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES63b9f7f29dd9        swarm               "/swarm join --addr=1"   18 seconds ago      Up 16 seconds       2375/tcp            distracted_teslash-3.1$ docker ps -aCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES63b9f7f29dd9        swarm               "/swarm join --addr=1"   4 minutes ago       Up 4 minutes        2375/tcp            distracted_teslash-3.1$ docker -H tcp://0.0.0.0:2375 infoAn error occurred trying to connect: Get https://0.0.0.0:2375/v1.20/info: dial tcp 0.0.0.0:2375: ConnectEx tcp: The requested address is not valid in its context.sh-3.1$ docker -H tcp://0.0.0.0:2376 infoAn error occurred trying to connect: Get https://0.0.0.0:2376/v1.20/info: dial tcp 0.0.0.0:2376: ConnectEx tcp: The requested address is not valid in its context.sh-3.1$ docker -H tcp://192.168.99.101:2376 infoContainers: 2Images: 8Storage Driver: aufs Root Dir: /mnt/sda1/var/lib/docker/aufs Backing Filesystem: extfs Dirs: 12 Dirperm1 Supported: trueExecution Driver: native-0.2Logging Driver: json-fileKernel Version: 4.0.9-boot2dockerOperating System: Boot2Docker 1.8.2 (TCL 6.4); master : aba6192 - Thu Sep 10 20:58:17 UTC 2015CPUs: 1Total Memory: 996.2 MiBName: swarm-masterID: LLV3:7ZEK:GBAV:BJXY:ORLX:FRZF:3F5V:2QHP:PQG4:D3BZ:ZMEP:Z6CWDebug mode (server): trueFile Descriptors: 17Goroutines: 25System Time: 2015-10-13T04:39:20.353680777ZEventsListeners: 0Init SHA1:Init Path: /usr/local/bin/dockerDocker Root Dir: /mnt/sda1/var/lib/dockerLabels: provider=virtualboxsh-3.1$ docker -H tcp://192.168.99.101:2375 infoAn error occurred trying to connect: Get https://192.168.99.101:2375/v1.20/info: dial tcp 192.168.99.101:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it.sh-3.1$ docker -H tcp://192.168.99.101:2376 listdocker: 'list' is not a docker command.See 'docker --help'.sh-3.1$ docker -H tcp://192.168.99.101:2375 infoAn error occurred trying to connect: Get https://192.168.99.101:2375/v1.20/info: tls: oversized record received with length 20527sh-3.1$ docker -H tcp://192.168.99.101:2376 infoContainers: 2Images: 8Storage Driver: aufs Root Dir: /mnt/sda1/var/lib/docker/aufs Backing Filesystem: extfs Dirs: 12 Dirperm1 Supported: trueExecution Driver: native-0.2Logging Driver: json-fileKernel Version: 4.0.9-boot2dockerOperating System: Boot2Docker 1.8.2 (TCL 6.4); master : aba6192 - Thu Sep 10 20:58:17 UTC 2015CPUs: 1Total Memory: 996.2 MiBName: swarm-masterID: LLV3:7ZEK:GBAV:BJXY:ORLX:FRZF:3F5V:2QHP:PQG4:D3BZ:ZMEP:Z6CWDebug mode (server): trueFile Descriptors: 22Goroutines: 33System Time: 2015-10-13T05:30:10.041167884ZEventsListeners: 0Init SHA1:Init Path: /usr/local/bin/dockerDocker Root Dir: /mnt/sda1/var/lib/dockerLabels: provider=virtualboxsh-3.1$ docker -H tcp://192.168.99.102:2376 infoContainers: 1Images: 8Storage Driver: aufs Root Dir: /mnt/sda1/var/lib/docker/aufs Backing Filesystem: extfs Dirs: 10 Dirperm1 Supported: trueExecution Driver: native-0.2Logging Driver: json-fileKernel Version: 4.0.9-boot2dockerOperating System: Boot2Docker 1.8.2 (TCL 6.4); master : aba6192 - Thu Sep 10 20:58:17 UTC 2015CPUs: 1Total Memory: 996.2 MiBName: swarm-agent-00ID: J3GU:RXI6:TNZ4:CDYG:GP4X:J2F5:TGJE:7ZYB:O5UG:3XR4:4XV5:3WNTDebug mode (server): trueFile Descriptors: 17Goroutines: 25System Time: 2015-10-13T05:30:58.47227003ZEventsListeners: 0Init SHA1:Init Path: /usr/local/bin/dockerDocker Root Dir: /mnt/sda1/var/lib/dockerLabels: provider=virtualboxsh-3.1$

这个坑太多了,其次,就是太慢,还是等稳定版再试吧

 

上一篇:算法学习之一 冒泡排序
下一篇:Windows 上如何安装Sqlite