Skip to content

Commit 7bd51b9

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 7bd51b9

File tree

7 files changed

+34
-3
lines changed

7 files changed

+34
-3
lines changed

.github/workflows/base-glibc-busybox-bash.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# The base image is not intended to change often and should be used with
2020
# version tags or checksum IDs, but not via "latest".
2121
MAJOR_VERSION: 3
22-
MINOR_VERSION: 0
22+
MINOR_VERSION: 1
2323
IMAGE_NAME: base-glibc-busybox-bash
2424
BUSYBOX_VERSION: '1.36.1'
2525
DEBIAN_VERSION: '12.2'

.github/workflows/base-glibc-debian-bash.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# The base image is not intended to change often and should be used with
2020
# version tags or checksum IDs, but not via "latest".
2121
MAJOR_VERSION: 3
22-
MINOR_VERSION: 0
22+
MINOR_VERSION: 1
2323
IMAGE_NAME: base-glibc-debian-bash
2424
DEBIAN_VERSION: '12.2'
2525

.github/workflows/create-env.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-22.04
1818
env:
1919
MAJOR_VERSION: 3
20-
MINOR_VERSION: 0
20+
MINOR_VERSION: 1
2121
IMAGE_NAME: create-env
2222

2323
steps:

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

+10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ 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+
24+
SHELL ["/bin/bash", "-c"]
25+
# replace /bin/sh with a wrapper to /bin/bash
26+
RUN ls -la /bin/sh && unlink /bin/sh
27+
COPY ../bin-sh-wrapper.sh /bin/sh
28+
RUN chmod +x /bin/sh && ls -la /bin/sh && cat /bin/sh
29+
2030
RUN ./build-busybox \
2131
"${busybox_version}" \
2232
x86_64 aarch64

images/base-glibc-debian-bash/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,14 @@ 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 && echo 'bash -l "$@"' > /bin/sh && chmod +x /bin/sh
138+
130139
ENTRYPOINT [ "/usr/local/env-execute" ]
131140
CMD [ "bash" ]

images/bin-sh-wrapper.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
bash -l "$@"

images/create-env/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,14 @@ 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 && echo 'bash -l "$@"' > /bin/sh && chmod +x /bin/sh
50+
51+
4352
ENTRYPOINT [ "/opt/create-env/bin/tini", "--", "/opt/create-env/env-execute" ]
4453
CMD [ "bash" ]

0 commit comments

Comments
 (0)