Skip to content

Commit 0604f83

Browse files
committed
Override the default ssh askpass flow on project clone step
1 parent 68bae56 commit 0604f83

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

project-clone/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ COPY --from=builder /project-clone/_output/bin/project-clone /usr/local/bin/proj
4444

4545
ENV USER_UID=1001 \
4646
USER_NAME=project-clone \
47-
HOME=/home/user
47+
HOME=/home/user \
48+
DISPLAY=":0" \
49+
SSH_ASKPASS=/usr/local/bin/ssh-askpass.sh
4850

4951
COPY build/bin /usr/local/bin
52+
COPY project-clone/ssh-askpass.sh /usr/local/bin
5053
RUN /usr/local/bin/user_setup
54+
RUN chmod +x /usr/local/bin/ssh-askpass.sh
5155

5256
USER ${USER_UID}
5357

project-clone/ssh-askpass.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
PASSPHRASE_FILE_PATH="/etc/ssh/passphrase"
3+
if [ ! -f $PASSPHRASE_FILE_PATH ]; then
4+
echo "Error: passphrase file is missing in the '/etc/ssh/' directory" 1>&2
5+
exit 1
6+
fi
7+
cat $PASSPHRASE_FILE_PATH

0 commit comments

Comments
 (0)