How to switch from docker-toolbox curl to the curl

2019-07-24 21:25发布

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.

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

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

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

  • 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

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

2条回答
放我归山
2楼-- · 2019-07-24 21:58

You will need to install the newer version of curl from the docker-toolbox quickstart terminal window.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-07-24 22:10

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

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

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 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.

查看更多
登录 后发表回答