docker

Know Docker

Docker
We can containerize the applications with all related dependencies, libraries, configurations, infrastructure so that application works independently.

docker

Components:
Docker Client: Docker build pull and run operations and establish communication with the Docker Host.
Docker Host: This component contains Docker Daemon, Containers and its images.
Registry: This component will be storing the Docker images/ Docker hub

Docker Image is a set of files and a combination of parameters which will create a full setup
Docker Compose is a YAML file which contains details about the services, networks, and volumes for setting up the Docker application.
Docker Swarm is native clustering for Docker.

Some useful commands
docker pull <image_name> // get image
docker run -it -d <image_name> // build image
docker ps // find images
docker exec -it <image_name> bash // get into bash of docker image
docker push <image name> // if any local changes are made, then push it

We create a dockerfile with all instructions to build the environment
docker build <path to docker file>

Sample DockerFile content

FROM <path to tomcat>
#setting environment path
ENV TOMCAT_HOME /opt/tomcat

# some installations
RUN yum -y install httpd mod_ssl wget unzip vim telnet

# Make sure we are using the latest software
RUN yum -y upgrade

# Install bind-utils to make available dig command for dynatrace
RUN yum install bind-utils

RUN mkdir -p /var/logs/proj
RUN chown tomcat:tomcat /var/logs/proj
RUN mkdir -p /var/logs/tomcat

EXPOSE 80 443

Leave a Comment

Your email address will not be published. Required fields are marked *