Alias for commands lets you define your own short easy to remember command shortcuts. Below are some examples of defining command aliases permanently into the different shells like bash, ksh and sh. You can also define aliases on command line, but they will not persist after you change the shell or logout of the shell. […]
DevOps
Introduction to sed (Stream Editor) : Useful sed Command Examples
Introduction to the sed Editor The term sed stands for stream editor. Sed can take its input from standard in, apply the requested edits on the stream, and automatically put the results to standard out. The sed syntax allows for an input file to be specified on the command line. You do not need to […]
Bash for loop Examples
There are many times in a shell script when you want to repeatedly execute a statement or group of statements until some specified condition occurs. In addition, you might want to execute a group of statements for each element in a certain list. The shell provides three looping constructs for these situations: the for, while, […]
How to update/add a file in the Docker Image
The post discusses how to alter a standard docker image pulled from a Public repository in Docker hub as per your need. For the example of this post, we will pull a latest CentOS docker image and add a test directory “test_dir” and create a test file “test_fiel” into it. Adding a directory and image […]
How to Build and push Docker Image to the Docker Hub Repository
The post discusses how to build and push docker images on local docker system to the docker hub repository. For the purpose of this post, we will pull a CentOS image from the public Repository in Docker hub. Later we will run a container using this image and add a new file to the container. […]
How to install Docker on Mac
Installing Docker on Mac is pretty straightforward. It has a Graphical installer .dmg file. The installation provides Docker Engine, Docker CLI client, Docker Compose, Docker Machine, and Kitematic. Pre-requisites for installing Docker on Mac 1. Docker requires OS X El Capitan 10.11 or newer macOS release running on a 2010 or newer Mac. 2. At […]
How to List / Start / Stop / Delete docker Containers
What is a Docker Container A running instance of an image is called a container. Docker launches them using the Docker images as read-only templates. If you start an image, you have a running container of this image. Naturally, you can have many running containers of the same image. We use the command “docker run” […]
How to List / Search / Pull docker images on Linux
What is a Docker Image Docker images are a read-only template which is a base foundation to create a container from. We need an image to start the container. Ther are a lot of pre-built images out there on the docker hub. You can also have your own custom image built with the help of […]
Docker Troubleshooting – “conflict: unable to delete, image is being used by running container”
The problem When you are trying to remove a Docker Image, you get an error as shown below. # docker rmi d123f4e55e12 Error response from daemon: conflict: unable to delete d123f4e55e12 (cannot be forced) – image is being used by running container 0f1262bd1285 For this error to occur, there must be a container on the […]
How to resolve Docker Search Command Error – “getsockopt: no route to host” in CentOS / RHEL / Fedora
The Problem When trying to search docker images under docker repository, returns with error below : # docker search centos Error response from daemon: Get https://index.docker.io/v1/search?q=oracle%2A: dial tcp 52.72.231.247:443: getsockopt: no route to host The docker is engine is running fine. # systemctl status docker ● docker.service – Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; […]