1. To install docker in amazon ec2 linux server
[ec2-user@ip-172-31-39-224 ~]$ sudo yum install docker
2. To start docker
[ec2-user@ip-172-31-39-224 ~]$ sudo service docker start
3. To check the status
[ec2-user@ip-172-31-39-224 ~]$ sudo service docker status
4. To get the information about docker
[ec2-user@ip-172-31-39-224 ~]$ sudo docker info
5. To get the version of docker
[ec2-user@ip-172-31-39-224 ~]$ sudo docker version
6. To create a docker container from ubuntu image and get the release of ubuntu
[root@ip-172-31-92-105 ~]# docker container run ubuntu cat /etc/os-release
7. To create a docker container from ubuntu image and run sleep command for 30s
[root@ip-172-31-92-105 ~]# docker container run ubuntu sleep 30
8. To get list of docker image
[root@ip-172-31-92-105 ~]# docker image ls
9. To list all running container
[root@ip-172-31-92-105 ~]# docker container ls
10. To list all running and non-running container
[root@ip-172-31-92-105 ~]# docker container ls –a
No comments:
Post a Comment