Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version using docker-compose.yml? #17

Open
ms2d opened this issue Jan 31, 2023 · 0 comments
Open

Version using docker-compose.yml? #17

ms2d opened this issue Jan 31, 2023 · 0 comments

Comments

@ms2d
Copy link

ms2d commented Jan 31, 2023

I have been trying to run this container from a docker-compose.yml file without success. It feels like I am close! But ultimately I get denied access over SSH.

Here is the file:

version: "3"
services:
  gitolite:
    image: jgiannuzzi/gitolite
    container_name: gitolite
    ports:
      - "22:22"
    environment:
      - SSH_KEY="$KEY"
      - SSH_KEY_NAME="$NAME"
    volumes:
      - gitolite-sshkeys:/etc/ssh/keys
      - gitolite-git:/var/lib/git
volumes:
  gitolite-sshkeys:
  gitolite-git:

$KEY and $NAME are replaced with the bash script:

KEY=$(cat ~/.ssh/id_rsa.pub) NAME=$(whoami) envsubst <docker-compose.ymt >docker-compose.yml

I am then denied access with the following error:

adam$ git clone git@localhost:gitolite-admin
Cloning into 'gitolite-admin'...
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is SHA256:............
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
git@localhost: Permission denied (publickey).
fatal: Could not read from remote repository.

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

Any ideas? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant