Search This Blog

Friday, February 23, 2018

How to import and tag an image from docker hub

If you want to craete an image stream and generate tag(latest) from the docker hub image,
you can use this YAML to create the image stream config and later run below command

STep 1 

Run YAML on openshift - -add to project 


//
kind: List  apiVersion: v1  items:    - kind: ImageStream    apiVersion: v1    metadata:      labels:        app: rhel7-weblogic      name: rhel7-weblogic    spec: {}


AFter this you can run this 

oc import-image rhel7-weblogic  --from=dockerusername/rhel7-weblogic --confirm

It will generate the latest tag and bind it to the dockerhub registry , you wont see failed builds in case yo u
have refered this imagestream in any of your other YAML in openshift 

How to Find users on a linux system ?

 cut -d: -f1 /etc/passwd

How to push an images to docker hub ?


$sudo docker images   //  will list the images 

$ docker tag imagename docker.io/<DockerHub user name>/imagename:latest
$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: <Dockerhub user name>
Password:
Login Succeeded
$ docker push docker.io/<DockerHub user name>/imagename:latest

will start pushin 

5cc248435d3e: Pushing [===>                                               ] 47.67 MB/635.9 MB
91f90aafa90e: Pushed
f2da66f301b3: Pushed
31239d164b59: Pushing [==================================================>] 219.1 MB
5f70bf18a086: Pushed
510c99acb643: Pushing [===========>                                       ] 81.45 MB/360 MB
82d954ed02ea: Pushing [==========================>                        ] 104.6 MB/197.2 MB
06a934ef2bcb: Pushing [=================>                                 ] 4.739 MB/13.72 MB



Monday, February 12, 2018

How to generate a public key on windows system

Go to puttygen and generate a ssh-2rsa key 2048 length and generate some randomness and use it
to access linux systems in open labs.

Used it for redhat OpenTLC.

for Private key generate one from actions menu in putty gen and save it in a folder.


Now to connect go to putty.exe -- connections--auth -- browse to private file saved above.

Now go to sessions and connect to you host, it will let you connect the environment.