需求自己需要一个git服务，gitlab有点大，小小的树莓派带不动啊。选择一个极简的git服务来管理。这里用docker来安装服务。composer处理基础环境version: '3.6' services: postgres-gogs: container_name: gogs_database image: postgres:9.6 restart: always volumes: - "/mnt/data/gitGogs/postgres:/var/lib/postgresql/data" # 挂载数据库文件目录 environment: POSTGRES_USER: gogs POSTGRES_PASSWORD: yak_gogs POSTGRES_DB: gogs networks: - "net_gogs" gogs: container_name: gogs image: gogs/gogs restart: always ports: - "9822:22" # 暴漏ssh端口 - "9880:3000" # 暴漏web端口 volumes: - "/mnt/data/gitGogs/data:/data" # 挂载数据目录 depends_on: - "postgres-gogs" networks: - "net_gogs" networks: net_gogs:安装访问http://IP:9880首次进入自动跳转安装界面填写对应信息，数据库这里选择postgres,在填写对应的管理员信息。立即安装即可。成果