Docker Basics
What is a Docker Container? In Part 1 of this series, we explore the Docker open source project. Visit Part 2, to learn how Docker open sources containers work.
Docker container is an open source software development platform. Its main benefit is to package applications in “containers,” allowing them to be portable among any system running the Linux operating system (OS).
Container technology has been around for a while, but momentum and hype around Docker’s approach to containers has pushed this approach to the forefront in the last year. It is one form of container technology.
Docker Open Source Background
Docker came along in March, 2013, when the code, invented by Solomon Hykes, was released as open source. It’s also the name of a company founded by Hykes that supports and develops Docker code.
Both the Docker open source container and company’s approach have a lot of appeal, especially for cloudapplications and agile development. Because many different Docker applications can run on top of a single OS instance, this can be a more efficient way to run applications.
The company’s approach also speeds up applications development and testing, because software developers don’t have to worry about shipping special versions of the code for different operating systems. Because of the lightweight nature of its containers, the approach can also improve the portability of applications. Docker and containers are an efficient and fast way to move pieces of software around in the cloud.
The company received $40 million in venture capital funding from Sequoia Inc. in September of 2014, and several reports at the time said the valuation was close to $400M. The platform consists of Docker Engine, a runtime and software packaging tool, and Docker Hub, a service for sharing applications in the cloud.
Portability and Scalability
Some software gurus argue that the real benefit of container technology allows for much larger scale of applications in virtualized environments, because of the efficiencies of virtualizing the OS. Others argue that the real benefit is inDevOps and testing, because the applications can be built and tested much more quickly.
The downside of Docker open source container technology is that it is limited to use in Linux environments. Also, as an application technology, it requires specific expertise and security safeguards geared toward a container architecture.
Some Basics here:
1.Remove the containers that are using this image as:docker ps -a | grep arungupta/wildfly-centos | awk '{print $1}' | xargs docker rm
2.To remove any conatiner:
docker rm <container_id>
3.To know Container IDs of all images:
docker ps -a
4.Creating docker image using Dockerfile
docker build -t <image_name> <directory path in which Dockerfile exist>
5.To know the IP Address of any container
docker inspect <container_id>| grep IP
6.Tagging and renaming of any docker image
docker tag <image_id> <repo_name>/<image_name>:latest
7.removing of doker images and containers(tricks)
tricks to remove docker container and images according to requirement
8.creating image from existing image or container
docker commit <running_container_id> ubuntu-with-jenkinsuser
Note: Cocept of EXPOSE and -p
If you do not specify any of those, the service in the container will not be accessible from anywhere except from inside the container itself.
If you
EXPOSE
a port, the service in the container is not accessible from outside Docker, but from inside other Docker containers. So this is good for inter-container communication.
If you
EXPOSE
and -p
a port, the service in the container is accessible from anywhere, even outside Docker.
IMP:If you do
-p
, but do not EXPOSE
, Docker does an implicit EXPOSE
. This is because if a port is open to the public, it is automatically also open to other Docker containers. Hence -p
includes EXPOSE
. That's why I didn't list it above as a fourth case.
Docker Networking :
1.https://www.ctl.io/developers/blog/post/docker-networking-rules/
2.
3.http://linoxide.com/linux-how-to/networking-commands-docker-containers/
3.http://linoxide.com/linux-how-to/networking-commands-docker-containers/
Subscribe to:
Post Comments
(
Atom
)
The information which you have provided in this blog is really useful to everyone. Thanks for sharing.
ReplyDeleteDocker and Kubernetes Training
Docker and Kubernetes Online Training
Docker and Kubernetes Training in Hyderabad
Docker Online Training