Author: Sahil Suri

Docker: Running your first container!

Introduction In our last post, we explained how to install docker on a Centos 7 system. In this post, we will demonstrate how to launch and run our first container named hello-world. Before we launch our container let’s verify the version of Docker installed on the system and ensure that the docker container engine service is started. [sahil@linuxnix ~]$ docker version Client: Version: 18.09.7 API version: 1.39 Go version: go1.10.8 Git commit: 2d0083d Built: Thu Jun 27 17:56:06 2019 OS/Arch: linux/amd64 Experimental: false Server: Docker Engine - Community Engine: Version: 18.09.7 API version: 1.39 (minimum version 1.12) Go version: go1.10.8 Git commit: 2d0083d Built: Thu Jun 27 17:26:28 2019 OS/Arch: linux/amd64 Experimental: false [sahil@linuxnix ~]$ [sahil@linuxnix ~]$ sudo systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. [sahil@linuxnix ~]$ sudo systemctl start docker [sahil@linuxnix ~]$ [sahil@linuxnix ~]$ sudo systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: active (running) since Sun 2019-07-07 16:15:42 UTC; 6s ago Docs: https://docs.docker.com Main PID: 8756 (dockerd) Tasks: 8 Memory: 32.1M CGroup: /system.slice/docker.service └─8756 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock Jul 07 16:15:42 linuxnix dockerd[8756]: time="2019-07-07T16:15:42.169081427Z" level=info msg="Successfully created filesystem xfs on device doc...icemapper Jul 07 16:15:42 linuxnix dockerd[8756]: time="2019-07-07T16:15:42.196379146Z" level=warning msg="[graphdriver] WARNING: the devicemapper storag... release" Jul 07 16:15:42 linuxnix dockerd[8756]: time="2019-07-07T16:15:42.235077254Z" level=info msg="Graph migration to content-addressability took 0.00 seconds" Jul 07 16:15:42 linuxnix dockerd[8756]: time="2019-07-07T16:15:42.236148156Z"...

Read More

Docker introduction and installation on Centos 7

Introduction In this article, we’ll demonstrate how to install Docker on a Centos 7 system. But before we get to that let’s briefly understand what Docker actually is? Docker is a containerization engine and platform that encapsulates application code along with all of its dependencies into a docker container. The docker engine allows containerized applications to run seamlessly irrespective of the underlying operating system (the exception being you can’t run Windows containers on Linux operating systems yet). The concept of containers allows users to provide the same environment to the application in dev, stage and production thereby greatly improving developer productivity and accelerating the application deployment life cycle. We’ll be covering many different aspects of the docker containerization platform like docker hub, docker images, networking, and storage.   Check pre-requisites: We’ll be installing Docker on a Centos 7 machine and docker has a couple of dependencies which we’ll need to check before we may proceed with the install itself. [sahil@linuxnix ~]$ cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [sahil@linuxnix ~]$ [sahil@linuxnix ~]$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile epel/x86_64/metalink | 18 kB 00:00:00 * base: mirror.aktkn.sg * epel: d2lzkl7pfhq30w.cloudfront.net * extras: mirror.aktkn.sg * nux-dextop: mirror.li.nux.ro * updates: mirror.aktkn.sg base | 3.6 kB 00:00:00 epel | 5.3 kB 00:00:00 extras | 3.4 kB 00:00:00 nux-dextop | 2.9 kB 00:00:00 puppet6...

Read More

Here documents in bash explained

Introduction Input/output redirection is an extremely important aspect of writing bash shell scripts and working with the bash shell command line interface in general. A here document is a form of I/O redirection that tells the bash shell to read input from the current source until a line containing only the delimiter is seen. This delimiter is known as the limit string.  The limit string is preceded by the symbol << followed by the input commands or lines that we wish to redirect. We type the limit string again once we are done writing the input statements/commands that are to be redirected to indicate the end of the here document. The effect of enclosing a set of commands is that is redirects the output of the command block into the stdin of the program or command to which the stdin is directed to. Given below is the syntax for creating and using a here document: Command <<MyUniqueLimitString some text some more text MyUniqueLimitString In the above statements, the string MyUniqueLimitString serves as the limit string for the here document. Note: There should not be any space between the << symbol and the limit string. If there are any characters between the limit string and the << symbol then the here document is unlikely to work. Also the limit string that terminates the here document should not have any space...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.