Warning, /eic-shell/tests/Dockerfile is written in an unsupported language. File is not indexed.
0001 # Minimal container for CI testing of eic-shell launcher scripts.
0002 # Matches the entrypoint and eic-shell scripts from eic/containers:
0003 # https://github.com/eic/containers/tree/master/containers/eic
0004 FROM ubuntu:24.04
0005
0006 RUN apt-get update && \
0007 apt-get install -y --no-install-recommends bash coreutils grep && \
0008 rm -rf /var/lib/apt/lists/*
0009
0010 RUN echo 'export EIC_ENV_LOADED=1' > /etc/eic-env.sh && \
0011 mkdir -p /opt/local/bin /opt/local/sbin
0012
0013 # In-container entrypoint replicating /opt/local/sbin/entrypoint.sh in eic/containers
0014 RUN <<'EOF'
0015 cat << 'SH' > /opt/local/sbin/entrypoint.sh
0016 #!/usr/bin/env bash
0017 . /etc/eic-env.sh
0018 exec "$@"
0019 SH
0020 chmod +x /opt/local/sbin/entrypoint.sh
0021 EOF
0022
0023 # In-container eic-shell replicating /opt/local/bin/eic-shell in eic/containers
0024 RUN <<'EOF'
0025 cat << 'SH' > /opt/local/bin/eic-shell
0026 #!/usr/bin/env bash
0027 piped_args=()
0028 if [ -p /dev/stdin ]; then
0029 while IFS= read -r line; do
0030 piped_args+=("${line}")
0031 done
0032 fi
0033 . /etc/eic-env.sh
0034 if [ "${#piped_args[@]}" != "0" ]; then
0035 printf "%s\n" "${piped_args[@]}" | bash -s -- --norc --noprofile
0036 elif [ $# -gt 0 ]; then
0037 exec bash -c "$@"
0038 else
0039 exec bash --norc --noprofile
0040 fi
0041 SH
0042 chmod +x /opt/local/bin/eic-shell
0043 EOF
0044
0045 RUN ln -sf /opt/local/bin/eic-shell /usr/local/bin/eic-shell
0046 ENV PATH=/opt/local/bin:$PATH
0047 ENTRYPOINT ["/opt/local/sbin/entrypoint.sh"]