Deploying Dokku on EC2, initial git push failing

391 views Asked by At

I am trying to deploy Dokku 0.10.4 on EC2 (ubuntu) and I'm not succeeding (I'm using a Mac). I followed all the installation steps in the manual but no joy

Basically, I get a Permission Denied when I git push myclient_ec2 master

My setup is as follows:

ssh/config

Host myclient_ssh
   Hostname example.com
   User ubuntu
   IdentityFile ~/.ssh/AWS_ID.pem

.git/config

[remote "myclient_ec2"]
    url = [email protected]:myapp
    fetch = +refs/heads/*:refs/remotes/dokku/*

The installation sequence was as follows

ssh -i ~/.ssh/AWS_ID.pem [email protected] wget https://raw.githubusercontent.com/dokku/dokku/v0.10.4/bootstrap.sh
ssh -i ~/.ssh/AWS_ID.pem [email protected] sudo DOKKU_TAG=v0.10.4 bash bootstrap.sh
ssh -i ~/.ssh/AWS_ID.pem [email protected] rm bootstrap.sh*

ssh -i ~/.ssh/AWS_ID.pem [email protected] apps:create myapp
git remote add myclient_ec2 [email protected]:myapp
cat ~/.ssh/AWS_ID.pem | ssh myclient_ssh "sudo sshcommand acl-add dokku [description]"

Also tried changin to

.git/config

[remote "myclient_ec2"]
    url = dokku@myclient_ssh:myapp
    fetch = +refs/heads/*:refs/remotes/dokku/*

git push myclient_ec2 master

to no avail

1

There are 1 answers

0
Marc On BEST ANSWER

The problem was that I expected dokku installation to use the public key from my Amazon account for setting up the git repository. That isn't possible or didn't work. In any case, setting my public ~/.ssh/id_rsa.pub key for the dokku git solved the issue. The following command does that

ssh - i ~/.ssh/AWS.pem ubuntu@ec_ip
echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGsp3HJnOqJ9BuHkQ5Myt2z3LEKQC_etc_id_rsa.pub | sudo dokku ssh-keys:add admin