Docker Community Forums

Share and learn in the Docker community.

Run jboss-cli after startup docker and service wildfly


I am trying create image docker container with Dockerfile. I need execute some commands with jboss-cli when docker container starts. To execute jboss-cli it is necessary that the wildfly service is running.

My Dockerfile:

FROM jboss/wildfly:latest

USER jboss

RUN /opt/jboss/wildfly/bin/ admin admin --silent

CMD ["/opt/jboss/wildfly/bin/", "-b", "", "-bmanagement", ""]

i tried use “&” at the end of the command to throw the service to background but occurs error.

How i run the standalone service in background and run another command with Dockerfile?