Deploying to dokku (repo does not exist)

匆匆过客 提交于 2021-02-08 06:36:39

问题


Hi I've been having trouble with dokku and basically it boils down to this:

git remote add dokku jasonh@app.com:ruby-getting-started

and then I get:

git push dokku master
jasonh@app.app.com's password:
fatal: 'ruby-getting-started' 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.

dokku ssh-keys:list - had my SSH key included. (created in Dokku and added to github)

dokku apps:create appname 

seemed to create the app

    git remote -v returns dokku jasonh@app.app.com:ruby-getting-started (fetch)
dokku   jasonh@app.app.com:ruby-getting-started (push)
origin  git@github.com:myuser/ruby-getting-started.git (fetch)
origin  git@github.com:myuser/ruby-getting-started.git (push)

Seemed to create the app since its in the list. so what am i missing?

update ssh'd into my instance and added this

cat ~/.ssh/id_rsa.pub| sudo sshcommand acl-add dokku Jason_Laptop
[sudo] password for jasonh:
SHA256:*******************

update

cat ~/.ssh/public_dokku.pub - then copied the contents to my dokku RSA file.

output of the command is the same cat ~/.ssh/id_rsa.pub (cept i named my file dokku rsa or something)

Here is my git remote -v

dokku   jasonh@app.app.com:sameappnameaswhatIcreated

Listing SSH brings this key (and others) which i can verify as the name i picked.

SHA256:*********** NAME="Jason_Harder" SSHCOMMAND_ALLOWED_KEYS="no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding"

My config file in ~./ssh since my main ssh is for github. Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/public_dokku

Update:

My remote was improperly added originally as git add remote jason@app.com or w.e when it should have been dokku@app.com.


回答1:


Following the dokku deployment guide, check first your ssh connection.

The fact you see jasonh@app.app.com's password: means SSH does not find your public key in dokku remote server, and falls back to the account password.
Add it, as explained here.

That is:

cd ~/.ssh
ssh-keygen -t rsa -m PEM -P "" -f dokku

# copy dokku.pub to jasonh@app.app.com:~/.ssh/authorized_keys
# make sure it is copied as one line.

# edit your local ~/.ssh/config file
# add to it:

Host dokku
  Hostname app.app.com
  User jasonh
  IdentityFile ~/.ssh/dokku

Check this is working with ssh -v dokku

You can then change your remote URL to:

git remote set-url dokku dokku:sameappnameaswhatIcreated


来源:https://stackoverflow.com/questions/59450552/deploying-to-dokku-repo-does-not-exist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!