You are on page 1of 16

C:\Users\RA20057382>ssh -i "aws_docker_system.pem" ec2-user@ec2-13-235-87-183.

ap-
south-1.compute.amazonaws.com

C:\Users\RA20057382>ls
'3D Objects'
AppData
'Application Data'
Contacts
Cookies
Desktop
Documents
Downloads
Favorites
IntelGraphicsProfiles
Links
'Local Settings'
MicrosoftEdgeBackups
Music
'My Documents'
NTUSER.DAT
NTUSER.DAT{47a6a17a-a514-11e7-a94e-ec0d9a05c860}.TM.blf
NTUSER.DAT{47a6a17a-a514-11e7-a94e-
ec0d9a05c860}.TMContainer00000000000000000001.regtrans-ms
NTUSER.DAT{47a6a17a-a514-11e7-a94e-
ec0d9a05c860}.TMContainer00000000000000000002.regtrans-ms
NetHood
OneDrive
Pictures
PrintHood
Recent
'Saved Games'
Searches
SendTo
SolutionsTemp
'Start Menu'
Templates
Videos
'mcafee dlp quarantined files'
ntuser.dat.LOG1
ntuser.dat.LOG2
ntuser.ini
ntuser.pol

C:\Users\RA20057382>cd Downloads

C:\Users\RA20057382\Downloads>ssh -i "aws_docker_system.pem" ec2-user@ec2-13-235-


87-183.ap-south-1.compute.amazonaws.com
The authenticity of host 'ec2-13-235-87-183.ap-south-1.compute.amazonaws.com
(13.235.87.183)' can't be established.
ECDSA key fingerprint is SHA256:Sz58/JOSPXLDJJVJyFBYQQVHLwT6iD2o9XvmboePw0E.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-13-235-87-183.ap-south-
1.compute.amazonaws.com,13.235.87.183' (ECDSA) to the list of known hosts.
Last login: Tue Jun 11 14:18:20 2019 from 103.82.209.45

__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-2/
5 package(s) needed for security, out of 7 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-172-31-3-249 ~]$ sudo su -
Last login: Tue Jun 11 14:18:23 UTC 2019 on pts/0
[root@ip-172-31-3-249 ~]# yum install docker
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 0:18.06.1ce-8.amzn2 will be installed
--> Processing Dependency: pigz for package: docker-18.06.1ce-8.amzn2.x86_64
--> Processing Dependency: libcgroup for package: docker-18.06.1ce-8.amzn2.x86_64
--> Processing Dependency: libltdl.so.7()(64bit) for package: docker-18.06.1ce-
8.amzn2.x86_64
--> Running transaction check
---> Package libcgroup.x86_64 0:0.41-15.amzn2 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-22.2.amzn2.0.2 will be installed
---> Package pigz.x86_64 0:2.3.4-1.amzn2.0.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================
=====================================
Package Arch Version
Repository Size
===================================================================================
=====================================
Installing:
docker x86_64 18.06.1ce-8.amzn2
amzn2extra-docker 37 M
Installing for dependencies:
libcgroup x86_64 0.41-15.amzn2
amzn2-core 65 k
libtool-ltdl x86_64 2.4.2-22.2.amzn2.0.2
amzn2-core 49 k
pigz x86_64 2.3.4-1.amzn2.0.1
amzn2-core 81 k

Transaction Summary
===================================================================================
=====================================
Install 1 Package (+3 Dependent packages)

Total download size: 37 M


Installed size: 151 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): libcgroup-0.41-15.amzn2.x86_64.rpm
| 65 kB 00:00:00
(2/4): libtool-ltdl-2.4.2-22.2.amzn2.0.2.x86_64.rpm
| 49 kB 00:00:00
(3/4): pigz-2.3.4-1.amzn2.0.1.x86_64.rpm
| 81 kB 00:00:00
(4/4): docker-18.06.1ce-8.amzn2.x86_64.rpm 82% [============================-
] 0.0 B/s | 31 MB --:--:-- ETA (4/4): docker-18.06.1ce-8.amzn2.x86_64.rpm
| 37 MB 00:00:00
-----------------------------------------------------------------------------------
-------------------------------------
Total
56 MB/s | 37 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libtool-ltdl-2.4.2-22.2.amzn2.0.2.x86_64
1/4
Installing : pigz-2.3.4-1.amzn2.0.1.x86_64
2/4
Installing : libcgroup-0.41-15.amzn2.x86_64
3/4
Installing : docker-18.06.1ce-8.amzn2.x86_64
4/4
Verifying : libcgroup-0.41-15.amzn2.x86_64
1/4
Verifying : pigz-2.3.4-1.amzn2.0.1.x86_64
2/4
Verifying : libtool-ltdl-2.4.2-22.2.amzn2.0.2.x86_64
3/4
Verifying : docker-18.06.1ce-8.amzn2.x86_64
4/4

Installed:
docker.x86_64 0:18.06.1ce-8.amzn2

Dependency Installed:
libcgroup.x86_64 0:0.41-15.amzn2 libtool-ltdl.x86_64 0:2.4.2-22.2.amzn2.0.2
pigz.x86_64 0:2.3.4-1.amzn2.0.1

Complete!
[root@ip-172-31-3-249 ~]#

C:\Users\RA20057382>ssh -i "aws_docker_system.pem" ec2-user@ec2-13-235-87-183.ap-


south-1.compute.amazonaws.com

C:\Users\RA20057382>ls
'3D Objects'
AppData
'Application Data'
Contacts
Cookies
Desktop
Documents
Downloads
Favorites
IntelGraphicsProfiles
Links
'Local Settings'
MicrosoftEdgeBackups
Music
'My Documents'
NTUSER.DAT
NTUSER.DAT{47a6a17a-a514-11e7-a94e-ec0d9a05c860}.TM.blf
NTUSER.DAT{47a6a17a-a514-11e7-a94e-
ec0d9a05c860}.TMContainer00000000000000000001.regtrans-ms
NTUSER.DAT{47a6a17a-a514-11e7-a94e-
ec0d9a05c860}.TMContainer00000000000000000002.regtrans-ms
NetHood
OneDrive
Pictures
PrintHood
Recent
'Saved Games'
Searches
SendTo
SolutionsTemp
'Start Menu'
Templates
Videos
'mcafee dlp quarantined files'
ntuser.dat.LOG1
ntuser.dat.LOG2
ntuser.ini
ntuser.pol

C:\Users\RA20057382>cd Downloads

C:\Users\RA20057382\Downloads>ssh -i "aws_docker_system.pem" ec2-user@ec2-13-235-


87-183.ap-south-1.compute.amazonaws.com
The authenticity of host 'ec2-13-235-87-183.ap-south-1.compute.amazonaws.com
(13.235.87.183)' can't be established.
ECDSA key fingerprint is SHA256:Sz58/JOSPXLDJJVJyFBYQQVHLwT6iD2o9XvmboePw0E.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-13-235-87-183.ap-south-
1.compute.amazonaws.com,13.235.87.183' (ECDSA) to the list of known hosts.
Last login: Tue Jun 11 14:18:20 2019 from 103.82.209.45

__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|

https://aws.amazon.com/amazon-linux-2/
5 package(s) needed for security, out of 7 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-172-31-3-249 ~]$ sudo su -
Last login: Tue Jun 11 14:18:23 UTC 2019 on pts/0
[root@ip-172-31-3-249 ~]# yum install docker
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 0:18.06.1ce-8.amzn2 will be installed
--> Processing Dependency: pigz for package: docker-18.06.1ce-8.amzn2.x86_64
--> Processing Dependency: libcgroup for package: docker-18.06.1ce-8.amzn2.x86_64
--> Processing Dependency: libltdl.so.7()(64bit) for package: docker-18.06.1ce-
8.amzn2.x86_64
--> Running transaction check
---> Package libcgroup.x86_64 0:0.41-15.amzn2 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-22.2.amzn2.0.2 will be installed
---> Package pigz.x86_64 0:2.3.4-1.amzn2.0.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================
=====================================
Package Arch Version
Repository Size
===================================================================================
=====================================
Installing:
docker x86_64 18.06.1ce-8.amzn2
amzn2extra-docker 37 M
Installing for dependencies:
libcgroup x86_64 0.41-15.amzn2
amzn2-core 65 k
libtool-ltdl x86_64 2.4.2-22.2.amzn2.0.2
amzn2-core 49 k
pigz x86_64 2.3.4-1.amzn2.0.1
amzn2-core 81 k

Transaction Summary
===================================================================================
=====================================
Install 1 Package (+3 Dependent packages)

Total download size: 37 M


Installed size: 151 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): libcgroup-0.41-15.amzn2.x86_64.rpm
| 65 kB 00:00:00
(2/4): libtool-ltdl-2.4.2-22.2.amzn2.0.2.x86_64.rpm
| 49 kB 00:00:00
(3/4): pigz-2.3.4-1.amzn2.0.1.x86_64.rpm
| 81 kB 00:00:00
(4/4): docker-18.06.1ce-8.amzn2.x86_64.rpm 82% [============================-
] 0.0 B/s | 31 MB --:--:-- ETA (4/4): docker-18.06.1ce-8.amzn2.x86_64.rpm
| 37 MB 00:00:00
-----------------------------------------------------------------------------------
-------------------------------------
Total
56 MB/s | 37 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libtool-ltdl-2.4.2-22.2.amzn2.0.2.x86_64
1/4
Installing : pigz-2.3.4-1.amzn2.0.1.x86_64
2/4
Installing : libcgroup-0.41-15.amzn2.x86_64
3/4
Installing : docker-18.06.1ce-8.amzn2.x86_64
4/4
Verifying : libcgroup-0.41-15.amzn2.x86_64
1/4
Verifying : pigz-2.3.4-1.amzn2.0.1.x86_64
2/4
Verifying : libtool-ltdl-2.4.2-22.2.amzn2.0.2.x86_64
3/4
Verifying : docker-18.06.1ce-8.amzn2.x86_64
4/4
Installed:
docker.x86_64 0:18.06.1ce-8.amzn2

Dependency Installed:
libcgroup.x86_64 0:0.41-15.amzn2 libtool-ltdl.x86_64 0:2.4.2-22.2.amzn2.0.2
pigz.x86_64 0:2.3.4-1.amzn2.0.1

Complete!
[root@ip-172-31-3-249 ~]# systemctl status docker
? docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset:
disabled)
Active: inactive (dead)
Docs: https://docs.docker.com
[root@ip-172-31-3-249 ~]# systemctl start docker
[root@ip-172-31-3-249 ~]# systemctl status docker
? docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset:
disabled)
Active: active (running) since Thu 2019-06-13 02:58:30 UTC; 9s ago
Docs: https://docs.docker.com
Process: 3430 ExecStartPre=/usr/libexec/docker/docker-setup-runtimes.sh
(code=exited, status=0/SUCCESS)
Process: 3394 ExecStartPre=/bin/mkdir -p /run/docker (code=exited,
status=0/SUCCESS)
Main PID: 3442 (dockerd)
Tasks: 18
Memory: 36.7M
CGroup: /system.slice/docker.service
+-3442 /usr/bin/dockerd --default-ulimit nofile=1024:4096
+-3452 docker-containerd --config
/var/run/docker/containerd/containerd.toml

Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:


time="2019-06-13T02:58:30.062467821Z" le...pc
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.063209824Z" le...pc
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.063582559Z" le...."
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.248003636Z" le...s"
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.291232289Z" le...."
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.314951786Z" le...ce
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.315519695Z" le...n"
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.323840259Z" le...H"
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal systemd[1]: Started
Docker Application Container Engine.
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.340036018Z" le...k"
Hint: Some lines were ellipsized, use -l to show in full.
[root@ip-172-31-3-249 ~]# docker --version
Docker version 18.06.1-ce, build e68fc7a215d7133c34aa18e3b72b4a21fd0c6136
[root@ip-172-31-3-249 ~]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.06.1-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.14.114-105.126.amzn2.x86_64
Operating System: Amazon Linux 2
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 983.7MiB
Name: ip-172-31-3-249.ap-south-1.compute.internal
ID: JGPY:ZVZ4:5IQ2:62Y7:GZF3:2GLI:IH65:6PJR:R5E4:EJHE:FYMJ:W4ZR
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

[root@ip-172-31-3-249 ~]#

root@ip-172-31-3-249 ~]# docker run hello-world


Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:41a65640635299bab090f783209c1e3a3f11934cf7756b09cb2f1e02147c6ed8
Status: Downloaded newer image for hello-world:latest

Hello from Docker!


This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:


1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:


https://docs.docker.com/get-started/

[root@ip-172-31-3-249 ~]#
root@ip-172-31-3-249 ~]# docker image ls
REPOSITORY TAG IMAGE ID CREATED
SIZE
hello-world latest fce289e99eb9 5 months ago
1.84kB
[root@ip-172-31-3-249 ~]# docker container ls --all
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
a9e7c385a929 hello-world "/hello" 4 minutes ago
Exited (0) 4 minutes ago optimistic_yonath
[root@ip-172-31-3-249 ~]

[root@ip-172-31-3-249 ~]# docker container ls -aq


a9e7c385a929

root@ip-172-31-3-249 ~]# docker container run -it ubuntu:16.04


Unable to find image 'ubuntu:16.04' locally
16.04: Pulling from library/ubuntu
9ff7e2e5f967: Pull complete
59856638ac9f: Pull complete
6f317d6d954b: Pull complete
a9dde5e2a643: Pull complete
Digest: sha256:cad5e101ab30bb7f7698b277dd49090f520fe063335643990ce8fbd15ff920ef
Status: Downloaded newer image for ubuntu:16.04
root@7beb33f47078:/#
[root@ip-172-31-3-249 ~]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
7beb33f47078 ubuntu:16.04 "/bin/bash" 5 minutes ago
Exited (130) 6 seconds ago frosty_curie
a9e7c385a929 hello-world "/hello" 18 minutes ago
Exited (0) 17 minutes ago optimistic_yonath
[root@ip-172-31-3-249 ~]# docker container stop 7beb33f47078
7beb33f47078
[root@ip-172-31-3-249 ~]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
7beb33f47078 ubuntu:16.04 "/bin/bash" 6 minutes ago
Exited (130) 46 seconds ago frosty_curie
a9e7c385a929 hello-world "/hello" 18 minutes ago
Exited (0) 18 minutes ago optimistic_yonath
C:\Users\RA20057382>ssh -i "aws_docker_system.pem" ec2-user@ec2-13-235-87-183.ap-
south-1.compute.amazonaws.com

C:\Users\RA20057382>ls
'3D Objects'
AppData
'Application Data'
Contacts
Cookies
Desktop
Documents
Downloads
Favorites
IntelGraphicsProfiles
Links
'Local Settings'
MicrosoftEdgeBackups
Music
'My Documents'
NTUSER.DAT
NTUSER.DAT{47a6a17a-a514-11e7-a94e-ec0d9a05c860}.TM.blf
NTUSER.DAT{47a6a17a-a514-11e7-a94e-
ec0d9a05c860}.TMContainer00000000000000000001.regtrans-ms
NTUSER.DAT{47a6a17a-a514-11e7-a94e-
ec0d9a05c860}.TMContainer00000000000000000002.regtrans-ms
NetHood
OneDrive
Pictures
PrintHood
Recent
'Saved Games'
Searches
SendTo
SolutionsTemp
'Start Menu'
Templates
Videos
'mcafee dlp quarantined files'
ntuser.dat.LOG1
ntuser.dat.LOG2
ntuser.ini
ntuser.pol

C:\Users\RA20057382>cd Downloads

C:\Users\RA20057382\Downloads>ssh -i "aws_docker_system.pem" ec2-user@ec2-13-235-


87-183.ap-south-1.compute.amazonaws.com
The authenticity of host 'ec2-13-235-87-183.ap-south-1.compute.amazonaws.com
(13.235.87.183)' can't be established.
ECDSA key fingerprint is SHA256:Sz58/JOSPXLDJJVJyFBYQQVHLwT6iD2o9XvmboePw0E.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ec2-13-235-87-183.ap-south-
1.compute.amazonaws.com,13.235.87.183' (ECDSA) to the list of known hosts.
Last login: Tue Jun 11 14:18:20 2019 from 103.82.209.45

__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-2/
5 package(s) needed for security, out of 7 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-172-31-3-249 ~]$ sudo su -
Last login: Tue Jun 11 14:18:23 UTC 2019 on pts/0
[root@ip-172-31-3-249 ~]# yum install docker
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 0:18.06.1ce-8.amzn2 will be installed
--> Processing Dependency: pigz for package: docker-18.06.1ce-8.amzn2.x86_64
--> Processing Dependency: libcgroup for package: docker-18.06.1ce-8.amzn2.x86_64
--> Processing Dependency: libltdl.so.7()(64bit) for package: docker-18.06.1ce-
8.amzn2.x86_64
--> Running transaction check
---> Package libcgroup.x86_64 0:0.41-15.amzn2 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-22.2.amzn2.0.2 will be installed
---> Package pigz.x86_64 0:2.3.4-1.amzn2.0.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================
=====================================
Package Arch Version
Repository Size
===================================================================================
=====================================
Installing:
docker x86_64 18.06.1ce-8.amzn2
amzn2extra-docker 37 M
Installing for dependencies:
libcgroup x86_64 0.41-15.amzn2
amzn2-core 65 k
libtool-ltdl x86_64 2.4.2-22.2.amzn2.0.2
amzn2-core 49 k
pigz x86_64 2.3.4-1.amzn2.0.1
amzn2-core 81 k

Transaction Summary
===================================================================================
=====================================
Install 1 Package (+3 Dependent packages)

Total download size: 37 M


Installed size: 151 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): libcgroup-0.41-15.amzn2.x86_64.rpm
| 65 kB 00:00:00
(2/4): libtool-ltdl-2.4.2-22.2.amzn2.0.2.x86_64.rpm
| 49 kB 00:00:00
(3/4): pigz-2.3.4-1.amzn2.0.1.x86_64.rpm
| 81 kB 00:00:00
(4/4): docker-18.06.1ce-8.amzn2.x86_64.rpm 82% [============================-
] 0.0 B/s | 31 MB --:--:-- ETA (4/4): docker-18.06.1ce-8.amzn2.x86_64.rpm
| 37 MB 00:00:00
-----------------------------------------------------------------------------------
-------------------------------------
Total
56 MB/s | 37 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libtool-ltdl-2.4.2-22.2.amzn2.0.2.x86_64
1/4
Installing : pigz-2.3.4-1.amzn2.0.1.x86_64
2/4
Installing : libcgroup-0.41-15.amzn2.x86_64
3/4
Installing : docker-18.06.1ce-8.amzn2.x86_64
4/4
Verifying : libcgroup-0.41-15.amzn2.x86_64
1/4
Verifying : pigz-2.3.4-1.amzn2.0.1.x86_64
2/4
Verifying : libtool-ltdl-2.4.2-22.2.amzn2.0.2.x86_64
3/4
Verifying : docker-18.06.1ce-8.amzn2.x86_64
4/4

Installed:
docker.x86_64 0:18.06.1ce-8.amzn2

Dependency Installed:
libcgroup.x86_64 0:0.41-15.amzn2 libtool-ltdl.x86_64 0:2.4.2-22.2.amzn2.0.2
pigz.x86_64 0:2.3.4-1.amzn2.0.1

Complete!
[root@ip-172-31-3-249 ~]# systemctl status docker
? docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset:
disabled)
Active: inactive (dead)
Docs: https://docs.docker.com
[root@ip-172-31-3-249 ~]# systemctl start docker
[root@ip-172-31-3-249 ~]# systemctl status docker
? docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset:
disabled)
Active: active (running) since Thu 2019-06-13 02:58:30 UTC; 9s ago
Docs: https://docs.docker.com
Process: 3430 ExecStartPre=/usr/libexec/docker/docker-setup-runtimes.sh
(code=exited, status=0/SUCCESS)
Process: 3394 ExecStartPre=/bin/mkdir -p /run/docker (code=exited,
status=0/SUCCESS)
Main PID: 3442 (dockerd)
Tasks: 18
Memory: 36.7M
CGroup: /system.slice/docker.service
+-3442 /usr/bin/dockerd --default-ulimit nofile=1024:4096
+-3452 docker-containerd --config
/var/run/docker/containerd/containerd.toml

Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:


time="2019-06-13T02:58:30.062467821Z" le...pc
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.063209824Z" le...pc
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.063582559Z" le...."
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.248003636Z" le...s"
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.291232289Z" le...."
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.314951786Z" le...ce
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.315519695Z" le...n"
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.323840259Z" le...H"
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal systemd[1]: Started
Docker Application Container Engine.
Jun 13 02:58:30 ip-172-31-3-249.ap-south-1.compute.internal dockerd[3442]:
time="2019-06-13T02:58:30.340036018Z" le...k"
Hint: Some lines were ellipsized, use -l to show in full.
[root@ip-172-31-3-249 ~]# docker --version
Docker version 18.06.1-ce, build e68fc7a215d7133c34aa18e3b72b4a21fd0c6136
[root@ip-172-31-3-249 ~]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.06.1-ce
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.14.114-105.126.amzn2.x86_64
Operating System: Amazon Linux 2
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 983.7MiB
Name: ip-172-31-3-249.ap-south-1.compute.internal
ID: JGPY:ZVZ4:5IQ2:62Y7:GZF3:2GLI:IH65:6PJR:R5E4:EJHE:FYMJ:W4ZR
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

[root@ip-172-31-3-249 ~]# docker run hello-world


Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:41a65640635299bab090f783209c1e3a3f11934cf7756b09cb2f1e02147c6ed8
Status: Downloaded newer image for hello-world:latest

Hello from Docker!


This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:


1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:


https://docs.docker.com/get-started/

[root@ip-172-31-3-249 ~]# docker image ls


REPOSITORY TAG IMAGE ID CREATED
SIZE
hello-world latest fce289e99eb9 5 months ago
1.84kB
[root@ip-172-31-3-249 ~]# docker container ls --all
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
a9e7c385a929 hello-world "/hello" 4 minutes ago
Exited (0) 4 minutes ago optimistic_yonath
[root@ip-172-31-3-249 ~]# docker container ls --all
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
a9e7c385a929 hello-world "/hello" 5 minutes ago
Exited (0) 5 minutes ago optimistic_yonath
[root@ip-172-31-3-249 ~]# docker container ls -aq
a9e7c385a929
[root@ip-172-31-3-249 ~]# docker container run -it ubuntu:16.04
Unable to find image 'ubuntu:16.04' locally
16.04: Pulling from library/ubuntu
9ff7e2e5f967: Pull complete
59856638ac9f: Pull complete
6f317d6d954b: Pull complete
a9dde5e2a643: Pull complete
Digest: sha256:cad5e101ab30bb7f7698b277dd49090f520fe063335643990ce8fbd15ff920ef
Status: Downloaded newer image for ubuntu:16.04
root@7beb33f47078:/# docker container ls -a
bash: docker: command not found
root@7beb33f47078:/# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv
sys tmp usr var
root@7beb33f47078:/# ^C
root@7beb33f47078:/# ^C
root@7beb33f47078:/# exit
exit
[root@ip-172-31-3-249 ~]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
7beb33f47078 ubuntu:16.04 "/bin/bash" 5 minutes ago
Exited (130) 6 seconds ago frosty_curie
a9e7c385a929 hello-world "/hello" 18 minutes ago
Exited (0) 17 minutes ago optimistic_yonath
[root@ip-172-31-3-249 ~]# docker container stop 7beb33f47078
7beb33f47078
[root@ip-172-31-3-249 ~]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
7beb33f47078 ubuntu:16.04 "/bin/bash" 6 minutes ago
Exited (130) 46 seconds ago frosty_curie
a9e7c385a929 hello-world "/hello" 18 minutes ago
Exited (0) 18 minutes ago optimistic_yonath
[root@ip-172-31-3-249 ~]# docker container start 7beb33f47078
7beb33f47078
[root@ip-172-31-3-249 ~]# ls
[root@ip-172-31-3-249 ~]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
7beb33f47078 ubuntu:16.04 "/bin/bash" 8 minutes ago Up
About a minute frosty_curie
a9e7c385a929 hello-world "/hello" 20 minutes ago
Exited (0) 20 minutes ago optimistic_yonath
[root@ip-172-31-3-249 ~]# docker container attach 7beb33f47078
root@7beb33f47078:/#
root@7beb33f47078:/# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv
sys tmp usr var
root@7beb33f47078:/# cd tmp
root@7beb33f47078:/tmp# mkdir mytestdir
root@7beb33f47078:/tmp# cd mytestdir/
root@7beb33f47078:/tmp/mytestdir# cat myfile.sh
cat: myfile.sh: No such file or directory
root@7beb33f47078:/tmp/mytestdir# cat >myfile.sh
uname -a
hostname
uptime
date
echo "hello world"
:wq!
^[^C
root@7beb33f47078:/tmp/mytestdir# cat myfile.sh
uname -a
hostname
uptime
date
echo "hello world"
:wq!
root@7beb33f47078:/tmp/mytestdir# vi myfile.sh
bash: vi: command not found
root@7beb33f47078:/tmp/mytestdir# chmod a+x myfile.sh
root@7beb33f47078:/tmp/mytestdir# ls
myfile.sh
root@7beb33f47078:/tmp/mytestdir# rm myfile.sh
root@7beb33f47078:/tmp/mytestdir# cat >myfile.sh
hostname
uname -a
uptime
date
^C
root@7beb33f47078:/tmp/mytestdir# chmod a+x myfile.sh
root@7beb33f47078:/tmp/mytestdir# ls
myfile.sh
root@7beb33f47078:/tmp/mytestdir# exit
exit
[root@ip-172-31-3-249 ~]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
7beb33f47078 ubuntu:16.04 "/bin/bash" 17 minutes ago
Exited (0) 11 seconds ago frosty_curie
a9e7c385a929 hello-world "/hello" 29 minutes ago
Exited (0) 29 minutes ago optimistic_yonath
[root@ip-172-31-3-249 ~]# docker container start 7beb33f47078
7beb33f47078
[root@ip-172-31-3-249 ~]# docker container commit 7beb33f47078 new_ubuntu
sha256:49a8b9230b4bb511acd69658761933083f886099a5a1369387e648450a79a03b
[root@ip-172-31-3-249 ~]# docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
7beb33f47078 ubuntu:16.04 "/bin/bash" 19 minutes ago Up
About a minute frosty_curie
a9e7c385a929 hello-world "/hello" 31 minutes ago
Exited (0) 31 minutes ago optimistic_yonath
[root@ip-172-31-3-249 ~]# docker image ls
REPOSITORY TAG IMAGE ID CREATED
SIZE
new_ubuntu latest 49a8b9230b4b 36 seconds ago
119MB
ubuntu 16.04 2a697363a870 4 weeks ago
119MB
hello-world latest fce289e99eb9 5 months ago
1.84kB
[root@ip-172-31-3-249 ~]#

hello-world latest fce289e99eb9 5 months ago


1.84kB
[root@ip-172-31-3-249 ~]# docker container run -it new_ubuntu /bin/bash
root@d2408c29c4ef:/# ls -l
total 4
drwxr-xr-x 2 root root 4096 May 15 14:22 bin
drwxr-xr-x 2 root root 6 Apr 12 2016 boot
drwxr-xr-x 5 root root 360 Jun 13 03:36 dev
drwxr-xr-x 1 root root 66 Jun 13 03:36 etc
drwxr-xr-x 2 root root 6 Apr 12 2016 home
drwxr-xr-x 8 root root 96 Sep 13 2015 lib
drwxr-xr-x 2 root root 34 May 15 14:22 lib64
drwxr-xr-x 2 root root 6 May 15 14:22 media
drwxr-xr-x 2 root root 6 May 15 14:22 mnt
drwxr-xr-x 2 root root 6 May 15 14:22 opt
dr-xr-xr-x 106 root root 0 Jun 13 03:36 proc
drwx------ 1 root root 27 Jun 13 03:19 root
drwxr-xr-x 1 root root 21 May 15 14:22 run
drwxr-xr-x 1 root root 21 May 15 21:21 sbin
drwxr-xr-x 2 root root 6 May 15 14:22 srv
dr-xr-xr-x 13 root root 0 Jun 13 03:36 sys
drwxrwxrwt 1 root root 23 Jun 13 03:25 tmp
drwxr-xr-x 1 root root 18 May 15 14:22 usr
drwxr-xr-x 1 root root 17 May 15 14:22 var
root@d2408c29c4ef:/# cd /tmp
root@d2408c29c4ef:/tmp# ls -lrt
total 0
drwxr-xr-x 2 root root 23 Jun 13 03:30 mytestdir
root@d2408c29c4ef:/tmp#

yum install docker


systemctl status docker
systemctl start docker

You might also like