diff --git a/containers/release/Dockerfile b/containers/release/Dockerfile index b19c5a58b0fb7127b2535ebf7fd386c6897e6057..d37df77b794524cf80b7e46d320d73ac0fe7caf8 100644 --- a/containers/release/Dockerfile +++ b/containers/release/Dockerfile @@ -26,10 +26,12 @@ COPY --from=builder /opt/view /opt/view COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh ## Setup global bashrc, useful for singularity COPY --from=builder /root/.bashrc /etc/bash.bashrc +COPY eic-shell /usr/local/bin/eic-shell +COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/eic-env.sh ## make sure we have the entrypoints setup correctly ENTRYPOINT [] CMD ["bash", "--rcfile", "/etc/profile", "-l"] USER 0 WORKDIR / -SHELL ["bash", "--rcfile", "/etc/profile"] +SHELL ["/usr/local/bin/eic-shell"] diff --git a/containers/release/eic-shell b/containers/release/eic-shell new file mode 100755 index 0000000000000000000000000000000000000000..070f3859cb268372f5d6a7696f034497817ab5c6 --- /dev/null +++ b/containers/release/eic-shell @@ -0,0 +1,23 @@ +#! /usr/bin/env bash + +source /etc/profile + +if [ -p /dev/stdin ]; then + # If we want to read the input line by line + while IFS= read line; do + if [ -z "$piped_args" ]; then + piped_args="${line}" + else + piped_args="${piped_args}\n${line}" + fi + done +fi + +## Fire off bash +if [ ${piped_args} ] ; then + echo -e ${piped_args} | exec bash +elif [ $# -gt 0 ]; then + exec bash -c "$@" +else + exec bash +fi