docker - 如何在 Docker Compose 中启动 Apache Drill

标签 docker docker-compose apache-drill

This link解释如何在 Docker 上运行 Apache Drill。

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

我需要在 Docker Compose 上运行它,所以我设置了它:

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

然后像这样开始:

docker-compose up -d

但是容器没有做任何事情就结束了,即使我用 -d 启动 docker compose。

如何在 Docker Compose 中启动 Drill?

最佳答案

Drill Dockerfile结束于:

ENTRYPOINT /opt/drill/bin/drill-embedded

docker run 命令中,这个特殊的结构完全忽略了图像名称后给出的命令。在您的 Compose 设置中,您将此(使用 entrypoint: 行)替换为 Bash shell,但此 shell 将立即退出。

docker run 命令和 Compose 设置之间的另一个重要区别是 -it 选项。如果您在不使用 -i-t 的情况下尝试执行 docker run 命令,您将看到 Drill 提示,然后容器将立即退出。如果你加回 -i 然后它会等待一个命令,而当它这样做时它会接受网络连接。与此等效的 Compose 是 stdin_open: true 命令。

通过这个 docker-compose.yml 我可以在 http://localhost:8047 上看到 Drill UI:

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

关于docker - 如何在 Docker Compose 中启动 Apache Drill,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67558406/

相关文章:

download - Docker删除下载的文件

Docker API 启动容器返回 404

docker - 升级 Swarm 模式集群

azure - Bitnami Moodle 容器无法连接到 mariadb

angular - docker ERR_NAME_NOT_RESOLVED http ajax

apache-drill - Apache Drill 不使用最大 RAM

hadoop - 钻JDBC Zookeeper超时错误

scala - akka-http web-app 无法在最小的 docker jre 11 上启动(scala12 akka-http 的哪些 java 模块)?

docker - 在生产中运行 Docker Compose 堆栈的推荐方法?

json - 为 Cassandra 配置 Apache 钻取