How To Operate A Wildfly Server Within Docker

Before nosotros laid out you lot must configure docker, I am using Ubuntu in addition to hence I followed the ask here: https://docs.docker.com/engine/installation/linux/ubuntulinux/. Choose the appropriate OS that applies to you.

Let's practise this inward sequence:

  1. Checkout in addition to compile the really basic javaee nation of war from https://github.com/czetsuya/hello-javaee.
  2. In Ubuntu practise a novel folder: wildfly-hello:
    >mkdir wildfly-hello
  3. Copy hello-javaee.war within wildfly-hello.
  4. 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"]
  5. Inside the wildfly-hello folder construct the Dockerfile.
    >docker construct -it wildfly-hello .
  6. Run the docker image
    >docker run wildfly-hello
  7. Get the ip address of the container by:
    >docker ps - to buy the farm the container id
    >docker inspect -f '{{ .NetworkSettings.IPAddress }}' CONTAINER_ID
  8. Now nosotros should accept the ip address of docker, nosotros tin straight off opened upward wildfly inward the browser.
What does the lines inward stride iii means?
-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
Next
Previous
Click here for Comments

0 komentar:

Please comment if there are any that need to be asked.