IBM-Blockchain-Archive / car-lease-demo

A demonstration using IBM Blockchain to show how the lifecycle of vehicles can be recorded on a blockchain
Other
169 stars 304 forks source link

app server image exits on `docker-compose up` #76

Closed evil-shrike closed 7 years ago

evil-shrike commented 7 years ago

I run docker-compose up on Windows 10 with Docker 1.13.0-rc3, build 4d92237 (w/Linux Containers).

It pulled and built images. But the images with app server exists on starts:

carleasedemo_car-lease-demo_1 exited with code 2

So only two images carleasedemo_vp0_1 and carleasedemo_membersrvc_1 runnung.

How can I find out what's happening?

liam-grace commented 7 years ago

If you run docker ls -a you should see the carleasedemo_car-lease-demo_1 image. Have you made the changes mentioned here

evil-shrike commented 7 years ago

I'm sorry, but what is docker ls -a? My docker has no such a command:

docker: 'ls' is not a docker command.

as for configuration.js, yes, I changed config.*Protocol to:

config.networkProtocol = 'http'; 
config.appProtocol = 'http'; 
config.hfcProtocol = 'grpc';
liam-grace commented 7 years ago

Sorry, that is my fault, I made a typo. I meant to say docker ps -a. This lists all of the docker containers that are/were running. If the demo started and quit, it will say 'exited'. You can run docker logs <id-of-the-docker-container> to see the car lease demo logs. You will find the id when you run the docker ps -a command

evil-shrike commented 7 years ago
C:\...D\hyperledger\car-lease-demo\Server_Side\configurations>docker logs a3478bc7045b
: not foundocker-startup.sh: 1: ./Scripts/docker-startup.sh:
: not foundocker-startup.sh: 3: ./Scripts/docker-startup.sh:
./Scripts/docker-startup.sh: 5: set: Illegal option -
evil-shrike commented 7 years ago

I've finally understood what was wrong. It's because of line endings - the repo has no .gitattributes, I cloned it onto Windows so with autocrlf=true I got Windows line endings in *.sh files and they failed inside Linux in Docker. I'd recommend adding .gitattributes file into the repo with (at least)

* text=auto
*.sh text eol=lf
bellaj commented 7 years ago

you are right if a user is under windows he should run

git config --global core.autocrlf false before to clone the repo