我试图在微服务架构中使用Cassandra和最新版本的JHipster(3.0.0)。
以下是我目前采取的步骤:
npm install -g generator-jhipster
mkdir C:\users\jd\dev\sample && cd $_
mkdir sample-gateway && cd $_
yo jhipster... (Create a gateway application w/ Cassandra)
我已经安装了docker toolbox的最新测试版。从控制台,我可以看到以下内容:
c:\Users\jd\dev\sample\sample-gateway>docker -v
Docker version 1.10.3, build 20f81dd
c:\Users\jd\dev\sample\sample-gateway>docker-machine -v
docker-machine version 0.6.0, build e27fb87
我可以使用以下方式成功启动默认计算机:
C:\Users\jd>docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Stopped Unknown
C:\Users\jd>docker-machine start default
Starting "default"...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
C:\Users\jd>docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.100:2376 v1.10.3
当我运行Cassandra的构建步骤时,我收到以下错误:
C:\Users\jd\dev\sample\sample-gateway>docker-compose -f src\main\docker\cassandra.yml build
Building curatorial-cassandra
←[31mERROR←[0m: Couldn't connect to Docker daemon. You might need to install Docker:
https://docs.docker.com/engine/installation/
我可能会收到此错误的任何想法?
答案 0 :(得分:1)
我可能已找到解决方案......
看起来我需要运行$ docker-machine env default
的输出。
当我运行输出FOR /f "tokens=*" %i IN ('docker-machine env default') DO %i
时,我能够在我的控制台中看到它:
C:\Users\jd\dev\sample\sample-gateway>docker-compose -f src\main\docker\cassandra.yml build
Building sample-cassandra
←[31mERROR←[0m: Couldn't connect to Docker daemon. You might need to install Docker:
https://docs.docker.com/engine/installation/
C:\Users\jd\dev\sample\sample-gateway>FOR /f "tokens=*" %i IN ('docker-machine env default') DO %i
C:\Users\jd\dev\sample\sample-gateway>SET DOCKER_TLS_VERIFY=1
C:\Users\jd\dev\sample\sample-gateway>SET DOCKER_HOST=tcp://192.168.99.100:2376
C:\Users\jd\dev\sample\sample-gateway>SET DOCKER_CERT_PATH=C:\Users\jd\.docker\machine\machines\default
C:\Users\jd\dev\sample\sample-gateway>SET DOCKER_MACHINE_NAME=default
C:\Users\jd\dev\sample\sample-gateway>REM Run this command to configure your shell:
C:\Users\jd\dev\sample\sample-gateway>REM FOR /f "tokens=*" %i IN ('docker-machine env default') DO %i
C:\Users\jd\dev\sample\sample-gateway>docker-compose -f src\main\docker\cassandra.yml build
Building sample-cassandra
Step 1 : FROM cassandra:2.2.5
2.2.5: Pulling from library/cassandra
←[0Bd7827f33: Pulling fs layer
←[0B95caeb02: Pulling fs layer
←[0B03976053: Pulling fs layer
←[0B44d757b1: Pulling fs layer
←[0B8b59ac1b: Pulling fs layer
←[0Bbadb6c0c: Pulling fs layer
←[0B72404d3b: Pulling fs layer
←[0Bd13f7785: Pulling fs layer
←[0B4e7f1560: Pulling fs layer
←[3Bd13f7785: Downloading [========================> ] 61.61 MB/124.8 MB
我将推迟将此标记为答案,希望能够更全面了解docker-compose过程的人能够提供答案。
我还会尝试调查更多......