AIoT.IO.VN
AIoT.IO.VN
🌐 SONG NGỮ

Chạy Dashy dashboard bằng Docker

Ng Nghia Phan • • ⚡ 2 phút đọc • -- lượt xem • --
VI EN
MỤC LỤC BÀI VIẾT (Nhấn để xem)

Dashy là dashboard cá nhân self-hosted có status checking, widget, theme, icon pack và UI editor. Bài này dùng image lissy93/dashy:latest, bind thư mục user-data và cho truy cập ở cổng 8080.1

Cài Docker

Đăng nhập Linux Docker host và chạy:

# install prerequisites
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y
# add docker gpg key
curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
# add docker software repository
sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
# install docker
sudo apt install docker-ce docker-compose containerd.io -y
# enable and start docker service
sudo systemctl enable docker && sudo systemctl start docker
# add the current user to the docker group
sudo usermod -aG docker $USER
# reauthenticate for the new group membership to take effect
su - $USER

Nếu distro mới không còn phù hợp với apt-key, hãy đổi sang Docker docs hiện hành thay vì bỏ qua cảnh báo.1

Chạy Dashy

  1. Tạo thư mục, tải file cấu hình mẫu, đặt quyền và chạy container:
# create working directories
mkdir ~/docker/dashy -p
# download default conf.yml
wget -O ~/docker/dashy/conf.yml https://raw.githubusercontent.com/Lissy93/dashy/refs/heads/master/user-data/conf.yml
# set owner of working directories
sudo chown "$USER":"$USER" ~/docker -R
# allow the container to write to working directories
sudo chmod a+rwx -R ~/docker/dashy
# run the dashy docker image
docker run -d --name dashy -p 8080:8080 -v ~/docker/dashy:/app/user-data --restart=unless-stopped lissy93/dashy:latest
  1. Mở http://DNSorIP:8080.
  2. Kiểm tra trang Welcome của Dashy và sửa ~/docker/dashy/conf.yml từ host khi cần.1

Backup và giới hạn

Backup ~/docker/dashy/conf.yml và toàn bộ ~/docker/dashy trước khi cập nhật image. chmod a+rwx trong quy trình nguồn thuận tiện cho container nhưng rộng; trong HomeLab production, mình sẽ thu hẹp owner/group sau khi xác nhận UID/GID image. Không đưa token API của widget vào bài hoặc repository.1

Nguồn và video

  • Tutorial gốc: i12bretro 0992
  • Video gốc: Run Dashy Application Dashboard in Docker

Nguồn


  1. https://i12bretro.github.io/tutorials/0992.html — Run Dashy Application Dashboard in Docker (i12bretro) ↩︎ ↩︎ ↩︎ ↩︎

Bình luận & Thảo luận 0

Chia sẻ thắc mắc, phản hồi hoặc kinh nghiệm thực chiến của bạn