# Using the Payara Micro 5 snapshot build.FROM payara/micro:5-SNAPSHOT# Downloads the database connector libraryRUN wget -O $PAYARA_PATH/database-connector.jar http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.43/mysql-connector-java-5.1.43.jar
# Adds an application to be loadedADD target/database-ping-1.0-SNAPSHOT.war $PAYARA_PATH/ROOT.warENTRYPOINT java -jar $PAYARA_PATH/payara-micro.jar --addJars $PAYARA_PATH/database-connector.jar --deploy $PAYARA_PATH/ROOT.war
Crear el archivo build.sh (payara-micro-database-ping reemplacelo por el nombre del prpyecto)
build.sh
#!/bin/sh# Build the application projectmvncleanpackage# Build the image from the applicationdockerbuild-tpayara-micro-database-ping.
star.sh
#!/bin/sh# Start mariadbdockerrun-d--rm--nameping-database-eMYSQL_ROOT_PASSWORD=password-eMYSQL_DATABASE=testmariadb# Start Payara Micro with link to databasedockerrun-d--rm-p8080:8080--namemicro-ping--linkping-database:databasepayara-micro-database-ping