You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

with-docker.zh-cn.md 1.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---
  2. date: "2016-12-01T16:00:00+02:00"
  3. title: "从Docker安装"
  4. slug: "install-with-docker"
  5. weight: 10
  6. toc: false
  7. draft: false
  8. menu:
  9. sidebar:
  10. parent: "installation"
  11. name: "从Docker安装"
  12. weight: 10
  13. identifier: "install-with-docker"
  14. ---
  15. # 从Docker安装
  16. 阅读本章之前我们已经假设您对docker已经有了解并能够正常使用docker。
  17. {{< toc >}}
  18. 我们在 Docker Hub 的 Gitea 组织中提供了自动更新的 Docker 镜像,它会保持最新的稳定版。你也可以用其它 Docker 服务来更新。首先你需要pull镜像:
  19. ```
  20. docker pull gitea/gitea:latest
  21. ```
  22. 如果要将git和其它数据持久化,你需要创建一个目录来作为数据存储的地方:
  23. ```
  24. sudo mkdir -p /var/lib/gitea
  25. ```
  26. 然后就可以运行 docker 容器了,这很简单。 当然你需要定义端口数数据目录:
  27. ```
  28. docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest
  29. ```
  30. 然后 容器已经运行成功,在浏览器中访问 http://hostname:10080 就可以看到界面了。你可以尝试在上面创建项目,clone操作 `git clone ssh://git@hostname:10022/username/repo.git`.
  31. 注意:目前端口改为非3000时,需要修改配置文件 `LOCAL_ROOT_URL = http://localhost:3000/`。
  32. ## 需要帮助?
  33. 如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}})