Skip to content

Instantly share code, notes, and snippets.

@asterbini
Last active March 10, 2022 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asterbini/3f6f89c4fad71b3c079a132d08be2537 to your computer and use it in GitHub Desktop.
Save asterbini/3f6f89c4fad71b3c079a132d08be2537 to your computer and use it in GitHub Desktop.
Forward SSH authentication when building a Docker image
docker build --ssh default -t asterbini/image .
then in your Dockerfile you can do
RUN --mount=type=ssh git clone git@github.com:your-repo.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment