1

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?

4
  • The debian base image has a pretty minimal set of software. It's unusual to use it directly; instead, you'd use it as the base image for a custom image that includes your application. The Docker Sample application tutorial might be a good starting point. Commented Jun 29, 2021 at 18:18
  • Are you trying to use the curl binary in the host OS? I believe that's unusual, you'd typically install it inside the container. Commented Jun 29, 2021 at 19:46
  • Yes, you are right. I just discovered that curl needed to also be inside the container Commented Jun 29, 2021 at 19:47
  • Does this answer your question? Can't run Curl command inside my Docker Container Commented Jun 30, 2021 at 7:18

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.