The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

vyurik (76) [Avatar] Offline
#1
Dear author,
I am following Chapter 3 Readme.md.
Section Running the services in Chapter 3 suggests this command from root of the project directory:
mvn clean package docker:build
I have this error
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.10:build (default-cli) on project configurationserver: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect -> [Help 1]

Your input is appreciated.
Vitaly
surjit_sen (5) [Avatar] Offline
#2
You have to set DOCKER_HOST env variable. Please see the following link:
https://github.com/spotify/docker-maven-plugin/issues/267
vyurik (76) [Avatar] Offline
#3
Hi surjit_sen,
Thanks for your response.
Since I am running Windows 10 Home, I am unable to download Docker HyperV and Docker Toolbox is my only option. I am able to install and start Docker Toolbox and I've set up DOCKER_HOST as you suggested.
From Cygwin I am running this command
env | grep DOCKER
which outputs.
DOCKER_HOST=tcp://192.168.99.100:2376

I don't have exception which I reported in my initial email. However, I have this one now while running the Chapter 3 app from Cygwin:
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.10:build (default-cli) on project configurationserver: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.client.ClientProtocolException: The server failed to respond with a valid HTTP response -> [Help 1]

General question (mostly to the author): Is it possible to run the book applications on Windows 10 Home or I need to have Mac OSX or Linux?

Thanks,
Vitaly

surjit_sen (5) [Avatar] Offline
#4
Hi Vitaly,
I apologize for providing you an incomplete answer earlier. You will also have to setup DOCKER_CERT_PATH which normally will be c:\Users\<username>\.docker\machine\machines\default. You can find all the DOCKER env variables by typing 'docker-machine env'. The last line will be as shown below. You should copy and paste that to the command prompt and then execute it.
@FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i
Hope this helps. Also I use Cmder instead of command prompt. You can download it for free. It is a wonderful replacement for the Windows command prompt and is also available in portable form
surjit_sen (5) [Avatar] Offline
#5
surjit_sen wrote:Hi Vitaly,
I apologize for providing you an incomplete answer earlier. You will also have to setup DOCKER_CERT_PATH which normally will be c:\Users\<username>\.docker\machine\machines\default. You can find all the DOCKER env variables by typing 'docker-machine env'. The last line will be as shown below. You should copy and paste that to the command prompt and then execute it.
@FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i
Hope this helps. Also I use Cmder instead of command prompt. You can download it for free. It is a wonderful replacement for the Windows command prompt and is also available in portable form
vyurik (76) [Avatar] Offline
#6
Thanks surjit_sen,
I followed you advice and run @FOR /f "tokens=*" %i IN ('docker-machine env') DO @%i on Windows.
Then tried to run mvn clean package docker:build on Windows and failed.
But I succeeded running mvn clean package docker:build on Cygwin.
I wish README.md has these instruction.
Thanks again and best regards,
vitaly
John C Carnell (44) [Avatar] Offline
#7
Hi Surjit Sen,

This is John the author. Thanks for the windows fix. I unfortunately only own Linux boxes and a Mac so these Windows specific issues irritate me. Appreciate the help and thank you for buying the book.

- John
71127 (1) [Avatar] Offline
#8
Hi John,

Great book, but I am also having the same problems with the Windows Linux Subsystem. Is there an update, anywhere, with instructions for running the build on Windows? I'm getting exactly the same messages as earlier in the thread, and I'd really like to do some coding, rather than faffing around with Linux command lines, trying to diagnose the error messages.

Thanks for your help in advance.

Jonathan.
367393 (2) [Avatar] Offline
#9
I had the same problem when trying to execute the docker commands for chapter 3 using windows solved this issue by
Exposing daemon to tcp://localhost:2375 without TLS , that option is found in docker for windows , you need to go to Docker -> Settings -> General
Check Option
“Expose daemon to tcp://localhost:2375 without TLS”
202622 (5) [Avatar] Offline
#10
367393 wrote:I had the same problem when trying to execute the docker commands for chapter 3 using windows solved this issue by
Exposing daemon to tcp://localhost:2375 without TLS , that option is found in docker for windows , you need to go to Docker -> Settings -> General
Check Option
“Expose daemon to tcp://localhost:2375 without TLS”



Thanks for this answer! I was having the same error, and this resolved it.
Running Windows 10 pro.