bootstrap: If the mold linker is available prefer it over gold
[metze/samba-autobuild/.git] / bootstrap / generated-dists / debian11 / Dockerfile
1 #
2 # This file is generated by 'bootstrap/template.py --render'
3 # See also bootstrap/config.py
4 #
5
6 FROM debian:11
7
8 # pass in with --build-arg while build
9 ARG SHA1SUM
10 RUN [ -n $SHA1SUM ] && echo $SHA1SUM > /sha1sum.txt
11
12 ADD *.sh /tmp/
13 # need root permission, do it before USER samba
14 RUN /tmp/bootstrap.sh && /tmp/locale.sh
15
16 # if ld.gold exists, force link it to ld
17 RUN set -x; LD=$(which ld); LD_GOLD=$(which ld.gold); test -x $LD_GOLD && ln -sf $LD_GOLD $LD && test -x $LD && echo "$LD is now $LD_GOLD"
18 # if ld.mold exists, force link it to ld (prefer mold over gold! ;-)
19 RUN set -x; LD=$(which ld); LD_MOLD=$(which ld.mold); test -x $LD_MOLD && ln -sf $LD_MOLD $LD && test -x $LD && echo "$LD is now $LD_MOLD"
20
21 # make test can not work with root, so we have to create a new user
22 RUN useradd -m -U -s /bin/bash samba && \
23     mkdir -p /etc/sudoers.d && \
24     echo "samba ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/samba
25
26 USER samba
27 WORKDIR /home/samba
28 # samba tests rely on this
29 ENV USER=samba LC_ALL=en_US.utf8 LANG=en_US.utf8