Skip to content

[Bug] Incorrect Docker container configuration for Homepage #13514

Description

@Anonymous6214

Contact Information

No response

1Panel Version

v2.1.13

Problem Description

當使用預設版homepage compose檔案時, 會因為權限問題讓程序無法調用/var/run/docker.sock
以下為程序log報錯:

[2026-08-08T20:24:06.588Z] error: <service-helpers> Error getting services from Docker server 'docker': Error: connect EACCES /var/run/docker.sock
    at ignore-listed frames {
  errno: -13,
  code: 'EACCES',
  syscall: 'connect',
  address: '/var/run/docker.sock'
}

解決方式為移除compose中puid及pgid欄位, 並且將docker.sock改為唯獨確保宿主機安全性

原版:

networks:
    1panel-network:
        external: true
services:
    homepage:
        container_name: ${CONTAINER_NAME}
        deploy:
            resources:
                limits:
                    cpus: ${CPUS}
                    memory: ${MEMORY_LIMIT}
        environment:
            - PUID=1000
            - PGID=1000
            - HOMEPAGE_ALLOWED_HOSTS=${HOMEPAGE_ALLOWED_HOSTS}
            - TZ=${TIME_ZONE}
        image: ghcr.io/gethomepage/homepage:v1.13.2
        labels:
            createdBy: Apps
        networks:
            - 1panel-network
        ports:
            - ${HOST_IP}:${PANEL_APP_PORT_HTTP}:3000
        restart: always
        volumes:
            - ./config:/app/config
            - /var/run/docker.sock:/var/run/docker.sock

調整過後:

networks:
    1panel-network:
        external: true
services:
    homepage:
        container_name: ${CONTAINER_NAME}
        deploy:
            resources:
                limits:
                    cpus: ${CPUS}
                    memory: ${MEMORY_LIMIT}
        environment:
            - HOMEPAGE_ALLOWED_HOSTS=${HOMEPAGE_ALLOWED_HOSTS}
            - TZ=${TIME_ZONE}
        image: ghcr.io/gethomepage/homepage:v1.13.2
        labels:
            createdBy: Apps
        networks:
            - 1panel-network
        ports:
            - ${HOST_IP}:${PANEL_APP_PORT_HTTP}:3000
        restart: always
        volumes:
            - ./config:/app/config
            - /var/run/docker.sock:/var/run/docker.sock:ro

Steps to Reproduce

docker.yaml裡設定為使用sock連接

docker:
  socket: /var/run/docker.sock

在widget.yaml中使用docker連接顯示容器狀態

- services:
    - nginx-proxy-manager:
        icon: nginx-proxy-manager.png
        href: http://debian.home.local:81
        server: docker
        container: 1Panel-nginx-proxy-manager-CvJA

widget右上角會顯示unknown
Image

The expected correct result

widget右上角會顯示running並且會有docker容器狀態
Image

Related log output

Additional Information

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions