如何从docker-toolbox curl切换到Windows路径中定义的curl [英] How to switch from docker-toolbox curl to the curl defined in windows path

查看:191
本文介绍了如何从docker-toolbox curl切换到Windows路径中定义的curl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在安装针对超级账本的平台特定二进制文件 ,但是有一个问题,因为我有Windows设备,并且正在使用docker-toolbox quickstart终端.

I am installing the Platform specific binaries for hyperledger, but have a problem, since I have a windows device and am using docker-toolbox quickstart terminal.

安装在docker-toolbox上的curl版本为:

The curl version installed on docker-toolbox is:

$ curl --version
curl 7.49.1 (x86_64-w64-mingw32) libcurl/7.49.1 OpenSSL/1.0.2h zlib/1.2.8 libidn/1.32 libssh2/1.7.0 nghttp2/1.11.1 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP HTTP2 Metalink

我在Windows上安装了curl版本7.56,并将其添加到PATH中.当我打开Windows默认终端时,版本为7.56

I installed the curl version 7.56 on my windows and added to the PATH. When I open the windows default terminal, the version is 7.56

如何更改docker-quickstart curl以使用Windows curl?

How can I change the docker-quickstart curl to use my windows curl?

  • 重新打开快速入门终端
  • 我尝试重新启动VM
  • 在VM终端中使用sudo apt-get install curl,但似乎在VM上未安装apt-get
  • Reopening the quickstart terminal
  • I tried restarting the VM
  • Using sudo apt-get install curl inside the VM terminal, but it appears that there is no apt-get installed on the VM

任何想法-的解决方案相关问题不足,我想拥有最新的 curl

Any ideas - the solution for the related question is insufficient, I want to have the latest curl

推荐答案

使用以下命令在您的主目录(C:\Users\<username>)中创建一个名为.bash_profile的文件:

Create a file named .bash_profile in your home directory (C:\Users\<username>) with this line of command:

PATH=/c/your/curl/path/bin:$PATH

如果许多路径中有相同的二进制文件,则将计算PATH变量最左侧的二进制文件.

If there are same binaries in many path, the one in the leftmost side of PATH variable will be excuted.

MinGW-w64(由Docker QuickStart Terminal使用)在启动时会将其路径添加到PATH变量之前,因此其路径将位于PATH变量的最左侧.因此,可以取代MinGW-w64的卷曲,而不必像您最初在PATH变量中定义的那样卷曲.

MinGW-w64 (used by Docker QuickStart Terminal) would prepend its path to the PATH variable when starting up so its path would be in the leftmost side of PATH variable. Therefore, MinGW-w64's curl be excuted instead of the one you originally defined in PATH variable.

.bash_profile文件将在启动MinGW-w64(Docker快速入门终端)时执行,因此您可以添加以上命令以在文件中添加PATH变量.

.bash_profile file would be executed when starting MinGW-w64 (Docker QuickStart Terminal) so you can add above command to prepend the PATH variable in the file.

这篇关于如何从docker-toolbox curl切换到Windows路径中定义的curl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆