Swap back-ticks for indents

This commit is contained in:
David Currie 2015-01-23 17:52:14 +00:00
parent b9f9031ca2
commit d79c319961
1 changed files with 20 additions and 36 deletions

View File

@ -20,9 +20,7 @@ deployment sample][sample] and assume that
`server.xml` updated to accept HTTP connections from outside of the `server.xml` updated to accept HTTP connections from outside of the
container by adding the following element inside the `server` stanza: container by adding the following element inside the `server` stanza:
``` <httpEndpoint host="*" httpPort="9080" httpsPort="-1"/>
<httpEndpoint host="*" httpPort="9080" httpsPort="-1"/>
```
1. The image contains a default server configuration that specifies the 1. The image contains a default server configuration that specifies the
`webProfile-6.0` feature and exposes ports 9080 and 9443 for HTTP and HTTPS `webProfile-6.0` feature and exposes ports 9080 and 9443 for HTTP and HTTPS
@ -31,11 +29,9 @@ 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 background running a WAR file from the host file system with the HTTP and HTTPS
ports mapped to 80 and 443 respectively. ports mapped to 80 and 443 respectively.
``` docker run -e LICENSE=accept -d -p 80:9080 -p 443:9443 \
docker run -e LICENSE=accept -d -p 80:9080 -p 443:9443 \ -v /tmp/DefaultServletEngine/dropins/Sample1.war:/opt/ibm/wlp/usr/servers/defaultServer/dropins/Sample1.war \
-v /tmp/DefaultServletEngine/dropins/Sample1.war:/opt/ibm/wlp/usr/servers/defaultServer/dropins/Sample1.war \ websphere-liberty
websphere-liberty
```
Once the server has started, you can browse to Once the server has started, you can browse to
http://localhost/Sample1/SimpleServlet on the Docker host. http://localhost/Sample1/SimpleServlet on the Docker host.
@ -46,11 +42,9 @@ specify the server name as a parameter to the run command. Note that
this particular example server configuration only provides HTTP this particular example server configuration only provides HTTP
access. access.
``` docker run -e LICENSE=accept -d -p 80:9080 \
docker run -e LICENSE=accept -d -p 80:9080 \ -v /tmp/DefaultServletEngine:/opt/ibm/wlp/usr/servers/DefaultServletEngine \
-v /tmp/DefaultServletEngine:/opt/ibm/wlp/usr/servers/DefaultServletEngine \ websphere-liberty /opt/ibm/wlp/bin/server run DefaultServletEngine
websphere-liberty /opt/ibm/wlp/bin/server run DefaultServletEngine
```
3. It is also possible to build an application layer on top of this image using 3. It is also possible to build an application layer on top of this image using
either the default server configuration or a new server configuration and, either the default server configuration or a new server configuration and,
@ -58,18 +52,14 @@ optionally, accept the license as part of that build. Here we have copied the
`Sample1.war` from `/tmp/DefaultServletEngine/dropins` to the same directory as `Sample1.war` from `/tmp/DefaultServletEngine/dropins` to the same directory as
the following Dockerfile. the following Dockerfile.
``` FROM websphere-liberty
FROM websphere-liberty ADD Sample1.war /opt/ibm/wlp/usr/servers/defaultServer/dropins/
ADD Sample1.war /opt/ibm/wlp/usr/servers/defaultServer/dropins/ ENV LICENSE accept
ENV LICENSE accept
```
This can then be built and run as follows: This can then be built and run as follows:
``` docker build -t app .
docker build -t app . docker run -d -p 80:9080 -p 443:9443 app
docker run -d -p 80:9080 -p 443:9443 app
```
4. Lastly, it is possible to mount a data volume container containing the 4. Lastly, it is possible to mount a data volume container containing the
application and the server configuration on to the image. This has the benefit application and the server configuration on to the image. This has the benefit
@ -81,25 +71,19 @@ Dockerfile.
Build and run the data volume container: Build and run the data volume container:
``` FROM websphere-liberty
FROM websphere-liberty ADD DefaultServletEngine /opt/ibm/wlp/usr/servers/DefaultServletEngine
ADD DefaultServletEngine /opt/ibm/wlp/usr/servers/DefaultServletEngine
```
``` docker build -t app-image .
docker build -t app-image . docker run -d -v /opt/ibm/wlp/usr/servers/DefaultServletEngine \
docker run -d -v /opt/ibm/wlp/usr/servers/DefaultServletEngine \ --name app app-image true
--name app app-image true
```
Run the WebSphere Liberty image with the volumes from the data Run the WebSphere Liberty image with the volumes from the data
volume container mounted: volume container mounted:
``` docker run -e LICENSE=accept -d -p 80:9080 \
docker run -e LICENSE=accept -d -p 80:9080 \ --volumes-from app websphere-liberty \
--volumes-from app websphere-liberty \ /opt/ibm/wlp/bin/server run DefaultServletEngine
/opt/ibm/wlp/bin/server run DefaultServletEngine
```
[getting-started]: https://developer.ibm.com/wasdev/docs/category/getting-started/ [getting-started]: https://developer.ibm.com/wasdev/docs/category/getting-started/
[sample]: https://developer.ibm.com/wasdev/docs/article_appdeployment/ [sample]: https://developer.ibm.com/wasdev/docs/article_appdeployment/