Skip to content

Commit 70859ef

Browse files
add git providers fingerprints during the build of the image
1 parent eb68b57 commit 70859ef

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.ssh/config

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
IdentityFile ~/.ssh/codefresh
2-
3-
Host github.com
4-
StrictHostKeyChecking no

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ RUN apk add --no-cache --virtual deps openssl && \
1010
git lfs install && \
1111
apk del deps
1212

13-
#add ssh record on which ssh key to use
13+
# add ssh record on which ssh key to use
1414
COPY ./.ssh/ /root/.ssh/
1515

16+
# add fingerprint for major git providers
17+
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
18+
RUN ssh-keyscan bitbucket.org >> /root/.ssh/known_hosts
19+
1620
COPY ./start.sh /run/start.sh
1721
RUN chmod +x /run/start.sh
1822

Dockerfile.aarch64

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM arm64v8/alpine:3.7
2-
RUN apk add --no-cache git bash openssh
2+
RUN apk add --no-cache git bash
33

44
# install git-lfs
55
RUN apk add --no-cache --virtual deps openssl && \
@@ -9,9 +9,13 @@ RUN apk add --no-cache --virtual deps openssl && \
99
git lfs install && \
1010
apk del deps
1111

12-
#add ssh record on which ssh key to use
12+
# add ssh record on which ssh key to use
1313
COPY ./.ssh/ /root/.ssh/
1414

15+
# add fingerprint for major git providers
16+
RUN ssh-keyscan github.com > /root/.ssh/known_hosts
17+
RUN ssh-keyscan bitbucket.org > /root/.ssh/known_hosts
18+
1519
COPY ./start.sh /run/start.sh
1620
RUN chmod +x /run/start.sh
1721

0 commit comments

Comments
 (0)