docker swarm stack file Explained – Advanced Level

Docker swarm is a docker orchestration tool that comes along with docker engine when helps to manage multiple Docker containers across multiple hosts that are joined to the cluster. Docker Swarm enables high availability for docker containers by increasing the replicas for a particular service. let’s break the above docker-swarm stack file into smaller pieces In some cases, you might need to add a local DNS entry for your container when the hostname is not publically available. The above entry creates an entry in /etc/hosts file of docker container show…

Read More

docker swarm stack file Explained – Beginner Level

Docker swarm is a docker orchestration tool that comes along with docker engine when helps to manage multiple Docker containers across multiple hosts that are joined to the cluster. Docker Swarm enables high availability for docker containers by increasing the replicas for a particular service. if you don’t know what is the difference between docker-compose file vs docker stack check out this article. docker-compose and docker stack In this article, we are trying to explain about docker swarm stack file. We are splitting this article into two levels one is…

Read More

Build and run docker containers using docker-compose

Docker-compose is an official tool by docker to manage and deploy multi-container applications. Docker-compose uses a YAML file where application services are defined. If you have any confusion between docker-compose and docker stack check out this link. Using the docker-compose file you can build docker images and run the docker containers in a single step. Here we will show you how to do this using a sample nodejs application Check this link to docker-compose installation guide How to install docker-compose in Linux Step 1: Create a folder for your application Step…

Read More

How to install docker-compose in Linux

Docker-compose is an official tool by docker to manage and deploy multi-container applications. Docker-compose uses a YAML file where application services are defined. If you have any confusion between docker-compose and docker stack check out this link. Installation Step 1: Download the docker-compose for your operating system. Step 2: Change the ownership of the downloaded file. This enabled executable permission Step 3: Check the docker-compose version Troubleshooting if the docker-compose command fails, create a symbolic link to the bin folder. sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose © 2020, Techrunnr. All rights…

Read More

how to push docker container logs to elk stack

Hi All, This document shows you how to push docker container logs to elk stack. ELK is Elasticsearch, Logstash, and Kibana. ELK is a log analysis platform where users can analyze, visualize, and search. when a docker container runs there are some logs are generated based on the application which runs in the container. These logs can be viewed using docker logs <continer-ID>. you can see the logs of the container using the docker service logs service name if containers are deployed using docker service. docker logs <containerID> shows the…

Read More

docker-compose and docker stack

Docker is a platform that depends on the operating system in applications that are packaged and deployed as containers. By using docker, the applications which designed in a way of microservices architecture deployments became very easy and scalable compared to the monolithic architecture. Most of the people who are new to docker have confusion what is the difference between docker-compose and docker stack. Let’s look into the difference from each search  Installation Docker-compose is an official tool by docker which can be used to manage and build a docker image…

Read More

how to use a docker secret for keycloak applications using a docker swarm

docker data dir change

Hi All, this document shows you how to use a docker secret for keycloak applications using a docker swarm. Docker secret enables you to hide sensitive data such as usernames and passwords from the docker environment variables. Docker secret works only in swarm mode. Docker swarm converts the secrets variable to environmental variables internally for the containers. /run/secrets is the default storage location of docker secrets and these secrets are unencrypted inside the container(/run/secrets/<secret_name>). Steps 1. create a docker secret for DB user password and keycloak admin user.   2.…

Read More

how to copy a file from container to host machine

docker data dir change

Hi All, this document deals with how to copy a file from container to host machine. Docker is a set of the platform as service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels. You can copy a file from the host machine to the container by performing the below command, Get the container ID first. copy the container ID and execute the…

Read More

Keycloak cluster using docker swarm

Hi All, this document deals with how to set up a keycloak cluster using a docker swarm. Keycloak is an open-source software product to allow single sign-on with Identity Management and Access Management aimed at modern applications and services. As of March 2018, this JBoss community project is under the stewardship of Red Hat who uses it as the upstream project for their RH-SSO product. Prerequisites Docker swarm Mysql/MariaDB database setup for keycloak applications. docker compose Setup You can build your keycloak application from the below Dockerfile.     Before…

Read More