Skip to content

Commit 6d8d31c

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 6d8d31c

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ RUN [ ! -f /etc/apt/sources.list ] || sed --in-place= --regexp-extended \
1717
WORKDIR /build
1818
COPY build-busybox ./
1919
ARG busybox_version
20+
21+
RUN echo "umask 022" >> /etc/profile
22+
RUN echo "umask 022" >> /root/.bashrc
23+
2024
RUN ./build-busybox \
2125
"${busybox_version}" \
2226
x86_64 aarch64

images/base-glibc-debian-bash/Dockerfile

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

129129
ENV LANG=C.UTF-8
130+
131+
RUN echo "umask 022" >> /etc/profile
132+
RUN echo "umask 022" >> /root/.bashrc
133+
130134
ENTRYPOINT [ "/usr/local/env-execute" ]
131135
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)