0% found this document useful (0 votes)
2 views

Docker

Docker is a platform that uses container-based virtualization to develop, ship, and run applications, relying on a lightweight Docker Engine that operates on the host OS. It allows for resource sharing and isolation through containers, which are less resource-intensive compared to full virtual machines. The document also outlines basic Docker commands and how to manage MySQL containers using Docker.

Uploaded by

swoobhai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Docker

Docker is a platform that uses container-based virtualization to develop, ship, and run applications, relying on a lightweight Docker Engine that operates on the host OS. It allows for resource sharing and isolation through containers, which are less resource-intensive compared to full virtual machines. The document also outlines basic Docker commands and how to manage MySQL containers using Docker.

Uploaded by

swoobhai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

 Docker is a platform for developing, shipping and running applications using a

container based Virtualization technique.


 The car needs an engine to run, similarly Docker needs an engine to run.
 Docker Engine sits on top of the host operating system
 In short Docker engine, is a lightweight container run time. Let us go through what
it means.

Docker

• Runs the same operating system as the Host OS.

• This allows it to share a lot of host operating system resources.

• In order to achieve this they originally used LXC (LinuX Containers) but later moved
to runC (aka libcontainer).

• AuFS is a layered file system, so you can have a read only part and a write part
which are merged together. One could have the common parts of the operating
system as read only (and shared amongst all of your containers) and then give each
container its own mount for writing.

Virtual Machines
• A full virtualized system gets its own set of resources allocated to it, and does
minimal sharing.

• You get more isolation, but it is much heavier (requires more resources). With
docker you get less isolation, but the containers are lightweight (require fewer
resources).

What is the Docker platform?

Docker provides the ability to package and run an application in a loosely isolated
environment called a container. The isolation and security allow you to run many
containers simultaneously on a given host.

What is the Docker Engine?

Docker Engine is a client-server application with these major components:


A server which is a type of long-running program called a daemon process.

A REST API which specifies interfaces that programs can use to talk to the daemon and
instruct it what to do.

A command line interface (CLI) client.

From docker image you can create multiple containers.

Docker Commands:

$ docker version

$ docker –v

MYSQL DB:

$ docker pull mysql:5.7

Pulls the Docker image from docker hub https://hub.docker.com/_/mysql/

$ docker run --name mysql-standalone -e


MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=test -e
MYSQL_USER=sa -e MYSQL_PASSWORD=password

-d mysql:5.7

Command to run the mysql container.

$ docker build . -t users-mysql

Creating a docker image from the Spring Boot Application using the Dockerfile.

$ docker run -p 8086:8086 --name users-mysql --link mysql-


standalone:mysql -d users-mysql

$ docker container ls

$ docker logs <container_name>

$ docker container rm <container_name>


http://www.java67.com/2018/02/5-free-docker-courses-for-java-
and-DevOps-engineers.html

You might also like