У меня есть docker изображение, созданное из Dockerfile. Сценарий в точке входа запускает сервер Tomcat. Когда сценарий запускается, он запрашивает подтверждение.
Если интерактивная оболочка включена, сценарий будет ожидать, а сервер Tomcat никогда не запустится. Затем я должен вручную выполнить скрипт start-pentaho. sh изнутри контейнера.
Если интерактивная оболочка отключена, то запуск кота начнется. Но тогда контейнер получит состояние выхода.
Есть ли способ запустить мой контейнер без выполнения start-pentaho вручную?
Вот MWE:
ZIP-файл pentaho был загружен из:
https://sourceforge.net/projects/pentaho/files/Pentaho%208.1/server/pentaho-server-ce-8.1.0.0-365.zip/download
Dockerfile:
FROM ubuntu:latest
COPY ./pentaho-server-ce-8.1.0.0-365.zip /pentaho/pentaho-server-ce-8.1.zip
RUN apt-get update && \
apt-get install unzip && \
apt-get install -y openjdk-8-jdk
RUN unzip /pentaho/pentaho-server-ce-8.1.zip
ENTRYPOINT ["/pentaho-server/start-pentaho.sh"]
построение изображения с использованием:
docker build -t mtleis/pentaho:v1.0 .
docker -compose.yml
pentaho:
image: mtleis/pentaho:v1.0
ports:
- "8081:8080"
# The following two lines are needed to keep the container running. However Tomcat will never start. Disabling them, Tomcat would start but the container get an exited state.
# stdin_open: true
# tty: true
Выполнить docker -compose:
docker-compose up -d
Проверить журналы контейнера:
docker logs id
WARNING: Using java from path
DEBUG: _PENTAHO_JAVA_HOME=
DEBUG: _PENTAHO_JAVA=java
--------------------------------------------------------------------------------------------
The Pentaho BI Platform now contains a version checker that will notify you
when newer versions of the software are available. The version checker is enabled by default.
For information on what the version checker does, why it is beneficial, and how it works see:
http://wiki.pentaho.com/display/ServerDoc2x/Version+Checker
Press Enter to continue, or type cancel or Ctrl-C to prevent the server from starting.
You will only be prompted once with this question.
--------------------------------------------------------------------------------------------
[OK]:
Tomcat started.
Однако, если включены 2 строки в dokcer-compose.yml:
stdin_open: true
tty: true
В журналах показано, что Tomcat еще не запущен:
WARNING: Using java from path
DEBUG: _PENTAHO_JAVA_HOME=
DEBUG: _PENTAHO_JAVA=java
--------------------------------------------------------------------------------------------
The Pentaho BI Platform now contains a version checker that will notify you
when newer versions of the software are available. The version checker is enabled by default.
For information on what the version checker does, why it is beneficial, and how it works see:
http://wiki.pentaho.com/display/ServerDoc2x/Version+Checker
Press Enter to continue, or type cancel or Ctrl-C to prevent the server from starting.
You will only be prompted once with this question.
--------------------------------------------------------------------------------------------
[OK]: