Run update.sh

This commit is contained in:
Docker Library Bot 2018-11-06 00:10:39 +00:00
parent 689a05639f
commit 6e45c0c0e9
4 changed files with 89 additions and 72 deletions

View File

@ -16,7 +16,7 @@ WARNING:
# Supported tags and respective `Dockerfile` links
- [`1.5.3`, `1.5`, `latest` (*docker/1.5/Dockerfile*)](https://github.com/eclipse/mosquitto/blob/1853bfc678c255367e7c2c2f138da7bf47054117/docker/1.5/Dockerfile)
- [`1.5.3`, `1.5`, `latest` (*docker/1.5/Dockerfile*)](https://github.com/eclipse/mosquitto/blob/da2879c33b6baf00b8b50a38da8d7f176cd85afa/docker/1.5/Dockerfile)
# Quick reference

View File

@ -19,9 +19,9 @@ WARNING:
- [`21.1.1`, `21.1`, `21`, `latest` (*21/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/de48e7c91b8a293770c6fcccdd30d2329fcc0414/21/Dockerfile)
- [`21.1.1-slim`, `21.1-slim`, `21-slim`, `slim` (*21/slim/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/de48e7c91b8a293770c6fcccdd30d2329fcc0414/21/slim/Dockerfile)
- [`21.1.1-alpine`, `21.1-alpine`, `21-alpine`, `alpine` (*21/alpine/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/de48e7c91b8a293770c6fcccdd30d2329fcc0414/21/alpine/Dockerfile)
- [`20.3.8.10`, `20.3.8`, `20.3`, `20` (*20/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/de63187115802de9bbc10c430c381ac598167af1/20/Dockerfile)
- [`20.3.8.10-slim`, `20.3.8-slim`, `20.3-slim`, `20-slim` (*20/slim/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/de63187115802de9bbc10c430c381ac598167af1/20/slim/Dockerfile)
- [`20.3.8.10-alpine`, `20.3.8-alpine`, `20.3-alpine`, `20-alpine` (*20/alpine/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/de63187115802de9bbc10c430c381ac598167af1/20/alpine/Dockerfile)
- [`20.3.8.11`, `20.3.8`, `20.3`, `20` (*20/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/01bc5270a30887e3b57c5c50bcdefe375b2e5123/20/Dockerfile)
- [`20.3.8.11-slim`, `20.3.8-slim`, `20.3-slim`, `20-slim` (*20/slim/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/01bc5270a30887e3b57c5c50bcdefe375b2e5123/20/slim/Dockerfile)
- [`20.3.8.11-alpine`, `20.3.8-alpine`, `20.3-alpine`, `20-alpine` (*20/alpine/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/01bc5270a30887e3b57c5c50bcdefe375b2e5123/20/alpine/Dockerfile)
- [`19.3.6.12`, `19.3.6`, `19.3`, `19` (*19/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/dc54fb8d1737f493748176df10c4af1b42e1e7b5/19/Dockerfile)
- [`19.3.6.12-slim`, `19.3.6-slim`, `19.3-slim`, `19-slim` (*19/slim/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/dc54fb8d1737f493748176df10c4af1b42e1e7b5/19/slim/Dockerfile)
- [`18.3.4.10`, `18.3.4`, `18.3`, `18` (*18/Dockerfile*)](https://github.com/erlang/docker-erlang-otp/blob/4fe4caa8ebd01748b50bac745f5e96d872e1db4c/18/Dockerfile)

View File

@ -16,26 +16,26 @@ WARNING:
# Supported tags and respective `Dockerfile` links
- [`1.5.5-hadoop24-scala_2.11`, `1.5.5-hadoop24`, `1.5-hadoop24` (*1.5/hadoop24-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/hadoop24-scala_2.11-debian/Dockerfile)
- [`1.5.5-hadoop26-scala_2.11`, `1.5.5-hadoop26`, `1.5-hadoop26` (*1.5/hadoop26-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/hadoop26-scala_2.11-debian/Dockerfile)
- [`1.5.5-hadoop27-scala_2.11`, `1.5.5-hadoop27`, `1.5-hadoop27` (*1.5/hadoop27-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/hadoop27-scala_2.11-debian/Dockerfile)
- [`1.5.5-hadoop28-scala_2.11`, `1.5.5-hadoop28`, `1.5-hadoop28` (*1.5/hadoop28-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/hadoop28-scala_2.11-debian/Dockerfile)
- [`1.5.5-scala_2.11`, `1.5-scala_2.11`, `1.5.5`, `1.5` (*1.5/scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/scala_2.11-debian/Dockerfile)
- [`1.5.5-hadoop24-scala_2.11-alpine`, `1.5.5-hadoop24-alpine`, `1.5-hadoop24-alpine` (*1.5/hadoop24-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/hadoop24-scala_2.11-alpine/Dockerfile)
- [`1.5.5-hadoop26-scala_2.11-alpine`, `1.5.5-hadoop26-alpine`, `1.5-hadoop26-alpine` (*1.5/hadoop26-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/hadoop26-scala_2.11-alpine/Dockerfile)
- [`1.5.5-hadoop27-scala_2.11-alpine`, `1.5.5-hadoop27-alpine`, `1.5-hadoop27-alpine` (*1.5/hadoop27-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/hadoop27-scala_2.11-alpine/Dockerfile)
- [`1.5.5-hadoop28-scala_2.11-alpine`, `1.5.5-hadoop28-alpine`, `1.5-hadoop28-alpine` (*1.5/hadoop28-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/hadoop28-scala_2.11-alpine/Dockerfile)
- [`1.5.5-scala_2.11-alpine`, `1.5-scala_2.11-alpine`, `1.5.5-alpine`, `1.5-alpine` (*1.5/scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/6788055f7569d7bb3542ed7608036abc7e29bfc0/1.5/scala_2.11-alpine/Dockerfile)
- [`1.6.2-hadoop24-scala_2.11`, `1.6.2-hadoop24`, `1.6-hadoop24`, `hadoop24` (*1.6/hadoop24-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/hadoop24-scala_2.11-debian/Dockerfile)
- [`1.6.2-hadoop26-scala_2.11`, `1.6.2-hadoop26`, `1.6-hadoop26`, `hadoop26` (*1.6/hadoop26-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/hadoop26-scala_2.11-debian/Dockerfile)
- [`1.6.2-hadoop27-scala_2.11`, `1.6.2-hadoop27`, `1.6-hadoop27`, `hadoop27` (*1.6/hadoop27-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/hadoop27-scala_2.11-debian/Dockerfile)
- [`1.6.2-hadoop28-scala_2.11`, `1.6.2-hadoop28`, `1.6-hadoop28`, `hadoop28` (*1.6/hadoop28-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/hadoop28-scala_2.11-debian/Dockerfile)
- [`1.6.2-scala_2.11`, `1.6-scala_2.11`, `scala_2.11`, `1.6.2`, `1.6`, `latest` (*1.6/scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/scala_2.11-debian/Dockerfile)
- [`1.6.2-hadoop24-scala_2.11-alpine`, `1.6.2-hadoop24-alpine`, `1.6-hadoop24-alpine`, `hadoop24-alpine` (*1.6/hadoop24-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/hadoop24-scala_2.11-alpine/Dockerfile)
- [`1.6.2-hadoop26-scala_2.11-alpine`, `1.6.2-hadoop26-alpine`, `1.6-hadoop26-alpine`, `hadoop26-alpine` (*1.6/hadoop26-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/hadoop26-scala_2.11-alpine/Dockerfile)
- [`1.6.2-hadoop27-scala_2.11-alpine`, `1.6.2-hadoop27-alpine`, `1.6-hadoop27-alpine`, `hadoop27-alpine` (*1.6/hadoop27-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/hadoop27-scala_2.11-alpine/Dockerfile)
- [`1.6.2-hadoop28-scala_2.11-alpine`, `1.6.2-hadoop28-alpine`, `1.6-hadoop28-alpine`, `hadoop28-alpine` (*1.6/hadoop28-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/hadoop28-scala_2.11-alpine/Dockerfile)
- [`1.6.2-scala_2.11-alpine`, `1.6-scala_2.11-alpine`, `scala_2.11-alpine`, `1.6.2-alpine`, `1.6-alpine`, `alpine` (*1.6/scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/ffdddf1db3147beadaa574cc69310cc641b4b417/1.6/scala_2.11-alpine/Dockerfile)
- [`1.5.5-hadoop24-scala_2.11`, `1.5.5-hadoop24`, `1.5-hadoop24` (*1.5/hadoop24-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/hadoop24-scala_2.11-debian/Dockerfile)
- [`1.5.5-hadoop26-scala_2.11`, `1.5.5-hadoop26`, `1.5-hadoop26` (*1.5/hadoop26-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/hadoop26-scala_2.11-debian/Dockerfile)
- [`1.5.5-hadoop27-scala_2.11`, `1.5.5-hadoop27`, `1.5-hadoop27` (*1.5/hadoop27-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/hadoop27-scala_2.11-debian/Dockerfile)
- [`1.5.5-hadoop28-scala_2.11`, `1.5.5-hadoop28`, `1.5-hadoop28` (*1.5/hadoop28-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/hadoop28-scala_2.11-debian/Dockerfile)
- [`1.5.5-scala_2.11`, `1.5-scala_2.11`, `1.5.5`, `1.5` (*1.5/scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/scala_2.11-debian/Dockerfile)
- [`1.5.5-hadoop24-scala_2.11-alpine`, `1.5.5-hadoop24-alpine`, `1.5-hadoop24-alpine` (*1.5/hadoop24-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/hadoop24-scala_2.11-alpine/Dockerfile)
- [`1.5.5-hadoop26-scala_2.11-alpine`, `1.5.5-hadoop26-alpine`, `1.5-hadoop26-alpine` (*1.5/hadoop26-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/hadoop26-scala_2.11-alpine/Dockerfile)
- [`1.5.5-hadoop27-scala_2.11-alpine`, `1.5.5-hadoop27-alpine`, `1.5-hadoop27-alpine` (*1.5/hadoop27-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/hadoop27-scala_2.11-alpine/Dockerfile)
- [`1.5.5-hadoop28-scala_2.11-alpine`, `1.5.5-hadoop28-alpine`, `1.5-hadoop28-alpine` (*1.5/hadoop28-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/hadoop28-scala_2.11-alpine/Dockerfile)
- [`1.5.5-scala_2.11-alpine`, `1.5-scala_2.11-alpine`, `1.5.5-alpine`, `1.5-alpine` (*1.5/scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.5/scala_2.11-alpine/Dockerfile)
- [`1.6.2-hadoop24-scala_2.11`, `1.6.2-hadoop24`, `1.6-hadoop24`, `hadoop24` (*1.6/hadoop24-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/hadoop24-scala_2.11-debian/Dockerfile)
- [`1.6.2-hadoop26-scala_2.11`, `1.6.2-hadoop26`, `1.6-hadoop26`, `hadoop26` (*1.6/hadoop26-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/hadoop26-scala_2.11-debian/Dockerfile)
- [`1.6.2-hadoop27-scala_2.11`, `1.6.2-hadoop27`, `1.6-hadoop27`, `hadoop27` (*1.6/hadoop27-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/hadoop27-scala_2.11-debian/Dockerfile)
- [`1.6.2-hadoop28-scala_2.11`, `1.6.2-hadoop28`, `1.6-hadoop28`, `hadoop28` (*1.6/hadoop28-scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/hadoop28-scala_2.11-debian/Dockerfile)
- [`1.6.2-scala_2.11`, `1.6-scala_2.11`, `scala_2.11`, `1.6.2`, `1.6`, `latest` (*1.6/scala_2.11-debian/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/scala_2.11-debian/Dockerfile)
- [`1.6.2-hadoop24-scala_2.11-alpine`, `1.6.2-hadoop24-alpine`, `1.6-hadoop24-alpine`, `hadoop24-alpine` (*1.6/hadoop24-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/hadoop24-scala_2.11-alpine/Dockerfile)
- [`1.6.2-hadoop26-scala_2.11-alpine`, `1.6.2-hadoop26-alpine`, `1.6-hadoop26-alpine`, `hadoop26-alpine` (*1.6/hadoop26-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/hadoop26-scala_2.11-alpine/Dockerfile)
- [`1.6.2-hadoop27-scala_2.11-alpine`, `1.6.2-hadoop27-alpine`, `1.6-hadoop27-alpine`, `hadoop27-alpine` (*1.6/hadoop27-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/hadoop27-scala_2.11-alpine/Dockerfile)
- [`1.6.2-hadoop28-scala_2.11-alpine`, `1.6.2-hadoop28-alpine`, `1.6-hadoop28-alpine`, `hadoop28-alpine` (*1.6/hadoop28-scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/hadoop28-scala_2.11-alpine/Dockerfile)
- [`1.6.2-scala_2.11-alpine`, `1.6-scala_2.11-alpine`, `scala_2.11-alpine`, `1.6.2-alpine`, `1.6-alpine`, `alpine` (*1.6/scala_2.11-alpine/Dockerfile*)](https://github.com/docker-flink/docker-flink/blob/a8e4330c4cc20b25f549b8999c16144d540e87aa/1.6/scala_2.11-alpine/Dockerfile)
# Quick reference

View File

@ -61,7 +61,11 @@ The images in this repository contain IBM WebSphere Application Server Liberty f
# Image User
This image runs by default with `USER 1001` (non-root), as part of group `0`. All of the folders accessed by WebSphere Liberty have been given the appropriate permissions, but if your extending Dockerfile needs permission to another location you can simply temporarily switch into root and provide the needed permissions, example:
This image runs by default with `USER 1001` (non-root), as part of group `0`. Please make sure you read below to set the appropriate folder and file permissions.
## Updating folder permissions
All of the folders accessed by WebSphere Liberty have been given the appropriate permissions, but if your extending Dockerfile needs permission to another location you can simply temporarily switch into root and provide the needed permissions, example:
```dockerfile
USER root
@ -69,7 +73,32 @@ RUN mkdir -p /myFolder && chown -R 1001:0 /myFolder
USER 1001
```
Also, you have to make sure that the artifacts you are copying into the image (via `COPY`) have the correct permission to be `read` and `executed` by user `1001` or group `0`. For example, you can do `chmod 777 server.xml` to ensure your `server.xml` can be `read` and `executed` by user `1001`, as well as any artifacts such as the application's `EAR` or `WAR` file, JDBC driver, or other files that are placed on the image via `COPY`.
## Updating file permissions
You have to make sure that **all** the artifacts you are copying into the image (via `COPY` or `ADD`) have the correct permissions to be `read` and `executed` by user `1001` or group `0`, because the ownership of the file is changed to be `root:0` when transferring into the docker image.
You have a few options for doing this: before copying the file, during copy, or after copy.
### Updating permissions before coyping
Since the ownership of the file will change to `root:0`, you can simply set the permissions for the owner's group to be able to read/execute the artifact (i.e. the middle digit of a `chmod` command). For example, you can do `chmod g+rx server.xml` to ensure your `server.xml` can be `read` and `executed` by group `0`, as well as any artifacts such as the application's `EAR` or `WAR` file, JDBC driver, or other files that are placed on the image via `COPY` or `ADD`.
### Updating permissions during copy
If you're using Docker v17.09.0-ce and newer you can take advantage of the flag `--chown=<user>:<group>` during either `ADD` or `COPY`. For example: `COPY --chown=1001:0 jvm.options /config/jvm.options`
### Updating permissions after copy
If you need your Dockerfile to work with older versions of Docker CE and don't want to pre-process the permissions of the files you can temporarily switch into root to change the permissions of the needed files. For example:
```dockerfile
USER root
RUN chown 1001:0 /config/jvm.options
RUN chown 1001:0 /output/resources/security/ltpa.keys
USER 1001
```
Please note that this pattern will duplicate the docker layers for those artifacts, which can heavily bloat your resulting docker image (depending on the size of the artifact). So it is recommended to set the permissions before or during copy.
# Tags
@ -79,8 +108,8 @@ The `kernel` image contains just the Liberty kernel and no additional runtime fe
```dockerfile
FROM websphere-liberty:kernel
COPY Sample1.war /config/dropins/
COPY server.xml /config/
COPY --chown=1001:0 Sample1.war /config/dropins/
COPY --chown=1001:0 server.xml /config/
RUN installUtility install --acceptLicense defaultServer
```
@ -96,25 +125,49 @@ The `springBoot1` and `springBoot2` images contain all features required for run
# Usage
The images are designed to support a number of different usage patterns. The following examples are based on the Java EE8 Liberty [application deployment sample](https://developer.ibm.com/wasdev/docs/article_appdeployment/) and assume that [DefaultServletEngine.zip](https://github.com/WASdev/sample.servlet/releases/download/V1/DefaultServletEngine.zip) has been extracted to `/tmp` and the `server.xml` updated to accept HTTP connections from outside of the container by adding the following element inside the `server` stanza:
The images are designed to support a number of different usage patterns. The following examples are based on the Java EE8 Liberty [application deployment sample](https://developer.ibm.com/wasdev/docs/article_appdeployment/) and assume that [DefaultServletEngine.zip](https://github.com/WASdev/sample.servlet/releases/download/V1/DefaultServletEngine.zip) has been extracted to `/tmp` and the `server.xml` updated to accept HTTP connections from outside of the container by adding the following element inside the `server` stanza (if not using one of the pre-packaged `server.xml` files with our tags):
```xml
<httpEndpoint host="*" httpPort="9080" httpsPort="-1"/>
```
1. Each image contains a default server configuration that specifies the corresponding features and exposes ports 9080 and 9443 for HTTP and HTTPS respectively. A .WAR file can therefore be mounted in the `dropins` directory of this server and run. The following example starts a container in the background running a .WAR file from the host file system with the HTTP and HTTPS ports mapped to 80 and 443 respectively.
## Application Image
```console
$ docker run -d -p 80:9080 -p 443:9443 \
It is a very strong best practice to create an extending Docker image, we called it the `application image`, that encapsulates an application and its configuration. This creates a robust, self-contained and predictable Docker image that can span new containers upon request, without relying on volumes or other external runtime artifacts that may behave different over time.
If you want to build the smallest possible WebSphere Liberty application image you can start with our `kernel` tag, add your artifacts, and run `installUtility` to grow the set of features to be fit-for-purpose. Scroll up to the `Tags` section for an example.
If you want to start with one of the pre-packaged tags you do not need to run `installUtility` if the tag contains all the features you required, and you may not even need to copy a `server.xml` - unless you have updates you want to make. So one example of building an application image that runs a MicroProfile 2.0 application is:
```dockerfile
FROM websphere-liberty:microprofile2
COPY --chown=1001:0 Sample1.war /config/dropins/
```
You can then build and run this image:
```console
$ docker build -t app .
$ docker run -d -p 80:9080 -p 443:9443 app
```
## Using volumes for configuration
This pattern can be useful for quick experiments / early development (i.e. `I just want to run the application as I iterate over it`), can should not be used for development scenarios that involve different teams and environments - for these cases the `Application Image` pattern described above is the way to go.
When using `volumes`, an application file can be mounted in the `dropins` directory of this server and run. The following example starts a container in the background running a .WAR file from the host file system with the HTTP and HTTPS ports mapped to 80 and 443 respectively.
```console
$ docker run -d -p 80:9080 -p 443:9443 \
-v /tmp/DefaultServletEngine/dropins/Sample1.war:/config/dropins/Sample1.war \
websphere-liberty:webProfile8
```
```
When the server is started, you can browse to http://localhost/Sample1/SimpleServlet on the Docker host.
When the server is started, you can browse to http://localhost/Sample1/SimpleServlet on the Docker host.
Note: If you are using the boot2docker virtual machine on OS X or Windows, you need to get the IP of the virtual host by using the command `boot2docker ip` instead of by using localhost.
Note: If you are using the boot2docker virtual machine on OS X or Windows, you need to get the IP of the virtual host by using the command `boot2docker ip` instead of by using localhost.
2. For greater flexibility over configuration, it is possible to mount an entire server configuration directory from the host and then specify the server name as a parameter to the run command. Note: This particular example server configuration provides only HTTP access.
For greater flexibility over configuration, it is possible to mount an entire server configuration directory from the host and then specify the server name as a parameter to the run command. Note: This particular example server configuration provides only HTTP access.
```console
$ docker run -d -p 80:9080 \
@ -122,42 +175,6 @@ The images are designed to support a number of different usage patterns. The fol
websphere-liberty:webProfile8
```
3. You can also build an application layer on top of this image by using either the default server configuration or a new server configuration. In this example, we have copied the `Sample1.war` from `/tmp/DefaultServletEngine/dropins` to the same directory as the following Dockerfile.
```dockerfile
FROM websphere-liberty:webProfile8
COPY Sample1.war /config/dropins/
```
This can then be built and run as follows:
```console
$ docker build -t app .
$ docker run -d -p 80:9080 -p 443:9443 app
```
4. You can mount a data volume container that contains the application and the server configuration on to the image. This has the benefit that it has no dependency on files from the host but still allows the application container to be easily re-mounted on a newer version of the application server image. This example assumes that you have copied the `/tmp/DefaultServletEngine` directory in to the same directory as the Dockerfile.
Build and run the data volume container:
```dockerfile
FROM websphere-liberty:webProfile8
COPY DefaultServletEngine /config
```
```console
$ docker build -t app-image .
$ docker run -d -v /config \
--name app app-image true
```
Run the WebSphere Liberty image with the volumes from the data volume container mounted:
```console
$ docker run -d -p 80:9080 \
--volumes-from app websphere-liberty:webProfile8
```
# Using `springBoot` images
The `springBoot` images introduce capabilities specific to the support of Spring Boot applications, including the `springBootUtility` used to separate Spring Boot applications into thin applications and dependency library caches. To elaborate these capabilities this section assumes the standalone Spring Boot 2.0.x application `hellospringboot.jar` exists in the `/tmp` directory.