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

ssh-keygen not present on container #330

Open
1 task done
pdelaby opened this issue Feb 12, 2019 · 0 comments
Open
1 task done

ssh-keygen not present on container #330

pdelaby opened this issue Feb 12, 2019 · 0 comments

Comments

@pdelaby
Copy link

pdelaby commented Feb 12, 2019

Overview of the issue

To use the registry with a git repository, ssh and docker, the "ssh" page ( http://myurl:8761/#/ssh) explain how to generate a key pair with "ssh-keygen" :

Log in inside the container: docker exec -it <containerIdOrName> sh
Generate an SSH key: ssh-keygen

However, this command doesn't exist on the container. In addition, the 'test' step to accept the rsa is mandatory.

Motivation for or Use Case

The documentation is detailed, so it shoud detail the steps to generate a keypair.

Reproduce the error
  • Start and enter a registry container docker run --rm -i -t jhipster/jhipster-registry:v4.1.1 sh
  • Try the given command : ssh-keygen
  • Reponse : sh: ssh-keygen: not found
Related issues
Suggest a Fix

I suggest updating the documentation.

Thoses are the steps I followed - I intend to use a volume to store the keys.

  1. create a Dockerfile : ubuntu with openssh installed
FROM ubuntu:latest
RUN apt-get update
RUN apt-get -y install openssh-client 
RUN mkdir /root/.ssh
  1. build the image
    docker build -t keygen-generator .

  2. Start a container based on this image, and use the volume
    docker run --rm -i -t -v jhipster-registry-data:/root/.ssh keygen-generator bash

  3. Generate the keys
    ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa

  4. Accept the key for the host of you git repo (here, github)
    ssh -T [email protected] then type "yes"

  5. The volume jhipster-registry-data now contains my keys, the know_host, and can be used with my jhispter-registry container.

JHipster Registry Version(s)

I'm using the image jhipster-registry:v4.1.1

Browsers and Operating System

Not relevant, but win10 and chrome.

  • Checking this box is mandatory (this is just to show you read everything)
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