# Building a Docker Image and Deploying a Pre-Packaged App
# Prerequisites
Java 8
Docker installed locally (https://docs.docker.com/docker-for-windows/install/ (opens new window))
maven
Access to a docker repository (docker.io or other)
# Introduction
This tutorial will show you how you can use an Entando application that you have built as a launching point for creating new applications.
In this lab you’ll take a demo application previously built, install the backups in a blank application, build an image from the updated app, and deploy it as a new application.
# Setup
Clone the application at: https://github.com/entando/entando-de-app (opens new window) using
git clone https://github.com/entando/entando-de-app
On a command line, cd into the entando-de-app you just cloned:
cd entando-de-app
Take the provide zip file and unzip it in a location of your choice.
This zip contains all of the assets, content, and metadata needed to launch an Entando application. We are going to package them the assets and DB an image and
Entando will automatically instantiate and populate the app from the most recent backup
Move the resources and protected folders from the zip file into your
entando-de-app
insrc/main/webapp
replacing any content that is already thereBuild a docker image from the app
mvn clean package -Pwildfly -Pderby docker:build
- Note that the "derby" option here is only for the initialization phase of the DB when deploying. It isn’t the final database choice
View the images installed on your local docker instance
docker images
Look for
entando/entando-de-app:latest
Create a repository on your docker repository to house your new application
Re-tag the image you just built with your repo
docker tag entando/entando-de-app:latest <YOUR-USER>/<YOUR-REPO_NAME>:latest
Push the Image to your Repository
docker push <YOUR-USER>/<YOUR-REPO_NAME>:latest
Now we need to generate a new application for deployment to Kubernetes using the helm chart
If you have an output from helm from before you can re-use it and just apply the changes to the config map.
Or you can re-run helm and change the output
Re-run the helm command for your environment (check with your instructor if you don’t know what this is)
Open the output yaml file from the helm command in the text editor of your choice
- For example:
vi training-alpha.yaml
- For example:
In that file look for the
ConfigMap
The config map defines all of the images that are available as part of the deployment. They aren’t all used concurrently.
You can also view this config map in kubernetes/OpenShift
Now you need to update the deployment to use your customized Wildfly image. Find
entando-de-app-wildfly
in the config map- Note that we are changing the de-app but you could create a custom version of any of the included images
Change the version to match the version you used for your image
Change the "organization" to the name of your main image repository organization and if you aren’t using docker.io (DockerHub) then change the registry as well.
Save the file
Follow the deployment steps you went through when you originally deployed your Entando application to your Kubernetes instance
Once deployed go to the app builder in your app
Click Go To Homepage