Monday 11 March 2019

All about Docker basic on AWS server by Raj Gupta




To install docker

[ec2-user@ip-172-31-39-224 ~]$ sudo yum install docker

to start docker
[ec2-user@ip-172-31-39-224 ~]$ sudo service docker start


to get the information about docker

[ec2-user@ip-172-31-39-224 ~]$ sudo docker info

to create a docker container from ubuntu image from internet
[ec2-user@ip-172-31-39-224 ~]$ sudo docker container run ubuntu cat /etc/os-release

to check the docker images
[ec2-user@ip-172-31-39-224 ~]$ sudo docker image ls


REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              latest              93fd78260bd1        2 weeks ago         86.2MB

to check the running container
[ec2-user@ip-172-31-39-224 ~]$ sudo docker container ls

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

to check all running+ non running container
[ec2-user@ip-172-31-39-224 ~]$ sudo docker container ls -a

CONTAINER ID        IMAGE               COMMAND                 CREATED             STATUS                     PORTS               NAMES
b9c5403afb49        ubuntu              "cat /etc/os-release"   4 minutes ago       Exited (0) 4 minutes ago                       awesome_rosalind

to create one more container 
[ec2-user@ip-172-31-39-224 ~]$ sudo docker container run ubuntu sleep 30

to check both container
[ec2-user@ip-172-31-39-224 ~]$ sudo docker container ls -a

CONTAINER ID        IMAGE               COMMAND                 CREATED             STATUS                          PORTS               NAMES
aea80b8709e2        ubuntu              "sleep 30"              2 minutes ago       Exited (0) About a minute ago                       mystifying_wing
b9c5403afb49        ubuntu              "cat /etc/os-release"   8 minutes ago       Exited (0) 8 minutes ago                            awesome_rosalind





                                   


No comments:

Post a Comment