6

I'm trying to deploy my application which is located on my local git repo to my dokku instance on digitalocean.

Zone file

$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

I intend to deploy my app on test.mydomain.com

dokku setup

I used the dokku image on digitalocean to setup the server, which currently runns on dokku v0.4.15, and tried to deploy my app according to the guide which is obviousely obsolete, however, I didn't find a more recent one.

ssh setup

I also set up the SSH keys and config file, so I'm able to log in to my dokku instance over SSH for both users root and dokku:

ssh {username}@test.localhome.ch // works

local ssh config file

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

deployment

When I try to deploy my git repo:

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

it would throw me

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.

What did I miss?

Edit 1

I also ssh'ed into the server and added the dokku app

ssh dokku@mydomain.com
dokku apps:create test

The app seems to have been added correctly server-side..

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

.. however, the push is still failing.

Ronin
  • 7,322
  • 6
  • 36
  • 54

1 Answers1

9

I wasn't able to solve the problem for the oneclick dokku-installation on digitalocean, so instead, I had to setup the instance manually, which wasn't that hard.

Dokku setup

  1. Create a new Ubuntu 14.04.4 x64 droplet.
  2. Don't setup the RSA yet, use password authentication to login to the droplet.
  3. Install dokku:

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

Setup RSA

Assumption: We don't use the default RSA key (usually .ssh/id_rsa.pub), but instead a custom one: .ssh/custom.pub

  1. add the public key using the following one-liner

    cat ~/.ssh/custom.pub | ssh root@mydomain.com "sudo sshcommand acl-add dokku custom-identifier"

For more information please refer to this page

Deploy repo

Deploy your repo, for a quick test this example can be used. Also, the DNS need to be setup accordingly (if the apps name is test, then test.mydomain.com should point to your servers IP, as also shown in the OP).

Sevle
  • 3,109
  • 2
  • 19
  • 31
Ronin
  • 7,322
  • 6
  • 36
  • 54
  • 1
    I had manually added my public key to `authorized_hosts` before going through the setup and that screwed things up. I used your comments as a hint and was able to remove the one that was initially. Now it is running through the custom command as intended. Thanks! – jocull May 17 '16 at 21:45
  • Just making note: I had this occur recently with Dokku 0.7.2 on 16.04 – TheUnknownGeek Jan 27 '17 at 16:21