Getting started with docker installation and basic use of RHEL 7

Keywords: Docker CentOS ssh jenkins

RHEL 7 installation using docker

I. Introduction

Docker is an open source application container engine, which allows developers to package their applications and dependency packages into a portable container, and then publish them to any popular Linux machine, or realize virtualization. Containers are completely sandboxed and have no interface with each other.

Two, installation

Docker requires the kernel version of CentOS system to be higher than 3.10. Check the prerequisites on this page to verify whether your CentOS version supports docker.

View your current kernel version through the uname -r command

[root@localhost ~]# uname -r
3.10.0-693.el7.x86_64

yum update -y

yum -y install docker

After docker is installed successfully

Start docker service: systemctl start docker

Check whether the startup is successful: systemctl status docker

3, pull image

1. docker search centos - searches for images named centos

[root@localhost ~]# docker search centos
INDEX       NAME                                         DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/centos                             The official build of CentOS.                   4756      [OK]       
docker.io   docker.io/ansible/centos7-ansible            Ansible on Centos7                              118                  [OK]
docker.io   docker.io/jdeathe/centos-ssh                 CentOS-6 6.10 x86_64 / CentOS-7 7.5.1804 x...   99                   [OK]
docker.io   docker.io/consol/centos-xfce-vnc             Centos container with "headless" VNC sessi...   63                   [OK]
docker.io   docker.io/imagine10255/centos6-lnmp-php56    centos6-lnmp-php56                              45                   [OK]
docker.io   docker.io/tutum/centos                       Simple CentOS docker image with SSH access      43                   
docker.io   docker.io/centos/mysql-57-centos7            MySQL 5.7 SQL database server                   39                   
docker.io   docker.io/gluster/gluster-centos             Official GlusterFS Image [ CentOS-7 +  Glu...   34                   [OK]
docker.io   docker.io/openshift/base-centos7             A Centos7 derived base image for Source-To...   33                   
docker.io   docker.io/centos/python-35-centos7           Platform for building and running Python 3...   31                   
docker.io   docker.io/centos/postgresql-96-centos7       PostgreSQL is an advanced Object-Relationa...   29                   
docker.io   docker.io/kinogmt/centos-ssh                 CentOS with SSH                                 22                   [OK]
docker.io   docker.io/openshift/jenkins-2-centos7        A Centos7 based Jenkins v2.x image for use...   15                   
docker.io   docker.io/pivotaldata/centos-gpdb-dev        CentOS image for GPDB development. Tag nam...   7                    
docker.io   docker.io/openshift/wildfly-101-centos7      A Centos7 based WildFly v10.1 image for us...   5                    
docker.io   docker.io/openshift/jenkins-1-centos7        DEPRECATED: A Centos7 based Jenkins v1.x i...   4                    
docker.io   docker.io/darksheer/centos                   Base Centos Image -- Updated hourly             3                    [OK]
docker.io   docker.io/pivotaldata/centos                 Base centos, freshened up a little with a ...   2                    
docker.io   docker.io/pivotaldata/centos-mingw           Using the mingw toolchain to cross-compile...   2                    
docker.io   docker.io/blacklabelops/centos               CentOS Base Image! Built and Updates Daily!     1                    [OK]
docker.io   docker.io/jameseckersall/sonarr-centos       Sonarr on CentOS 7                              0                    [OK]

2. docker pull docker.io/centos ා use pull to download the image. The first is the official image

3. docker run docker.io/centos echo "hello docker" test

 

 

Posted by Mohit_Prog on Mon, 23 Dec 2019 12:40:24 -0800