git install fails in Dockerfile
For those working with alpine
images, RUN apk add --no-cache git
did the trick for me.
Some thoughts:
- Replace
apt-get install git
withapt-get install --assume-yes git
. Without the--assume-yes
it will prompt you for confirmation, which you are unable to give and it will be smart enough to figure that out and assume you meant "NO".
- Replace
- You added the ssh key, but did you confirm it was
0600
. I would just copy it and specificallychmod 0600 ~/.ssh/id_rsa
to be sure.
- You added the ssh key, but did you confirm it was
Overall, your Dockerfile looks very clever and I got some fresh ideas from reading it.
You are overanalyzing this. It's just a simple typo. Should be:
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y git
Those are 3 separate commands.