Skip to content

gitea 容器内存放的数据在哪? #311

Closed

Description

@liminngs

gitea 容器内存放的数据在哪?

Activity

  1. Rader commented on Jul 17, 2024

    @Rader
    Collaborator

    默认是在docker compose启动服务的当前目录下。如果不确定的话,可以通过 docker inspect 查看 gitea对应container 的 Mounts 信息,例如:

            "Mounts": [
                {
                    "Type": "bind",
                    "Source": "/Users/leida/projects/opencsg/csghub-server/local_only/gitea",
                    "Destination": "/bitnami/gitea",
                    "Mode": "rw",
                    "RW": true,
                    "Propagation": "rprivate"
                }
            ],
    
  2. liminngs commented on Jul 17, 2024

    @liminngs
    Author

    默认是在docker compose启动服务的当前目录下。如果不确定的话,可以通过 docker inspect 查看 gitea对应container 的 Mounts 信息,例如:

            "Mounts": [
                {
                    "Type": "bind",
                    "Source": "/Users/leida/projects/opencsg/csghub-server/local_only/gitea",
                    "Destination": "/bitnami/gitea",
                    "Mode": "rw",
                    "RW": true,
                    "Propagation": "rprivate"
                }
            ],
    

    "Mounts": [],
    没有挂着信息 该存容器内哪个目录下进挂载?

  3. Rader commented on Jul 17, 2024

    @Rader
    Collaborator

    docker-compose 文件应该有挂载。您不是通过 docker compose启动的吗?

        volumes:
          - ./gitea:/bitnami/gitea
        networks:
    
  4. wayneliu0019 commented on Jul 22, 2024

    @wayneliu0019
    Collaborator

    补充:

    如果您是通过https://github.com/OpenCSGs/CSGHub/blob/main/all-in-one-CN.yml 这里的all in one脚本部署启动的,那么gitea服务是没有把数据目录挂载到宿主机磁盘的,因为这种方式是fast try,没有做持久化,数据,配置都保存在容器内,重启后就会丢失;

    使用https://github.com/OpenCSGs/CSGHub/tree/main/script/all_in_one 这个目录下的docker-compose.ym启动的csghub服务可以作为准生产环境使用,是做了持久化的,如下

    .....
        networks:
          - opencsg
        privileged: true
        restart: always
        volumes:
          - ./gitdata:/bitnami/gitea
          - ./gitlog:/bitnami/logs
    

    可以看到gitea数据目录是保存在宿主机上的,这些主要是repo数据,其他数据比如gitea用户,key,权限等信息是保存在db中的。

  5. locked and limited conversation to collaborators on Sep 14, 2024
  6. converted this issue into a discussion #624 on Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions