3 ms·
No, Alpine uses symlinks: $ docker run --rm -ti alpine / # ls -l /usr/bin/test /usr/bin/[ lrwxrwxrwx 1 root root 12 Sep 28 11:18
by yjftsjthsd-h 3y ago
No, Alpine uses symlinks:
$ docker run --rm -ti alpine
/ # ls -l /usr/bin/test /usr/bin/[
lrwxrwxrwx 1 root root 12 Sep 28 11:18 /usr/bin/[ -> /bin/busybox
lrwxrwxrwx 1 root root 12 Sep 28 11:18 /usr/bin/test -> /bin/busybox
/ # ls -li /usr/bin/test /usr/bin/[
495254 lrwxrwxrwx 1 root root 12 Sep 28 11:18 /usr/bin/[ -> /bin/busybox
495360 lrwxrwxrwx 1 root root 12 Sep 28 11:18 /usr/bin/test -> /bin/busybox
/ #
- figmert 3y agoThis is different. Alpine uses busybox, where everything is implemented in the busybox binary, thus everything is symlinked to it. In other distributions, test is a separate binary, and [ is a link.
- somat 3y agoInteresting... Doubly so because I thought busybox was a sort of linux crunchgen, A way to pack many independent executables into one to save space. With crunchgen at least, each executable name is then linked to the packed binary, that is, hardlinks. and the filesystem name is used to pick the correct code to run. Why did they go with softlinks? my guess... It can be moved across filesystem boundaries. Perhaps interference from cgroups? http://man.openbsd.org/crunchgen http://man.openbsd.org/crunchgen
- arp242 3y agoBoth just look at the first entry in argv. Whether you used a hard- or symlink isn't very important for that. Or at least, that's how FreeBSD crunchgen works. Maybe they changed that in OpenBSD?