3 C
Texas
Melhttp://www.osradar.com
Guru Unix /Linux and GNU supporter

Install and configure Docker in Suse Entreprise and Openssuse 15

Whats is Docker ? Wikipedia says Docker is a computer program that performs operating-system-level virtualization, also known as “containerization”.  first time released  2013 and is developed by Docker, Inc.

Docker is opensource project to automate deployment of applications using containers. the containers allow the developers to package the applications.  its also designed to deliver the applications faster and with docker you can separate the application from the infrastructure and tread your infra like a managed application

i will try to explain in this tutorial : Install and configure Docker in Suse Entreprise and Openssuse 15

I- Update your System

- Advertisement -
sudo zypper up -y

II-  Install  Docker in Opensuse / Suse Entreprise

you don’t need  any extra packages to install Docker , just with command  install docker

sudo  zypper in docker -y
osradar@linux-b7wo:~> sudo  zypper  in  docker
Building repository 'openSUSE-Leap-15.0-1' cache .................................................................................................................[
Building repository 'openSUSE-Leap-15.0-Non-Oss' cache ...........................................................................................................[
Building repository 'openSUSE-Leap-15.0-Update' cache ............................................................................................................[
Building repository 'openSUSE-Leap-15.0-Update-Non-Oss' cache ....................................................................................................[
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 17 NEW packages are going to be installed:
  catatonit containerd criu docker docker-bash-completion docker-libnetwork docker-runc git-core git-gui gitk libnet9 libpcre2-8-0 libprotobuf-c1 libsha1detectcoll
  perl-Error python2-ipaddr python2-protobuf

Enable and start Docker service:

systemctl enable docker
systemctl start docker

How to user Docker

there is many command to use to manage you Dockers containers

Search Docker images

To find Dockers containers  you can command search .   ( centos/wordpress/ubuntu or others..  )

sudo  docker  search  centos

 

osradar@linux-b7wo:~> sudo docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 5102 [OK]
ansible/centos7-ansible Ansible on Centos7 119 [OK]
jdeathe/centos-ssh CentOS-6 6.10 x86_64 / CentOS-7 7.5.1804 x86… 105 [OK]
consol/centos-xfce-vnc Centos container with "headless" VNC session… 75 [OK]
imagine10255/centos6-lnmp-php56 centos6-lnmp-php56 48 [OK]
centos/mysql-57-centos7 MySQL 5.7 SQL database server 45
tutum/centos Simple CentOS docker image with SSH access 43
openshift/base-centos7 A Centos7 derived base image for Source-To-I… 39
gluster/gluster-centos Official GlusterFS Image [ CentOS-7 + Glust… 38 [OK]
centos/postgresql-96-centos7 PostgreSQL is an advanced Object-Relational … 36
centos/python-35-centos7 Platform for building and running Python 3.5… 33
kinogmt/centos-ssh CentOS with SSH 25 [OK]
openshift/jenkins-2-centos7 A Centos7 based Jenkins v2.x image for use w… 20
centos/php-56-centos7 Platform for building and running PHP 5.6 ap… 18
pivotaldata/centos-gpdb-dev CentOS image for GPDB development. Tag names… 10
openshift/wildfly-101-centos7 A Centos7 based WildFly v10.1 image for use … 6
openshift/jenkins-1-centos7 DEPRECATED: A Centos7 based Jenkins v1.x ima… 4

Download  latest  Centos container

sudo docker pull centos
osradar@linux-b7wo:~> sudo docker pull centos
Using default tag: latest
latest: Pulling from library/centos
a02a4930cb5d: Downloading [=============================================> ] 68.79MB/75.17MB

 

check if the images is correctly downloaded

sudo docker images

osradar@linux-b7wo:~> sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos latest 1e1148e4cc2c 5 weeks ago 202MB
osradar@linux-b7wo:~>

Lunch the container with the Centos image

osradar@linux-b7wo:~> sudo docker run -i -t centos /bin/bash

[root@3b9d430166e8 /]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@3b9d430166e8 /]#

 

to Exit and keep  the container running,  use the command CTRL  +P + Q

List The containers with command  docker ps

osradar@linux-b7wo:~> sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
81369fe86348 centos "/bin/bash" 2 minutes ago Up 2 minutes zealous_mayer

How to Start/Stop/ and Attach Container
You can start, stop or attach  any container with following commands.

First List the containers

sudo docker ps

To start container use  next command.

docker start <CONTAINER_ID>

To stop container do

docker stop <CONTAINER_ID>

To attach to currently running container  do

docker attach <CONTAINER_ID>

example of  attaching my Archlinux Contianer

osradar@linux-b7wo:~> sudo docker attach 15770de227ce
[root@15770de227ce /]# uname -a
Linux 15770de227ce 4.12.14-lp150.11-default #1 SMP Fri May 11 08:28:30 UTC 2018 (a9fee09) x86_64 GNU/Linux
[root@15770de227ce /]#

 

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article