Search code examples
gitdockergogs

can not push files to remote host


I have started a container (git service) using this command...

# Create local directory for volume.
$ mkdir -p /var/gogs

# Use `docker run` for the first time.
$ docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs

I am able to start the git service and can check the newly created repository from browser...

http://52.201.82.96:10080/shantanuo/testme

But when I follow these steps, I get an error (permission denied):

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin http://localhost:3000/shantanuo/testme.git
git push -u origin master

Is it a docker issue?


Solution

  • Since the docker port 3000 is linked to 10080 of the host machine, use this...

    git remote add origin http://52.201.82.96:10080/shantanuo/testme.git