Comments (11)
If you need more functionality than BusyBox alone, then I'd recommend checking out Alpine, which is basically BusyBox plus their apk
package manager (which allows you to easily install curl
if you so need, for example).
from busybox.
You'd need a statically compiled curl
and then COPY
it into the image. You could just use wget:
$ docker run -it --rm busybox
/ # curl
sh: curl: not found
/ # wget
BusyBox v1.28.4 (2018-05-22 17:00:17 UTC) multi-call binary.
Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
[--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
[-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL...
Retrieve files via HTTP or FTP
--spider Only check URL existence: $? is 0 if exists
-c Continue retrieval of aborted transfer
-q Quiet
-P DIR Save to DIR (default .)
-S Show server response
-T SEC Network read timeout is SEC seconds
-O FILE Save to FILE ('-' for stdout)
-U STR Use STR for User-Agent header
-Y on/off Use proxy
/ #
from busybox.
Why do we have wget but not curl in busybox by the way? If anyone knows 🤔 Why not curl instead of wget?
from busybox.
BusyBox does not include wget
-- BusyBox reimplements a subset of wget
(as they do with all the coreutils they include, etc). That's the whole point of BusyBox. The usage patterns of curl
are significantly more complex, so implementing a subset of those would be a lot more complicated.
To illustrate:
$ wget --help | wc -l
207
$ docker run --rm busybox wget --help 2>&1 | wc -l
20
$ docker run --rm busybox wget --help
BusyBox v1.32.1 (2021-04-07 19:47:14 UTC) multi-call binary.
Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
[-o|--output-file FILE] [--header 'header: value'] [-Y|--proxy on/off]
[--no-check-certificate]
[-P DIR] [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL...
Retrieve files via HTTP or FTP
--spider Only check URL existence: $? is 0 if exists
--no-check-certificate Don't validate the server's certificate
-c Continue retrieval of aborted transfer
-q Quiet
-P DIR Save to DIR (default .)
-S Show server response
-T SEC Network read timeout is SEC seconds
-O FILE Save to FILE ('-' for stdout)
-o FILE Log messages to FILE
-U STR Use STR for User-Agent header
-Y on/off Use proxy
If curl
is something required for your use case, I would reiterate the advice from above: Alpine is busybox
+ a minimal package manager and libc
implementation such that you can trivially do apk add --no-cache curl
and get real curl
(or even apk add --no-cache wget
to get the "real" wget
instead of BusyBox wget
).
from busybox.
I mean, yes, but also very much no: #80 (TLS validation is Broken-By-Design)
from busybox.
Aye, I usually use alpine, but in this case I'm extending a busybox based image and need to copy in curl, meaning I need a statically compiled version of curl. I was just commenting on the suggestion of wget as an alternative. Thanks though!
from busybox.
This doesn't help when you need to use more functionality than wget has available, sadly.
from busybox.
Why do we have wget but not curl in busybox by the way? If anyone knows 🤔 Why not curl instead of wget?
Because busybox
implements wget
and not curl
. https://git.busybox.net/busybox/tree/networking/wget.c?h=1_32_stable
from busybox.
Thanks for the answer... although I believe it is the reason of my question 😉 Why isn't busybox supporting curl instead of wget? Is this a size problem? Especially since curl is under an MIT license AFAIK 🤔
from busybox.
Nice thanks so much for the explanations 👍. I would, from my semi ignorant point of view, that it helps to reduce the attack surface since busybox's wget is even simpler than the actual wget.
from busybox.
Oh well, you just blew my mind 😄
So... I guess we should either have openssl somewhere or install e. g. Alpine's wget if we want proper TLS validation for the time being and foreseeable future right? Anyway sorry for the off-topic comment but this is definitely interesting knowledge 😉
from busybox.
Related Issues (20)
- GNOME HIG.gpl.txt
- nc: bad port spec 'local:/...' HOT 4
- ping: bad address, Running in k8s. HOT 3
- busybox 1.34.1 exited in arm64 with code 139 HOT 5
- busybox
- The latest busybox becomes compiled dynamic? HOT 12
- Symlink /usr/bin to /bin HOT 1
- wget Connection reset by peer HOT 12
- BR2_cortex_a15 support available? HOT 1
- Can this docker with glibc support Dynamic linked binaries/ELF. HOT 3
- busybox 1.36 sha256sum crashes with Illegal instruction (SIGILL) on amd64 HOT 3
- busybox doesn't support bash HOT 1
- :confused: `busybox` is just a collection of tools, so depending on what you are running it may or may not respond to a `SIGTERM`. There isn't anything we could do in the image for that.
- Consider single (standalone) applets variants HOT 2
- How to use with an SPA HOT 3
- Zip utility in Busybox HOT 1
- confused by for loop HOT 5
- How to Set System Locales in busybox docker image? HOT 3
- busybox 1.36.1 may have been built with an older version of build tool HOT 2
- Manifest issues for 7 architectures on versions 1.35 and 1.36 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from busybox.