I have a filed called ssh_key.txt
and the content of that file is: my_private_key
In my Dockerfile
I have this instruction:
RUN --mount=type=secret,id=ssh_key
cat /run/secrets/ssh_key > /home/${USER_NAME}/.ssh/git_key
When I build this image:
docker build --secret id=ssh_key,src=ssh_key.txt -t my_image.
And run the image, when I cd
into the .ssh
directory and run:
cat git_key
Weirdly the content is:
"��my_private_key"
I don’t understand where the ��
is coming from, does anyone know I could be doing wrong?