Docker is a light weight container which runs on any computer or any cloud. It runs as an isolated process on the host operating system and its easier to create, deploy and run application. It is bit like a virtual machine, but it has different architectural approach which allow us to portable and efficient development.
You can install docker using this documentation on Linux.
Step 1 :-
You need to create a docker file. I have provided a simple docker file which use to copy identity server in to a docker image. Please copy below two lines in to a new file and modify file name as 'Docker'. I'm creating a directory 'is500image' somewhere and put this file in to that directory.
Sample Dockerfile to create a docker image with WSO2 IS 5.0.0.
FROM cogniteev/oracle-java:java7
ADD ./wso2is-5.0.0.tar.gz /opt/wso2
Step 2 :-
its better to create a tar.gz file using below commands. tar.gz file unzip its contend when its coping to docker image. You may create a file in any format, but you must be unzip the file inside the docker image.
Copy extracted wso2is-5.0.0 in to the is500image directory(which is created in first step) and execute below command.
docker build -t is500dockerimage .
This command should have a dot(.) at the end (run the command in the same directory which contained Docker file)
Step 3 :-
You can create multiple docker instances using one docker image. Use this command to run a docker instance.
docker run -i -t is500dockerimage
(docker run -i -t imageName)
When you run this command in different terminal, you can create different instances.
Important commands when you working with Docker
* If you want to stop any docker image, first you have to find the process id.
docker ps -a
docker ps
Then you can kill the process using below command.
docker kill CONTAINER_ID
Comments
Post a Comment