[IMP] Dockerfile: create known_hosts file#1145
[IMP] Dockerfile: create known_hosts file#1145quirino95 wants to merge 1 commit intoTecnativa:masterfrom
Conversation
|
AFAIK, this is done in the scaffolding. Can you confirm, @josep-tecnativa ? |
|
I can confirm that the file is not present Output of docker container run --rm ghcr.io/tecnativa/docker-duplicity-postgres:edge sh "ls -al /root/.ssh"is as follows: fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.22/community/x86_64/APKINDEX.tar.gz
(1/1) Installing postgresql16-client (16.9-r0)
Executing postgresql-common-1.2-r1.trigger
* Setting postgresql16 as the default version
*
* You are using 'postgresql16'. It's recommended to upgrade to the latest
* major version provided by package 'postgresql17'.
* Use command 'pg_versions' to switch between versions.
*
OK: 50 MiB in 95 packages
psql (PostgreSQL) 16.9
pg_dump (PostgreSQL) 16.9
sh: can't open 'ls -al /root/.ssh': No such file or directoryThat said, I'm not sure if this would work the moment you use a volume to preserve @quirino95 Can you check? Alternatively, the commands you added could go in the |
|
Updated code, moved command in |
|
TBH, we’ve never needed that, but if you’ve been running into issues due to a missing |
|
Hi @josep-tecnativa , I've made the permissions explicit to be sure, both on |
When a ssh/sftp connection is configured, the first run (both backup or jobrunner) fails because there is no file
/root/.ssh/known_hosts, which has to be created manually.This fix in
Dockerfilecreates.sshfolder andknown_hostsfile, in order to make the first run right and avoid this kind of error.