Created
August 10, 2021 15:36
-
-
Save magickatt/77a49fa9432e0124eeb05636e32e20db to your computer and use it in GitHub Desktop.
Use forwarded SSH agent in Docker build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.9-buster | |
# Prevents issues with cloning private PIP packages from GitHub | |
RUN --mount=type=ssh mkdir -p ~/.ssh && ssh-keyscan -H github.com >> ~/.ssh/known_hosts | |
RUN pip install --upgrade pip | |
RUN pip install pipenv | |
COPY . . | |
# Use the forwarded SSH agent when installing pip packages | |
RUN --mount=type=ssh pipenv install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment