tval
tval

Reputation: 582

curl command not found when running inside docker container

Running docker container in Debian on a Raspberry Pi. I have the following code:

pi@raspi:~ $ docker container run --rm -it debian
root@64711f73f7da:/# time curl http://google.com
bash: curl: command not found

Yet, if I run curl outside of the docker container, it runs fine:

pi@raspi:~ $ curl -V
curl 7.64.0 (arm-unknown-linux-gnueabihf) libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Release-Date: 2019-02-06
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL 

I have also tried specifying the path to curl inside the docker container from which curl which specified its location as here: /usr/bin/curl. The results were similar to above (bash: /usr/bin/curl: No such file or directory)

How can I get curl to run inside of the Docker Container?

Upvotes: 1

Views: 12929

Answers (1)

tval
tval

Reputation: 582

Found the answer here: Can't run Curl command inside my Docker Container

But to elaborate: Even though the Debian OS on the Raspberry Pi had curl installed and I could access it from the terminal, the Debian image in the Docker Container also needs curl. So within the Docker Container, both root@d120d03b37db:/# apt-get update and root@d120d03b37db:/# apt-get install curl needed installed so that the Debian image had reference to curl

Upvotes: 3

Related Questions