我的Docker容器将在容器内运行一个命令,但不能和ENTRYPOINT一起运行

正如在标题中所述 – 通过Dockerfile构build映像Dockerfile ,我可以通过run -i -t myimage /bin/bash来input映像,然后运行我想要的命令 – 它工作得很好。

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

 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在容器内工作,但是从ENTRYPOINT冒出( command not found )。

任何帮助,将不胜感激。

由于某些原因, ENTRYPOINT需要双引号。

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

它加载。

Interesting Posts