gpt4 book ai didi

git - 无法将 git 存储库部署到 dokku 实例( fatal error : {reponame} does not appear to be a git repository)

转载 作者:太空狗 更新时间:2023-10-29 13:08:31 24 4
gpt4 key购买 nike

我正在尝试将位于我本地 git 存储库中的应用程序部署到我在 digitalocean 上的 dokku 实例。

区域文件

$ORIGIN mydomain.com.
$TTL 1800
...
mydomain.com. 1800 IN A 11.22.33.44
www.mydomain.com. 1800 IN CNAME mydomain.com.
*.mydomain.com. 1800 IN A 11.22.33.44
test.mydomain.com. 1800 IN A 11.22.33.44

我打算在 test.mydomain.com 上部署我的应用程序

dokku 设置

我使用了 digitalocean 上的 dokku 镜像来设置服务器,它目前在 dokku v0.4.15 上运行,并尝试根据 the guide 部署我的应用程序。这显然已经过时了,但是,我没有找到更新的。

ssh 设置

我还设置了 SSH key 和配置文件,因此我可以通过 SSH 为用户 root 登录到我的 dokku 实例dokku:

ssh {用户名}@test.localhome.ch //有效

本地 ssh 配置文件

Host          mydomain.com test.mydomain.com
HostName 11.22.33.44
IdentityFile ~/.ssh/mydomain
PreferredAuthentications publickey

部署

当我尝试部署我的 git 仓库时:

git remote add dokku dokku@test.mydomain.com:test
git push dokku master

它会把我扔出去

fatal: 'test' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我错过了什么?

编辑 1

我还通过 ssh 连接到服务器并添加了 dokku 应用

ssh dokku@mydomain.com
dokku apps:create test

该应用程序似乎已在服务器端正确添加..

dokku@mydomain:~$ dokku apps
=====> My Apps
test

..然而,推送仍然失败。

最佳答案

我无法解决 digitalocean 上的 oneclick dokku-installation 问题,因此我不得不手动设置实例,这并不难。

Dokku 设置

  1. 创建一个新的 Ubuntu 14.04.4 x64 droplet。
  2. 先不要设置 RSA,使用密码验证登录到 Droplet。
  3. 安装 dokku :

    wget https://raw.githubusercontent.com/dokku/dokku/v0.5.2/bootstrap.shsudo DOKKU_TAG=v0.5.2 bash bootstrap.sh

设置RSA

假设我们不使用默认 RSA key (通常是 .ssh/id_rsa.pub),而是使用自定义 key :.ssh/自定义.pub

  1. 使用以下一行代码添加公钥

    猫 ~/.ssh/custom.pub | ssh root@mydomain.com "sudo sshcommand acl-add dokku 自定义标识符"

有关更多信息,请参阅 this page

部署 repo

部署您的存储库,进行快速测试 this example可以使用。此外,需要相应地设置 DNS(如果应用程序名称是 test,则 test.mydomain.com 应该指向您的服务器 IP,如 OP 中所示).

关于git - 无法将 git 存储库部署到 dokku 实例( fatal error : {reponame} does not appear to be a git repository),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36242646/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com