Skip to content

Commit 272015a

Browse files
committed
Replace /bin/sh with a wrapper to /bin/bash
This is needed to be able to set umask=022 for the Linux aarch64 images that use umask=027 by default. /bin/sh does not load /etc/profile nor any other rcfile. See bioconda/bioconda-recipes#46177 for full details and galaxyproject/galaxy#17631 for a summary. Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
1 parent ecfb6b5 commit 272015a

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

images/base-glibc-busybox-bash/Dockerfile.busybox

+11
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ RUN [ ! -f /etc/apt/sources.list ] || sed --in-place= --regexp-extended \
1717
WORKDIR /build
1818
COPY build-busybox ./
1919
ARG busybox_version
20+
21+
SHELL ["/bin/bash", "-c"]
22+
23+
RUN echo "umask 022" >> /etc/profile
24+
RUN echo "umask 022" >> /root/.bashrc
25+
26+
# replace /bin/sh with a wrapper to /bin/bash
27+
RUN unlink /bin/sh
28+
RUN echo 'bash -l "$@"' >> /bin/sh
29+
RUN chmod +x /bin/sh
30+
2031
RUN ./build-busybox \
2132
"${busybox_version}" \
2233
x86_64 aarch64

images/base-glibc-debian-bash/Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,16 @@ RUN touch /usr/local/env-activate.sh \
127127
> /usr/local/env-execute
128128

129129
ENV LANG=C.UTF-8
130+
131+
SHELL ["/bin/bash", "-c"]
132+
133+
RUN echo "umask 022" >> /etc/profile
134+
RUN echo "umask 022" >> /root/.bashrc
135+
136+
# replace /bin/sh with a wrapper to /bin/bash
137+
RUN unlink /bin/sh
138+
RUN echo 'bash -l "$@"' >> /bin/sh
139+
RUN chmod +x /bin/sh
140+
130141
ENTRYPOINT [ "/usr/local/env-execute" ]
131142
CMD [ "bash" ]

images/create-env/Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,16 @@ RUN \
4040
>> /etc/skel/.bashrc
4141
ENV ENV=/etc/profile.d/conda.sh
4242

43+
SHELL ["/bin/bash", "-c"]
44+
45+
RUN echo "umask 022" >> /etc/profile
46+
RUN echo "umask 022" >> /root/.bashrc
47+
48+
# replace /bin/sh with a thin wrapper to /bin/bash
49+
RUN unlink /bin/sh
50+
RUN echo 'bash -l "$@"' >> /bin/sh
51+
RUN chmod +x /bin/sh
52+
53+
4354
ENTRYPOINT [ "/opt/create-env/bin/tini", "--", "/opt/create-env/env-execute" ]
4455
CMD [ "bash" ]

0 commit comments

Comments
 (0)