Let's practise this inward sequence:
- Checkout in addition to compile the really basic javaee nation of war from https://github.com/czetsuya/hello-javaee.
- In Ubuntu practise a novel folder: wildfly-hello:
>mkdir wildfly-hello - Copy hello-javaee.war within wildfly-hello.
- Create a Dockerfile in addition to insert the lines below within the same folder.
from jboss/wildfly run /opt/jboss/wildfly/bin/add-user.sh admin admin@1234 --silent add together hello-javaee.war /opt/jboss/wildfly/standalone/deployments/ cmd ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
- Inside the wildfly-hello folder construct the Dockerfile.
>docker construct -it wildfly-hello . - Run the docker image
>docker run wildfly-hello - Get the ip address of the container by:
>docker ps - to buy the farm the container id
>docker inspect -f '{{ .NetworkSettings.IPAddress }}' CONTAINER_ID - Now nosotros should accept the ip address of docker, nosotros tin straight off opened upward wildfly inward the browser.
-from is a docker keyword utilisation to import an ikon from docker hub hub.docker.com
-run is a ascendency that runs an executable file, inward this example nosotros are adding a user amongst application administration role
-add lets us add together a file within the container
-cmd tells the docker to execute this yesteryear default, when nosotros execute docker run
0 komentar:
Please comment if there are any that need to be asked.