* modify the `to/image` configuration propertyfor the link:https://github.com/GoogleContainerTools/jib[jib-maven-plugin] in the `pom.xml`

+

Thedefault value is`docker.io/apacheisis/simpleapp:latest`:

** change `docker.io` prefix to push to a registry other than Docker hub

** change `apacheisis/simpleapp` to the name of your app.

*package up the app with the `docker` profile:

+

[source,bash]

----

mvn -pl webapp -DskipTests-Ddockerpackage

----

Variants:

* to specify Docker registry credentials through some other mechanism, configure the `pom.xml`for`maven-jib-plugin`(it supports a link:https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin#authentication-methods[variety of ways] to specify credentials)

* to override the image at the command line,use`-Dimage=...`.

To run a docker image previously packaged:

[source,bash]

----

docker pull apacheisis/simpleapp:latest

docker container run -d -p 8080:8080 apacheisis/simpleapp:latest

----

This can then be accessed at link:http://localhost:8080[localhost:8080].

===ExternalizedConfiguration

The application is configured to run in the `/run/secrets` directory.

Configuration can be therefore be externalized by defining an `application.properties` secret for the KubernetesorDockerSwarm cluster.

SpringBoot will use these settings in preference to the configuration properties definedin`classpath:config/application.properties`, see link:https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config[Spring docs].