Created
June 20, 2026 20:09
-
-
Save soanvig/f7b06b77a5ce40b57c824ae55064c049 to your computer and use it in GitHub Desktop.
SSH access in Dockerfile (private build dependencies)
This file contains hidden or 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
| # Example of using github.com for cargo with private dependency linked through SSH | |
| # Run with: `docker build --ssh default=$SSH_AUTH_SOCK .` | |
| RUN --mount=type=ssh \ | |
| mkdir -p /root/.ssh && ssh-keyscan github.com >> /root/.ssh/known_hosts \ | |
| && cargo build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment