docker is a tool designed to make it easier to create deploy and run applications by using containers.
sudo yum install docker -y
sudo systemctl start docker
docker --version
docker login give the login credentials and password
docker images
docker build -t name (t indicates the tag)
docker pull imagename
docker run -it --name name of the container -p port number image name
example imagename is nginx and container name is c1 need to run on specific port 8000
docker run -it --name c1 -p 8000:8000 nginx (-it indicates run in a interactive mode) you can use -d for detached mode.
docker ps
docker ps -a
docker rmi imagename
docker rm containername / id
docker stop containername/id
FROM ENV RUN ENTRYPOINT ADD WORKDIR EXPOSE USER VOLUME
first you need to tag the image
docker tag name orginalimage name
for ex: i need to make ubuntu offical in my own name you can tag by giving your name
docker tag ubuntu balaubuntu
after the tag the image is created on your own name
to push
docker push balaubuntu.
docker commit conatinername newimagename ex: conatiner is c8 and image is nginx:v2 docker commit c8 nginx:v2