sftp icon indicating copy to clipboard operation
sftp copied to clipboard

wrong error handling in entrypoint

Open Drtuna opened this issue 5 years ago • 1 comments

Hi,

I have an error in the entry point script during creation of the keys.

    if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then
>>>        ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
    fi
    if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
        ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ''
    fi
artifact_server_1  | Generating public/private ed25519 key pair.
artifact_server_1  | /etc/ssh/ssh_host_ed25519_key already exists.
artifact_server_1  | Overwrite (y/n)? /entrypoint: Error on line 69: ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ''
docker_mlflow_artifact_server_1 exited with code 1

I mounted a directory using docker-compose which contains the keys

       - type: bind
         source: /dev/ssh_keys/
         target: /etc/ssh/

However, I had a typo. Hence, it is not a regular file but a directory. the sse-keygen than tries to overwrite that specific directory with a file, which results in the question and ultimately the crash of the docker container

Drtuna avatar Jun 10 '20 13:06 Drtuna

How do you propose this should be handled differently?

atmoz avatar Jul 13 '20 20:07 atmoz