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

时间:2013-12-07 01:51:20

标签: 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)。

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:2)

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

已更改ENTRYPOINT ['/opt/torquebox/current/jruby/bin/torquebox']ENTRYPOINT ["/opt/torquebox/current/jruby/bin/torquebox"]

它加载。