# SSH Key scan failed trying to build custom Docker under Bullseye

**URL:** <https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889>\
**Category:** General\
**Tags:** docker\
**Created:** [17 November 2021 14:36 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889 "2021-11-17T14:36:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfort57](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alfort57/32/65161_2.png) [@alfort57](https://discourse.nodered.org/u/alfort57)\
**Post date:** [17 November 2021 14:36 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889/1 "2021-11-17T14:36:45Z")

</div>

Hardware: Raspberry PI 4 with 8Gb Ram  
OS: PI OS Bullseye Full distribution  
All updates to Bullseye done  
Docker standard image : 2.1.3 is running OK  
Docker Custom Git freshly clone.  
I was able to build several Custom Docker Node-red images under PI OS Buster.  
The final lines of the log are:  
ssh-keyscan failed, no more retries left  
The command '/bin/sh -c ./known\_hosts.sh /etc/ssh/ssh\_known\_hosts && rm /usr/src/node-red/known\_hosts.sh' returned a non-zero code: 1

```auto

#########################################################################
node-red version: 2.1.3
#########################################################################
Sending build context to Docker daemon 288.3kB
Step 1/27 : ARG ARCH=arm32v7
Step 2/27 : ARG NODE_VERSION=12
Step 3/27 : ARG OS=alpine
Step 4/27 : FROM ${ARCH}/node:${NODE_VERSION}-${OS} AS base
 ---> ef89f71a1932
Step 5/27 : COPY scripts/*.sh /tmp/
 ---> 14c8d578a4a0
Step 6/27 : RUN set -ex && apk add --no-cache bash tzdata iputils curl nano git openssl openssh-client ca-certificates && mkdir -p /usr/src/node-red /data && deluser --remove-home node && adduser -h /usr/src/node-red -D -H node-red -u 1000 && chown -R node-red:root /data && chmod -R g+rwX /data && chown -R node-red:root /usr/src/node-red && chmod -R g+rwX /usr/src/node-red
 ---> Running in fd04fbe23f0b
+ apk add --no-cache bash tzdata iputils curl nano git openssl openssh-client ca-certificates
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/armv7/APKINDEX.tar.gz
(1/22) Installing ncurses-terminfo-base (6.2_p20210612-r0)
(2/22) Installing ncurses-libs (6.2_p20210612-r0)
(3/22) Installing readline (8.1.0-r0)
(4/22) Installing bash (5.1.4-r0)
Executing bash-5.1.4-r0.post-install
(5/22) Installing ca-certificates (20191127-r5)
(6/22) Installing brotli-libs (1.0.9-r5)
(7/22) Installing nghttp2-libs (1.43.0-r0)
(8/22) Installing libcurl (7.79.1-r0)
(9/22) Installing curl (7.79.1-r0)
(10/22) Installing expat (2.4.1-r0)
(11/22) Installing pcre2 (10.36-r0)
(12/22) Installing git (2.32.0-r0)
(13/22) Installing libcap (2.50-r0)
(14/22) Installing iputils (20210202-r0)
(15/22) Installing libmagic (5.40-r1)
(16/22) Installing nano (5.7-r2)
(17/22) Installing openssh-keygen (8.6_p1-r3)
(18/22) Installing libedit (20210216.3.1-r0)
(19/22) Installing openssh-client-common (8.6_p1-r3)
(20/22) Installing openssh-client-default (8.6_p1-r3)
(21/22) Installing openssl (1.1.1l-r0)
...
...
...
Step 9/27 : RUN ./known_hosts.sh /etc/ssh/ssh_known_hosts && rm /usr/src/node-red/known_hosts.sh
 ---> Running in 014768671f13
# github.com:22 SSH-2.0-babeld-a73e1397
# github.com:22 SSH-2.0-babeld-a73e1397
# github.com:22 SSH-2.0-babeld-a73e1397
# github.com:22 SSH-2.0-babeld-a73e1397
# github.com:22 SSH-2.0-babeld-a73e1397
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 1ea5b1a670f6
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 a850b9848fdd
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 27c69e8a7237
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 5342984440a5
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 66e2e6157c88
# ssh.dev.azure.com:22 SSH-2.0-SSHBlackbox.10
# ssh.dev.azure.com:22 SSH-2.0-SSHBlackbox.10
# ssh.dev.azure.com:22 SSH-2.0-SSHBlackbox.10
# ssh.dev.azure.com:22 SSH-2.0-SSHBlackbox.10
# ssh.dev.azure.com:22 SSH-2.0-SSHBlackbox.10
# vs-ssh.visualstudio.com:22 SSH-2.0-SSHBlackbox.10
# vs-ssh.visualstudio.com:22 SSH-2.0-SSHBlackbox.10
# vs-ssh.visualstudio.com:22 SSH-2.0-SSHBlackbox.10
# vs-ssh.visualstudio.com:22 SSH-2.0-SSHBlackbox.10
# vs-ssh.visualstudio.com:22 SSH-2.0-SSHBlackbox.10
# source.developers.google.com:2022 SSH-2.0-Go
# source.developers.google.com:2022 SSH-2.0-Go
# source.developers.google.com:2022 SSH-2.0-Go
# source.developers.google.com:2022 SSH-2.0-Go
# source.developers.google.com:2022 SSH-2.0-Go

+++ /tmp/tmp.cGLBCn
@@ -3,6 +3,8 @@
 2048 SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og ssh.dev.azure.com (RSA)
 2048 SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og vs-ssh.visualstudio.com (RSA)
 2048 SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A bitbucket.org (RSA)
+256 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU github.com (ED25519)
 256 SHA256:AGvEpqYNMqsRNIviwyk4J4HM0lEylomDBKOWZsBn434 [source.developers.google.com]:2022 (ECDSA)
 256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw gitlab.com (ECDSA)
 256 SHA256:eUXGGm1YGsMAS7vkcx6JOJdOGHPem5gQp4taiCfCLB8 gitlab.com (ED25519)
+256 SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM github.com (ECDSA)
# github.com:22 SSH-2.0-babeld-a73e1397
# github.com:22 SSH-2.0-babeld-a73e1397
# github.com:22 SSH-2.0-babeld-a73e1397
# github.com:22 SSH-2.0-babeld-a73e1397
# github.com:22 SSH-2.0-babeld-a73e1397
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 1ea5b1a670f6
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 282cff4580c6
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 e29a3b52f441
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 fce8ee8baf90
# bitbucket.org:22 SSH-2.0-conker_a7531beec7 d963fff1a592

--- -
--- -
+++ /tmp/tmp.cGLBCn
@@ -3,6 +3,8 @@
 2048 SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og ssh.dev.azure.com (RSA)
 2048 SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og vs-ssh.visualstudio.com (RSA)
 2048 SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A bitbucket.org (RSA)
+256 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU github.com (ED25519)
 256 SHA256:AGvEpqYNMqsRNIviwyk4J4HM0lEylomDBKOWZsBn434 [source.developers.google.com]:2022 (ECDSA)
 256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw gitlab.com (ECDSA)
 256 SHA256:eUXGGm1YGsMAS7vkcx6JOJdOGHPem5gQp4taiCfCLB8 gitlab.com (ED25519)
+256 SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM github.com (ECDSA)
ssh-keyscan failed, no more retries left
The command '/bin/sh -c ./known_hosts.sh /etc/ssh/ssh_known_hosts && rm /usr/src/node-red/known_hosts.sh' returned a non-zero code: 1

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 November 2021 14:43 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889/2 "2021-11-17T14:43:39Z")

</div>

Not really a node-red question though is it?

Maybe try in a docker forum?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [17 November 2021 15:07 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889/3 "2021-11-17T15:07:54Z")

</div>

It is part of our custom script so belongs here  
@hardillb ?

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [17 November 2021 17:10 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889/4 "2021-11-17T17:10:12Z")

</div>

It shouldn't care which OS it's run on as it should be running in the Alpine container while it's being built.

---

<div class="post-metadata">

**Author:** ![alfort57](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alfort57/32/65161_2.png) [@alfort57](https://discourse.nodered.org/u/alfort57)\
**Post date:** [17 November 2021 17:10 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889/5 "2021-11-17T17:10:32Z")

</div>

from the Flux project ([flux/docker at master · fluxcd/flux · GitHub](https://github.com/fluxcd/flux/tree/master/docker))

There are 2 new keys for Github

```auto
2048 SHA256:ROQFvPThGrW4RuWLoL9tq9I9zJ42fK4XywyRtbOz/EQ gitlab.com (RSA)
2048 SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 github.com (RSA)
2048 SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og ssh.dev.azure.com (RSA)
2048 SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og vs-ssh.visualstudio.com (RSA)
2048 SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A bitbucket.org (RSA)
256 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU github.com (ED25519)
256 SHA256:AGvEpqYNMqsRNIviwyk4J4HM0lEylomDBKOWZsBn434 [source.developers.google.com]:2022 (ECDSA)
256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw gitlab.com (ECDSA)
256 SHA256:eUXGGm1YGsMAS7vkcx6JOJdOGHPem5gQp4taiCfCLB8 gitlab.com (ED25519)
256 SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM github.com (ECDSA)

```

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [17 November 2021 17:19 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889/6 "2021-11-17T17:19:53Z")

</div>

yeah, just need to add the 2 extra lines in. PR in the works

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [17 November 2021 17:27 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889/7 "2021-11-17T17:27:46Z")

</div>

Changes merged, Please pull the latest and test

---

<div class="post-metadata">

**Author:** ![alfort57](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alfort57/32/65161_2.png) [@alfort57](https://discourse.nodered.org/u/alfort57)\
**Post date:** [17 November 2021 17:52 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889/8 "2021-11-17T17:52:51Z")

</div>

Thanks for your help !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 December 2021 17:53 UTC](https://discourse.nodered.org/t/ssh-key-scan-failed-trying-to-build-custom-docker-under-bullseye/53889/9 "2021-12-01T17:53:45Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
