You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was implementing this using a docker build, and I ran into an issue that took me a while to debug, so wanted to add my knowledge here.
In addition to adding
# Copy the two files in place and fix different path/locations inside the Docker image
COPY root-config /root/
RUN sed 's|/home/runner|/root|g' -i.bak /root/.ssh/config
to the Dockerfile, you should also utilize an ssh mount with whichever command accesses the private repo. For my case, using go, I changed
RUN go mod download
to
RUN --mount=type=ssh \
go mod download
The text was updated successfully, but these errors were encountered:
Moreover, if the user running these commands is different from root, the --mount=type=ssh option must be complemented by --mount=type=ssh,uid=X,gid=Y where X is the correct UID and Y the GID.
I was implementing this using a docker build, and I ran into an issue that took me a while to debug, so wanted to add my knowledge here.
In addition to adding
to the Dockerfile, you should also utilize an ssh mount with whichever command accesses the private repo. For my case, using go, I changed
to
The text was updated successfully, but these errors were encountered: