Pages

Friday, November 16, 2018

Rkt - Basic Container Using Rkt

Another container technology that is gaining up along with docker is Rocket. A CoreOS Container Runtime built as docker is no locker according to the open standards.   Docker runs with a daemon that manages all components. If the process disappears the containers disappear. Rkt tries to solve these problems.

Download and install the latest rkt rpm using
wget https://github.com/rkt/rkt/releases/download/v1.30.0/rkt-1.30.0-1.x86_64.rpm

Run the ,yum install rkt*

Once installed, Pull a container using rkt command as,
[root@manja17-I13330 ~]# rkt fetch --insecure-options=image docker://jagadesh1982/testing-service
Downloading sha256:74eaa8be722 [=============================] 43.3 MB / 43.3 MB
Downloading sha256:f2b6b4884fc [=============================] 52.6 MB / 52.6 MB
Downloading sha256:bb0bcc8d7f6 [=============================] 14.8 MB / 14.8 MB
Downloading sha256:727d0f4e04b [=============================]     133 B / 133 B
Downloading sha256:4fb899b4df2 [=============================] 19.3 MB / 19.3 MB
Downloading sha256:da74659b918 [=============================] 4.33 MB / 4.33 MB
Downloading sha256:2d6e98fe404 [=============================]   131 MB / 131 MB
Downloading sha256:414666f7554 [=============================] 3.17 MB / 3.17 MB
Downloading sha256:ace2d3087f5 [=============================] 1.78 MB / 1.78 MB
Downloading sha256:17c4133ca61 [=============================]     667 B / 667 B
Downloading sha256:9940cbd4fb3 [=============================]     206 B / 206 B
Downloading sha256:b6477608bbd [=============================]     864 B / 864 B
Downloading sha256:fb20ef6fe17 [=============================] 1.35 MB / 1.35 MB
sha512-d5628ec41849f9c65c8be020921c61a8

Check for the downloaded images using,
[root@manja17-I13330 ~]# rkt image list
ID                                            NAME                               
sha512-d5628ec41849     registry-1.docker.io/jagadesh1982/testing-service:latest

Run a Container as,
[root@manja17-I13330 ~]# 
rkt run sha512-d5628ec41849

In the another command line, check the list of containers running using
[root@manja17-I13330 ~]# rkt list | grep testing-service3e42fb73        
testing-service registry-1.docker.io/jagadesh1982/testing-service:latest        running 3 minutes ago   3 minutes ago default:ip4=172.16.28.6

Access the application using ,
[root@manja17-I13330 ~]# curl 172.16.28.6:9876/info{"host": "172.16.28.6:9876", "version": "0.5.0", "from": "172.16.28.1"}

Enter into the Container using,
[root@manja17-I13330 ~]# rkt enter 3e42fb73 /bin/bash
root@rkt-3e42fb73-ef08-4876-b996-759c7849aa99:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  testing_service.py  tmp  usr  var
root@rkt-3e42fb73-ef08-4876-b996-759c7849aa99:/# exit
Exit


More to Come, Happy Learning :-)

No comments :

Post a Comment