What is Docker?
Docker is a container technology that provides a platform as a service that uses OS-level virtualization to deliver software in packages known as containers.
You can create one or more containers from one os image and customize them as per your need, containers are isolated from one another and bundle their software, libraries, and configuration files; they can communicate with each other through well-defined channels.
Step by Step installation
apt install docker.io docker docker-engineAfter the successful installation of docker enable it.
service docker enableAnd start docker
service docker startYou can also disable it
service docker disableyou can also stop docker temporarily
service docker stop
Docker images
Images in docker are packaged services or environments, like iso images to boot the system. Images are created with the build command, and they’ll produce a container when it started with a run. Images are stored in a Docker registry such as registry.hub.docker.com
To list docker images simply run command
docker images -a
Docker container
Docker is an instance of an image, the container is an instance of a class—a runtime object.
**To list all containers **
docker ps -a
Building Linux containers to use in docker
All you have to execute a simple command based on your need or can search containers on hub.docker.com.
Example if you want to install ubuntu 32-bit container then pull 32-bit ubuntu image
docker -h
docker pull m0elnx/ubuntu-32bit
This will pull the image in your system and now you can launch your instance from it
- it - interactive terminal
- name - to put the name of your instance
docker images -a
docker run -it --name hacker m0elnx/ubuntu-32bit
you can stop it using
exitif you want to start it again
docker start hacker
docker attach hackerAnd now you can launch your new OS in 2 seconds
What about use kali instance in docker
simply install as above
docker pull kalilinux/kali-linux-docker
docker run -it --name elitehacker kalilinux/kali-linux-dockeryou can install parrot sec also
docker pull parrotsec/security
docker run -it --name hactivist parrotsec/securityDownload docker cheatsheet learn more about docker click here
Conclusion
Install docker, follow steps, I will also explain how to set up the lab in docker, or you can try it yourself, it’s easy.