I have a Dockerfile:
## SELECT IMAGE FROM ubuntu:18.04 RUN apt-get update && apt-get upgrade -y && apt install -y openjdk-11-jdk && apt install -y wget ## SET JAVA ENV ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64 ## COPY CONF FILES TO ROOT COPY conf/root/ssh/authorized_keys /root/.ssh/authorized_keys COPY conf/root/subversion/auth /root/.subversion/auth ## INSTALL JBOSS RUN wget -O /tmp/wildfly-16.0.0.Final.tar.gz https://download.jboss.org/wildfly/16.0.0.Final/wildfly-16.0.0.Final.tar.gz && tar zxvf /tmp/wildfly-16.0.0.Final.tar.gz -C /opt ## JBOSS CONFIG RUN sed -i -r 's/jboss.bind.address.management:127.0.0.1/jboss.bind.address.management:0.0.0.0/' /opt/wildfly-16.0.0.Final/standalone/configuration/standalone.xml ## CLEAN JOSS RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* EXPOSE 8080 9990 CMD /opt/wildfly-16.0.0.Final/bin/add-user.sh --silent=true admin admin CMD /opt/wildfly-16.0.0.Final/bin/standalone.sh -b=0.0.0.0 CMD /bin/bash
I want to start wildfly and after it is started I want to have a bash of this container.
The problem is that I will never get to the point where
CMD /bin/bash is called because
CMD /opt/wildfly-16.0.0.Final/bin/standalone.sh -b=0.0.0.0 is blocking the container with this message:
INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://0.0.0.0:9990/management INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://0.0.0.0:9990 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final) started in 2526ms - Started 305 of 531 services (324 services are lazy, passive or on-demand)
I tried to do it the way I wrote above but also remove the
CMD /bin/bash line from the Dockerfile and create another Dockerfile which should give me a shell and run those two Dockerfiles with a docker-compose but everytime the wildfly status is blocking my further actions.
Source: Docker Questions