Rust Freight在Docker中获取私有github存储库

问题描述

构建时,我尝试在Dockerfile中使用私有GitHub存储库。

我在Dockerfile中使用以下命令添加凭据:

RUN git config --global credential.helper 'store --file ~/.git-credentials'

RUN git config --global credential.helper store

RUN echo "$DOCKER_GIT_CREDENTIALS" > ~/.git-credentials

RUN chmod 600 ~/.git-credentials

当我运行cargo build --release时,我得到以下输出


06:24:01.184422 run-command.c:646       trace: run_command: 'git credential-ghtoken get'                                                    
06:24:01.191216 git.c:576               trace: exec: git-credential-ghtoken get                                                             
06:24:01.191271 run-command.c:646       trace: run_command: git-credential-ghtoken get                                                      
git: 'credential-ghtoken' is not a git command. See 'git --help'.                                                                           
06:24:01.197609 run-command.c:646       trace: run_command: 'git credential-store get'                                                      
06:24:01.203843 git.c:576               trace: exec: git-credential-store get                                                               
06:24:01.203896 run-command.c:646       trace: run_command: git-credential-store get                                                        
warning: url has no scheme:                                                                                                                 
fatal: credential url cannot be parsed:                                                                                                     
fatal: Could not read Username for 'https://github.com': No such device or address    

我使用ekidd/rust-musl-builder:latest作为基本图片

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)