Logo

Personal Ops Runbook

Personal runbook covering infrastructure operations for Cloud, Kubernetes, OpenStack, and Ceph environments. Includes deployment and teardown procedures, node management, cluster monitoring setup, and incident response workflows compiled from day-to-day operational work. Intended strictly for personal reference — configurations and scripts are environment-specific and not guaranteed to work as-is elsewhere.

Fix lỗi dial unix /var/run/docker.sock: connect: permission denied


Khi bạn mount docker từ máy host vào container để có thể sử dụng tính năng docker trong chính container đó thì có thể khi bạn chạy lệnh docker sẽ xuất hiện lỗi như dưới

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

Hoặc

dial unix /var/run/docker.sock: connect: permission denied.

Để khắc phục lỗi này, bạn ra máy host và phân quyền 666 cho /var/run/docker.sock nhé

chmod 666 /var/run/docker.sock

Chúc bạn thành công.