• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Docker

How to Disable Docker Process and docker0 Interface on CentOS/RHEL

By admin

When the docker packages are installed, the services and related docker0 network interface are enabled. In some cases, you may want to disable the docker service and the docker0 network interface as well. This post details how to disable Docker and the docker0 interface if it is not required or if the docker0 interface is conflicting with other network interfaces/routes. 1. Ensure the Docker service is stopped: # service docker stop # for CentOS/RHEL 6 # systemctl stop docker # … [Read more...] about How to Disable Docker Process and docker0 Interface on CentOS/RHEL

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, CentOS/RHEL 8, DevOps, Docker, Linux

How to add new host entry in /etc/hosts when a docker container is run

By admin

This post shows how to add host-entries onto /etc/hosts on docker container when it is run. For the purpose of this post, we are using CentOS/RHEL 7 host. But this should work on any Linux host capable of running latest docker versions. Generally speaking, /etc/hosts file can not be modified before running the docker container. However, current docker has an option "--add-host" which adds host-entries onto /etc/hosts when the container is run. Below is the syntax to add host entry while … [Read more...] about How to add new host entry in /etc/hosts when a docker container is run

Filed Under: DevOps, Docker

How to Access Docker Container’s Network Namespace from Host

By admin

This post is to illustrate how to access the docker container's network namespace. 1. Identify the docker container id you want to access and run below command as root on host. # docker ps 2. Get docker container's PID: # pid=$(docker inspect -f '{{.State.Pid}}' ${container_id}) 3. Create netns directory: # mkdir -p /var/run/netns/ 4. Create the name space softlink: # ln -sfT /proc/$pid/ns/net /var/run/netns/[container_id] 5. Run ip netns command to access this name … [Read more...] about How to Access Docker Container’s Network Namespace from Host

Filed Under: DevOps, Docker

How To Change The Time Zone For A Docker Container

By admin

The goal of this post is to set up the timezone on the container to match the same timezone on the Docker server, this will allow users to see the same time in both instances (Docker Server and Container). Most of the time Containers do not use the same time as the Docker server, this post will show how to configure this. This is how this looks like before making the changes. Container Time: # docker exec 15c0c99b5c65 date Wed Aug 23 15:40:24 UTC 2019 Docker Server Time: # date Wed … [Read more...] about How To Change The Time Zone For A Docker Container

Filed Under: DevOps, Docker

“docker dead but subsys locked” – error while starting docker

By admin

The Problem The docker engine package was upgraded. After that the user is not able to start the docker service, and revert back with error "docker dead but subsys locked" on verifying the status of the service. Under normal circumstances, the general solution would be to remove the lock file and the dead files of the service. This is not applicable in this condition. # rm /var/run/docker/execdriver/native/ # rm /var/lock/subsys/docker # docker info Cannot connect to the Docker daemon. Is … [Read more...] about “docker dead but subsys locked” – error while starting docker

Filed Under: DevOps, Docker, Linux

How to check the status and space used by images and containers

By admin

This post objective is to find out the stats of running container, system information related to space used by images and containers on /var/lib/docker. 1. 'docker stats' command used to check the containers stats on system like CPU usage, IO usage, Memory usage. Below example is for 2 running containers dockerweb and webserver2. # docker stats dockerweb webserver2 CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS e33f00e0e3ce dockerweb … [Read more...] about How to check the status and space used by images and containers

Filed Under: DevOps, Docker

How to backup and restore Docker containers

By admin

The post outlines the steps to take the backup (snapshot) of docker Container and restore it. Please note that this post mainly discusses committing a container as an image. This works on the container that does not use data volume. For containers with data volume, backup of the data volume must be taken separately. Taking backup of Docker Container 1. Commit the required container as an image # docker commit -p [container-id] backup01 sha256:89682d4xxxxxx Now a new image backup01 will … [Read more...] about How to backup and restore Docker containers

Filed Under: DevOps, Docker

Run Docker as a non-root user

By admin

The Docker containers by default run with the root privilege and so does the application that runs inside the container. This is another major concern from the security perspective because hackers can gain root access to the Docker host by hacking the application running inside the container. Method 1 - Add user to Docker group 1. To run Docker as a non-root user, you have to add your user to the docker group. 2. Create a docker group if there isn't one: $ sudo groupadd docker 3. Add … [Read more...] about Run Docker as a non-root user

Filed Under: DevOps, Docker

How to Configure Btrfs as the Storage Engine in Docker

By admin

Docker is an open platform management tool for Linux Containers. It provides a means for developers and system administrators to build and package applications into lightweight containers. Docker uses devicemapper devices as the default storage engine. To use Btrfs as the storage engine, perform the following steps. Note that Red Hat Enterprise Linux (RHEL) removes the Btrfs storage driver from their build of Docker, both on the Extra Packages for Enterprise Linux (EPEL) repository and the … [Read more...] about How to Configure Btrfs as the Storage Engine in Docker

Filed Under: DevOps, Docker

How to create Docker Image from a Container and Dockerfile

By admin

Docker is an open platform management tool for Linux Containers. It provides a means for developers and system administrators to build and package applications into lightweight containers. Docker consists of the following components: Docker Engine – A portable, lightweight runtime and packaging tool Docker Hub – A cloud service for sharing applications and automating workflows Docker is used to create image-based application containers. Image-based containers package an application with … [Read more...] about How to create Docker Image from a Container and Dockerfile

Filed Under: DevOps, Docker

« Previous Page
Next Page »

Primary Sidebar

Recent Posts

  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Basics of client connectivity in Oracle Data Guard configuration
  • ORA-354 ORA-353 and ORA-312: Possible corruption in Online Redo Log File Members in a Redo Log Group
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary