Code/docker-framework

docker-framework

Ansible role that deploys my preferred docker setup that is accessible and writable by multiple users.

yannick

README

Docker Framework

Creates the /docker base directory with proper ownership and permissions.

Key Parameters

Variable Default Description
docker_framework_base_path /docker Root directory for all Docker Compose services
docker_framework_owner ansible Directory owner
docker_framework_group users Directory group
docker_framework_mode 0775 Directory permissions
docker_framework_sgid true Set SGID bit so new files inherit group ownership

Workflow

  1. Create base directory at configured path
  2. Set ownership and permissions
  3. Apply SGID sticky bit (if enabled)

Troubleshooting

Docker containers not visible without sudo

If docker ps shows nothing but sudo docker ps shows running containers, the user likely has a rootless Docker daemon running alongside the system daemon. Each daemon has its own containers and images.

Symptoms:

  • docker ps -a shows no containers, sudo docker ps -a shows them
  • docker context ls shows a rootless context marked as active (*)
  • docker compose up -d pulls images fresh (even though they exist under the system daemon)

Fix:

# Stop and disable the rootless docker daemon
systemctl --user disable --now docker.service

# Switch to the system docker context
docker context use default

# Remove the rootless context
docker context rm rootless

After this, docker ps will talk to the system daemon where Ansible deploys containers.

Quick Actions

Browse FilesView Commits
git clone https://rakys.xyz/git/docker-framework.git

Repository Statistics

0
Stars
0
Forks
1
Watchers
0
Issues
Default Branch:main
Created:September 3, 2025
Last Updated:March 15, 2026
Repository Size:0.03 KB