Vous êtes sur la page 1sur 4

Build and Deploy ODM Container with Docker :

Check Current directory:


Docker is installed on both servers and each have an image called odm89. Please follow these
commands to reinstall docker and images and for starting and stopping the server. Use the
following instructions to build an ODM image for docker. (image is already built and installed on the

Docker Installation
Follow these commands to install:
[ec2-user@ip-172-31-25-48 /]$ sudo su
[root@ip-172-31-25-48 /]# sudo yum install yum-utils
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Package yum-utils-1.1.31-42.el7.noarch already installed and latest version
Nothing to do
[root@ip-172-31-25-48 /]# sudo yum-config-manager --enable rhui-REGION-rhel-server-extras

sudo yum install docker

Check docker version :

docker -v
Dockerfile contents :

Docker can build images automatically by reading the instructions from a Dockerfile, a text file
that contains all the commands, in order, needed to build a given image. Dockerfiles adhere to
a specific format and use a specific set of instructions.

Reference : Dockerfile Reference .

# ODM on liberty with microsoft database

FROM websphere-liberty:8.5.5
MAINTAINER Ming Li <lmming@cn.ibm.com>
# accept license by default
# Deploy database driver for microsoft
COPY mssql-jdbc-6.2.2.jre8.jar /opt/ibm/wlp/usr/shared/resources/microsoft/
# Init microsoft database
# ADD data.tar.gz opt/ibm/wlp/usr/shared/resources/
# Deploy the war files for RES and DC
COPY apps /opt/ibm/wlp/usr/servers/defaultServer/apps/
# Update server configuration
COPY server.xml /opt/ibm/wlp/usr/servers/defaultServer/
COPY jvm.options /opt/ibm/wlp/usr/servers/defaultServer/

Docker file is available on : /home/ec2-user/build_mssql

Start docker service :

sudo service docker start

Build Docker image :
Navigate to the location of Dockerfile In the server in our case

docker build -t odm89 .

Check the list of all docker images present in the server [Optional]:
docker images -a

Run the docker container based on an image :

docker run --restart always -p 80:9080 -p 9443:9443 odm89
List all containers [Optional]:
docker ps –a

Check Container Stats[Optional] :

docker stats

Stop Running Container by Container ID :


Remove all stopped containers :

$ docker rm $(docker ps -a -q)

For more commands reference :