0

I start

docker run --rm -it -v $(pwd):/data -p 8080:80 klokantech/tileserver-gl --verbose

I took this in a Dockerfile:

FROM klokantech/tileserver-gl:v2.2.0
ADD . /data

But how can I call the klokantech/tileserver-gl option "--verbose" in Dockerfile?

Gerd
  • 2,265
  • 1
  • 27
  • 46
  • 1
    See [cmd](https://docs.docker.com/engine/reference/builder/#cmd) and [entrypoint](https://docs.docker.com/engine/reference/builder/#entrypoint) documentation, as well as this SO answer (https://stackoverflow.com/questions/21553353/what-is-the-difference-between-cmd-and-entrypoint-in-a-dockerfile?rq=1). This should get you moving in the right direction. – bluescores Nov 21 '17 at 14:18

2 Answers2

1

If your option "--verbose" is static then you have to add it as ENV in dockerfile,

else if you options is dynamic then you have to use ARG command in dockerfile,so that you can pass argument while building docker image without changing dockerfile

ref : https://docs.docker.com/engine/reference/builder/#arg

sanath meti
  • 5,179
  • 1
  • 21
  • 30
  • "--verbose" is an argument of klokantech/tileserver-gl. I think the image start implicit a script and use the arguments. But >>ARG "--verbose"<< not work. Server start but not verbose! – Gerd Nov 21 '17 at 16:28
  • 1
    Ok, as your using the pre-built image of tileserver which expoes options filed explicitly. So u need to use option during docker run . Ref : http://tileserver.readthedocs.io/en/latest/installation.html – sanath meti Nov 21 '17 at 17:09
0

In case of "klokantech/tileserver-gl --verbose" the argument is used by an implicit startscript on boot of the image. This argument is not in Dockerfile.

docker build -t "test:myimage" .
docker run test:myimage --verbose
Gerd
  • 2,265
  • 1
  • 27
  • 46