Coder Social home page Coder Social logo

azure / wildfly-container-quickstart Goto Github PK

View Code? Open in Web Editor NEW
8.0 9.0 7.0 13 KB

Quick starts for creating WildFly app server container images -- using supported versions of Java and and customizing the images

License: MIT License

Dockerfile 93.06% HTML 6.94%
wildfly jboss jboss-wildfly kubernetes aks aks-kubernetes-cluster aci acr azure-container-registry azure-container-instances

wildfly-container-quickstart's Introduction

page_type languages products description urlFragment
sample
java
java
A WildFly container quick start
wildfly-container-quick-start

WildFly on Containers QuickStart

This repository contains artifacts to help you get started running WildFly applications on Azure container platforms, such as the Azure Kubernetes Service (AKS).

Pre-requisites

For running locally:

For running on Azure:

Building and testing locally

If you have Docker CLI installed locally, you can run this quick start on your machine:

  1. Clone the repository and navigate into the root of the repository:

    git clone https://github.com/Azure/wildfly-container-quickstart.git
    cd wildfly-container-quickstart
  2. Build the WAR file locally.

    mvn package
  3. Build the docker image:

    docker build -t wildfly -f src/main/docker/Dockerfile .
  4. Run the image:

    docker run -p 8080:8080 -d wildfly

Once the container is running, navigate to http://localhost:8080 in your favorite browser. You should see the web application come up.

Building and testing on Azure

Alternatively, you can build and test the image entirely on Azure. These steps can be performed from Azure CloudShell or from any machine with Azure CLI installed.

  1. Create an Azure Container Registry. Be sure to enable the admin user.

  2. Clone the repository and navigate into the root of the repository:

    git clone https://github.com/Azure/wildfly-container-quickstart.git
    cd wildfly-container-quickstart
  3. Build the WAR file locally.

    mvn package
  4. Once the Azure Container Registry instance is created, run the following command, where ${REGISTRY_NAME} is the name of the Azure Container Registry you just created:

    az acr build -r ${REGISTRY_NAME} -t "${REGISTRY_NAME}.azurecr.io/wildfly" -f src/main/docker/Dockerfile .

    The Azure Container Registry will now build the docker image on its own server.

  5. Once the image build has completed, run the following command. It will deploy the image onto an Azure Container Instance. ${RESOURCE_GROUP} should be the name of a resource group in your azure subscription. ${REGISTRY_NAME} should be the same as above:

    az container create -g ${RESOURCE_GROUP} -n ${REGISTRY_NAME} \
      --image "${REGISTRY_NAME}.azurecr.io/wildfly"  \
      --registry-password "$(az acr credential show -n $REGISTRY_NAME --query "passwords[0].value" -o tsv)" \
      --registry-username "${REGISTRY_NAME}" \
      --ip-address Public \
      --ports 8080 \
      --query "ipAddress.ip"

    When the command completes, it will display an IP address. Navigate to http://<The IP Address>:8080 in your browser, and you should see the home page of the deployed web application.

    To terminate the container instance, run

    az container delete -g ${RESOURCE_GROUP} -n ${REGISTRY_NAME} --yes

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

wildfly-container-quickstart's People

Contributors

microsoft-github-operations[bot] avatar microsoftopensource avatar mnriem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.