Comments (14)
from busybox.
$ docker build .
Sending build context to Docker daemon 984.6 kB
Step 1 : FROM scratch
--->
Step 2 : COPY busybox-x86_64 /bin/busybox
---> Using cache
---> 92a2f6fae826
Step 3 : RUN busybox --install /bin
---> Using cache
---> e7f2a7233b3a
Step 4 : CMD sh
---> Running in fbc9a01b60c2
---> cad1d1fe033d
Removing intermediate container fbc9a01b60c2
Successfully built cad1d1fe033d
$ docker run -it --rm cad1d1fe033d
/ # ping google.com
PING google.com (172.217.4.174): 56 data bytes
64 bytes from 172.217.4.174: seq=0 ttl=50 time=22.284 ms
64 bytes from 172.217.4.174: seq=1 ttl=50 time=20.331 ms
64 bytes from 172.217.4.174: seq=2 ttl=50 time=22.942 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 20.331/21.852/22.942 ms
/ #
from busybox.
https://busybox.net/downloads/binaries/1.26.1-i686/ has the other bits mentioned (ssl_helper
, for example)
from busybox.
After doing a COPY
of ssl_helper
into /bin/
, I can wget
https URLs too (although there aren't any CA certificates in the image, so unless they're embedded into ssl_helper
or wget
itself, there wasn't really any actual cert verification involved). 😇
from busybox.
Heh:
/ # wget 'https://expired.badssl.com/' -O /dev/null
Connecting to expired.badssl.com (104.154.89.105:443)
null 100% |*******************************| 469 0:00:00 ETA
/ # wget 'https://self-signed.badssl.com/' -O /dev/null
Connecting to self-signed.badssl.com (104.154.89.105:443)
null 100% |*******************************| 477 0:00:00 ETA
/ # wget 'https://untrusted-root.badssl.com/' -O /dev/null
Connecting to untrusted-root.badssl.com (104.154.89.105:443)
null 100% |*******************************| 575 0:00:00 ETA
from busybox.
Even with ssl_helper
included, the image is ~2.148 MB
from busybox.
Comparisons:
busybox uclibc 2a8159f2a446 15 minutes ago 1.11 MB
busybox musl 813910e354b6 16 minutes ago 1.229 MB
busybox glibc 38f42d82ac83 18 minutes ago 4.204 MB
from busybox.
Ah, the image is twice as big as I expected because the hard links are added in a separate layer from the busybox
binary, so the image gets that binary twice. Hmm.
from busybox.
Ok, got it down to the expected ~986.2 kB by adding -s
to the busybox --install
line (so it uses symlinks instead of hard links).
from busybox.
New binaries were released in https://busybox.net/downloads/binaries/1.26.2-defconfig-multiarch/, so this is looking kind of promising. 😄
from busybox.
I was looking for a statically linked version of the busybox container and was going to submit an issue and then bumped into this issue.
I think it is still a good idea.
from busybox.
@kfox1111 I think you've misunderstood what this issue is about -- the binaries in the busybox
image (minus the busybox:glibc
variant) are already static binaries today:
FROM scratch
COPY --from=busybox /bin/busybox /bin/
RUN ["/bin/busybox", "--install"]
RUN echo 'it works!'
This issue is debating whether we should consume the binaries that upstream is publishing directly, which appear to still have drawbacks that make them less interesting.
from busybox.
Oh. that was not clear, as it mentions various libc's in the tags. (https://hub.docker.com/_/busybox) but none that is just static. I was looking for one with just a busybox binary in it. I assumed the various libc's were included in the containers. I guess latest works for me then. Thanks for the pointer.
from busybox.
The upstream binaries here are not comprehensive, so I think we're going to stick with our build-from-source methods for now. 👍
from busybox.
Related Issues (20)
- 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 14
- 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
- TLS error from peer (alert code 40) HOT 1
- Debian Unstable based glibc builds failing HOT 1
- Segfault on `riscv64` HOT 13
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.