3

This link explains how to run Apache Drill on Docker.

docker run -i --name drill-1.18.0 -p 8047:8047 -t apache/drill:1.18.0 /bin/bash

I need to run it on Docker Compose, so I set it up:

   version: "3.0"
   services:
      drill:
        image: apache/drill:latest
        ports:
          - "8047:8047"
        volumes:
          - vol_dask_data:/data
        entrypoint:
          - /bin/bash

And start it like so:

docker-compose up -d

But the container ends without doing anything, even though I start docker compose with -d.

How to start Drill in Docker Compose?

ps0604
  • 1,227
  • 23
  • 133
  • 330
  • The `entrypoint:` replaces the command the container would normally run; you shouldn't usually need to include that line in a `docker-compose.yml` file. Similarly in your `docker run` command you shouldn't normally need to put an explicit `/bin/bash` command at the end; leave off the command and let the container run the program built into the Dockerfile. – David Maze May 16 '21 at 15:26
  • Thanks, the `docker run` is the example given by Apache. I removed the `entrypoint:` and still the container ends without doing anything. The container should be a server waiting for requests. – ps0604 May 16 '21 at 15:30

1 Answers1

9

The Drill Dockerfile ends with:

ENTRYPOINT /opt/drill/bin/drill-embedded

In the docker run command, this particular construction completely ignores the command given after the image name. In your Compose setup, you replace this (with an entrypoint: line) with a Bash shell, but this shell will immediately exit.

The other important difference between the docker run command and the Compose setup is the -it options. If you try that docker run command without either -i or -t you will see the Drill prompt, and then the container will immediately exit. If you add back -i then it will wait for a command, and while it's doing that it will accept network connections. The Compose equivalent to this is the stdin_open: true command.

With this docker-compose.yml I can see the Drill UI on http://localhost:8047:

version: "3.8"        # a more current version
services:
  drill:
    image: apache/drill:latest
    ports:
      - "8047:8047"
    stdin_open: true  # add this line
                      # do not override entrypoint: or command:
                      # include volumes: if required
David Maze
  • 130,717
  • 29
  • 175
  • 215