kba / kraken-docker

Docker container for the kraken OCR engine
https://hub.docker.com/r/kbai/kraken/
MIT License
5 stars 6 forks source link

remove ENTRYPOINT #6

Closed lunactic closed 7 years ago

lunactic commented 8 years ago

Would it be possible to remove the ENTRYPOINT statement from the dockerfile?

I know it is very helpful when you run the image from the commandline but somehow it produces issues for me when I try to run the image from nodejs.

kba commented 8 years ago

What issues are caused by this? How are you using it in Node? If you are wrapping the docker run command line call, you can override the entrypoint with --entrypoint/-e, e.g. docker run --rm --entrypoint sh kbai/kraken -c 'find /kraken'.

lunactic commented 7 years ago

Sorry for the late response, other things kept me busy.

I am using the dockerode node.js library and make the call as following:

docker.run(myDockerImage, ['sh', '-c', myKrakenCommand], process.stdout, function(...){
}

I am pretty sure you are able to change the entrypoint somehow in there too... I'll drop off a question there.

kba commented 7 years ago

Nice, dockerode looks really cool, thanks for the pointer.

IIUC, you can use optional start_options and create_options. These seem to be the same options as in docker inspect, i.e. you should be able to do

docker.run(myDockerImage, ['-c', myKrakenCommand], process.stdout, {Entrypoint: '/bin/sh'} function(...){ }

Untested, https://github.com/apocas/dockerode/issues/314 might yield better results. If it's a persistent problem, I can change it, doesn't matter much for my usage.

lunactic commented 7 years ago

Amazing! That actually fixed it for me, although my call looks like this now:

docker.run(myDockerImage, ['-c', myKrakenCommand], process.stdout,{entrypoint: '/bin/sh'}, function(...), {}

(Notice the small "entrypoint". I didn't test with capital E but it works like this.