-
Docker is a centralized platform for packaging, deploying, and running applications. Before Docker, many users face the problem that a particular code is running in the developer's system but not in the user's system. So, the main reason to develop docker is to help developers to develop applications easily, ship them into containers, and can be deployed anywhere.
-
Docker was firstly released in March 2013. It is used in the Deployment stage of the software development life cycle that's why it can efficiently resolve issues related to the application deployment.
docker --version
docker info
docker pull image--name
docker images
docker run image--name
docker ps
docker ps -a
#use a base image
FROM alpine:lateast
#run a comment
CMD ["echo","Hello,Docker"]
docker build -t my-simple-image .
docker pull node
docker run node
docker start container_name
docker exec -it container_name node
docker exec -it container_name /bin/bash
cd /usr/localbin/bin
node
docker run --name node_imagename node_containername
docker rename node_imagename newnode_imagename
docker container prune
- my_sample.txt file to create a file
docker pull alpine
docker run -it --name my_alpina_container
ls
not stoping this comment new open terminal
current working txt file path open terminal
docker cp .\my_example.txt container_name:/example.txt
docker cp .\my_example.txt container_name:/var/example.txt
copy to the file conatiner name var path inside
cat example.txt
docker cp container__name:/file_name.txt ./exmple_copy.txt
- Dockerfile create a file name
FROM alpine:lateast
CMD echo "Hello,Docker"
open terminal
docker build -t image_name .
The next step to a DockerHub to publish
- Repositories
- create Repositories
- repo name & descrption
- public
- create
docker login
docker tag my-simple-image selvalr/my-simple-image-repo:latest
docker push selvalr/my-simple-image-repo:latest
first delete the docker image to a your already pushing a data in docler container
docker pull selvalr/my-simple-image-repo:latest
docker run -it selvalr/my-simple-image-repo