Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run the Drill Docker container in detached mode will exit automatically #2829

Open
luoxiaohi opened this issue Aug 29, 2023 · 4 comments
Open
Labels

Comments

@luoxiaohi
Copy link

luoxiaohi commented Aug 29, 2023

Drill version
latest (1.21.1)

Describe the bug
I am following the doc running drill in docker.

To Reproduce
I want to run the Drill Docker container in detached mode, so I run this command:

docker run --name drill -p 8047:8047 -p 31010:31010 --detach apache/drill

as stated in the document, but the container exits automatically a few seconds later.

Then, I try to run the Drill Docker Container in Foreground Mode:

docker run -it --name drill  -p 8047:8047 -p 31010:31010 apache/drill 

It starts correctly, but when I run $DRILL_HOME/bin/drill-embedded in the container, the container exits too, and it logs

apache drill> Killed

so I think maybe the problem lies in $DRILL_HOME/bin/drill-embedded this command.

@luoxiaohi luoxiaohi added the bug label Aug 29, 2023
@maharjanraj
Copy link

@luoxiaohi It seems that you can add -it to start in detached mode to prevent it from quitting after a while.
docker run -it --name drill -p 8047:8047 -p 31010:31010 --detach apache/drill

@cgivre
Copy link
Contributor

cgivre commented Mar 20, 2024 via email

@sklibanov312
Copy link

Can we not add a command line argument to drill-embedded itself to not quit? Adding -it isn't practical in a variety of situations, including Docker Compose.

@sklibanov312
Copy link

I've worked around this with a custom Dockerfile:

FROM debian:12

# We're going to be installing things
RUN apt-get update

# Here's some basic conveniences, and Java because Drill runs on that
RUN apt-get install -y ca-certificates curl net-tools bind9-utils dos2unix less procps expect default-jre

# Create a non-root user and switch to it
RUN groupadd -r drill
RUN useradd --no-log-init -r -g drill -m drill

WORKDIR /home/drill

COPY ./apache-drill-1.21.1.tar.gz /home/drill
COPY ./docker-entrypoint.sh /home/drill
RUN chown -R drill:drill /home/drill

USER drill

RUN tar xvfz apache-drill-1.21.1.tar.gz
RUN chmod u+rwx /home/drill/docker-entrypoint.sh

# In case your host is Windows...
RUN dos2unix /home/drill/docker-entrypoint.sh

CMD ["/home/drill/docker-entrypoint.sh"]

The docker-entrypoint.sh has this:

#!/bin/bash

# The 'unbuffer' part is a workaround for https://github.com/apache/drill/issues/2829
unbuffer apache-drill-1.21.1/bin/drill-embedded

With port 8047 forwarded I can still talk to it thru the web page.

So that's the workaround. Now I can run this in a docker compose stack or whatever, without having to add -ti.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants