greyltc / docker-archlinux

Baseline Arch Linux Docker image
GNU General Public License v2.0
50 stars 6 forks source link

Why zsh as /bin/sh? #6

Open bennyandresen opened 7 years ago

bennyandresen commented 7 years ago

That's not expected behavior from Archlinux IMO.

The minimum archlinux tarball has /bin/sh as dash which seems fine for absolute minimum setups.

And then bash is installed which canonically owns /bin/sh.

Especially if you uninstall zsh in the docker image you're left without a working /bin/sh, when it doesn't even own the file.

greyltc commented 7 years ago

If I recall correctly, I decided to do some fancy thing in my install script that neither bash nor dash supported.

I should be more careful about putting the shell back to some sane default.

bennyandresen commented 7 years ago

It helped to find some bashism in some, unfortunately very long running, builds. ;-)

Dav1dde commented 6 years ago

Changing the shell back to bash is probably a good idea. I have a container building AUR packages for me which currently has a workaround like rm /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh in it.

Just started another container based on your archlinux-aur container and ran into the same issue, some packages just don't build with zsh. E.g. bitlbee-discord-git

Error looks like this:

make[2]: Nothing to be done for 'install-exec-am'.
if [ -f /usr/share/bitlbee/help.txt ]; then \
        for file in discord-help.txt; do \
          mkdir -p /home/docker/.cache/pacaur/bitlbee-discord-git/pkg/bitlbee-discord-git/usr/share/bitlbee; \
                /usr/bin/install -c -m 644 ./$file /home/docker/.cache/pacaur/bitlbee-discord-git/pkg/bitlbee-discord-git/usr/share/bitlbee/; \
        done \
else \
        echo "Detected dir /usr/share/bitlbee is not bitlbee's data dir"; \
        echo "Skipping help install"; \
fi
zsh:7: parse error near `echo'
make[2]: *** [Makefile:460: install-data-local] Error 1                                                                                                                                                                                      
make[2]: Leaving directory '/home/docker/.cache/pacaur/bitlbee-discord-git/src/bitlbee-discord/doc'

Also, thank you very much for your work on these containers!