docker - 我的Docker容器将从容器内运行命令,但不使用ENTRYPOINT

标签 docker torquebox

如标题中所述-通过Dockerfile构建图像后,我可以通过run -i -t myimage /bin/bash输入图像,然后运行我想要的命令-它工作正常。

但是,在ENTRYPOINT ['mycommand']中执行Dockerfile不起作用。请看下面:

FROM ubuntu

MAINTAINER bkparso

RUN sed 's/main$/main universe/' -i /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y

RUN apt-get install -y python-software-properties
RUN add-apt-repository ppa:webupd8team/java -y

RUN apt-get update
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections

RUN apt-get install -y oracle-java7-installer git unzip

RUN mkdir /opt/torquebox
RUN useradd torquebox -c"Torquebox system user" -M -ptorquebox
ADD http://torquebox.org/release/org/torquebox/torquebox-dist/3.0.1/torquebox-dist-3.0.1-bin.zip /tmp/tboxbin.zip
RUN unzip /tmp/tboxbin.zip -d /opt/torquebox
RUN ln -s /opt/torquebox/torquebox-3.0.1 /opt/torquebox/current
RUN chown -R torquebox:torquebox /opt/torquebox
RUN touch /etc/profile.d/torquebox.sh
RUN echo "export TORQUEBOX_HOME=/opt/torquebox/current" >> /etc/profile.d/torquebox.sh
RUN echo "export JBOSS_HOME=\$TORQUEBOX_HOME/jboss" >> /etc/profile.d/torquebox.sh
RUN echo "export JRUBY_HOME=\$TORQUEBOX_HOME/jruby" >> /etc/profile.d/torquebox.sh
RUN echo "PATH=\$JBOSS_HOME/bin:\$JRUBY_HOME/bin:\$PATH" >> /etc/profile.d/torquebox.sh

ENV TORQUEBOX_HOME /opt/torquebox/current
ENV JBOSS_HOME /opt/torquebox/current/jboss
ENV JRUBY_HOME /opt/torquebox/current/jruby
ENV PATH $JBOSS_HOME/bin:$JRUBY_HOME/bin:$PATH

RUN cp /opt/torquebox/current/jboss/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss-as-standalone
RUN mkdir /etc/jboss-as && touch /etc/jboss-as/jboss-as.conf
RUN echo "JBOSS_USER=torquebox" >> /etc/jboss-as/jboss-as.conf
RUN echo "JBOSS_HOME=/opt/torquebox/current/jboss" >> /etc/jboss-as/jboss-as.conf
RUN echo "JBOSS_PIDFILE=/var/run/torquebox/torquebox.pid" >> /etc/jboss-as/jboss-as.conf
RUN echo "JBOSS_CONSOLE_LOG=/var/log/torquebox/console.log" >> /etc/jboss-as/jboss-as.conf
RUN echo "JBOSS_CONFIG=standalone-ha.xml" >> /etc/jboss-as/jboss-as.conf
RUN update-rc.d jboss-as-standalone defaults

EXPOSE 6666 8080 8443 5445 8675

ENTRYPOINT ['/opt/torquebox/current/jruby/bin/torquebox']

CMD ["--help"]
/opt/torquebox/current/jruby/bin/torquebox --help在容器内工作,但从command not found炸毁(ENTRYPOINT)。

任何帮助,将不胜感激。

最佳答案

出于某种原因,ENTRYPOINT需要双引号。

更改了ENTRYPOINT ['/opt/torquebox/current/jruby/bin/torquebox']ENTRYPOINT ["/opt/torquebox/current/jruby/bin/torquebox"]
它加载。

关于docker - 我的Docker容器将从容器内运行命令,但不使用ENTRYPOINT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20436586/

相关文章:

python - django.db.utils.OperationalError : (2002, "Can' t 连接到 'db' (115)"上的 MySQL 服务器"

docker - 启动仪表板时,以Docker模式运行的Minikube返回503

ruby-on-rails - 将 JRuby 与 Rails 3.2 结合使用

TorqueBox 中的 Java 部署

deployment - 在现有的 JBoss (7.1.x) 中实现 Torquebox (2.3)

Java Testcontainers - 无法连接到暴露的端口

mysql - Docker Linux 上的 MariaDB 在外部/内部 IP 之间有两个不同的版本

ubuntu - 在 Docker 中运行 Qt5 GUI

ruby-on-rails - 带有扭矩箱和 nginx 的 EC2 错误网关

jboss - 用于高性能/关键任务应用程序的 JRuby/TorqueBox