Logo

dev-resources.site

for different kinds of informations.

Adventure with Docker: Conflicts with UIDs of the container and the host

Published at
7/16/2017
Categories
docker
glusterfs
elasticsearch
swarm
Author
ophasnoname
Author
11 person written this
ophasnoname
open
Adventure with Docker: Conflicts with UIDs of the container and the host

Docker

There are so days when you deal with problems you would never have expected.
We had the goal to operate an ElasticSearch Cluster in our Docker-Swarm. After some time, a finished image was found which makes this halfway possible (problematic is the discovery of other nodes, just as a hint).

To ensure that all containers in the ElasticSearch Clusters have all the data on the different Docker Swarm Nodes, we use GlusterFS as a distributed file system.

The whole construct was running very well, until we have noticed: Hey NTP is not running on our servers. Ok quickly thrown into the Ansible Playbook and run on the hosts. BAM! The ElasticSearch reports: I do not like you any more dude…

Now, of course, you wonder what happened here? A look at the hosts showed that now all the files of ElasticSearch belong to the user “systemd-timesync” .. eh? The first guess was, of course, the somewhat worn GlusterFS.

The actual error is in principle not an error. If you add a host volume to a container, all the files of the container are created with the user running inside the container. Normally many containers run with the user root, which causes no problems, but ElasticSearch after version 5.x does not run as root…

Now comes the chance in the game, the Image for the ElasticSearch is based on Alpine, here the users begin with the UID 100, unfortunately exactly the UID which has now used by our little friend the “systemd-timesync” user.

Unfortunately, a really good solution was not available for us, but as a Workaround, the Dockerfile was changed, and we assigned the ElasticSearch user a UID 1200+. Now the files are created with this UID.

If you find a more clever solution, I’m looking forward to a comment, and if you prefer this text in german, you can find it at the Geek Pub.

swarm Article's
30 articles in total
Favicon
Knowledgeable Agents with FalkorDB Graph RAG
Favicon
Building Swarm-based agents with AG2
Favicon
Quick tip: Using SingleStore with OpenAI's Swarm
Favicon
OpenAI Swarm: Exploring Lightweight Multi-Agent Orchestration
Favicon
Building an 🐝 OpenAI SWARM 🔍 Web Scraping and Content Analysis Streamlit Web App with 👥 Multi-Agent Systems
Favicon
What’s an AI Agent and what are its current advantages and possible future?
Favicon
Docker Swarm
Favicon
Docker Swarm Series: #7th Advanced Managing config and secret objects
Favicon
Docker Swarm Series: #5th Troubleshooting
Favicon
Docker Swarm Series: #8th Publishing Modes
Favicon
DOCKER SWARM CLUSTER & NFS
Favicon
Docker Swarm Series: #6th Managing config and secret objects
Favicon
Docker Swarm: Simplifying Container Orchestration at Scale
Favicon
Docker Swarm Series: #4th Deploy a Stack to a swarm Cluster
Favicon
Docker Swarm Series: #3rd Deploy a highly available Container
Favicon
Docker Swarm Series: #1st Setup the Environment
Favicon
Docker in small scale production (Docker Swarm)
Favicon
How to export your complete Foursquare checkin history
Favicon
Deploy a high available etcd cluster using docker
Favicon
Time to say goodbye to Docker Swarm
Favicon
Understanding Docker, Docker Compose & Swarm
Favicon
Everything you need to know about Docker Swarm
Favicon
Zero Downtime Deployment with Docker Swarm
Favicon
Workflow on Docker Swarm
Favicon
Free docker cluster mesh with swarm and GCP
Favicon
Traefik v2 with Docker Swarm
Favicon
swarm-cronjob
Favicon
Docker Swarm Concepts, Tips, and Tricks for a Docker Beginner
Favicon
Deploying gitlab on Docker Swarm
Favicon
Adventure with Docker: Conflicts with UIDs of the container and the host

Featured ones: