UNCLASSIFIED

Commit ed7a4bd2 authored by Christopher Vernooy's avatar Christopher Vernooy
Browse files

Update Dockerfile, scripts/entrypoint.sh files

parent 2d9eda53
Pipeline #171497 passed with stages
in 17 minutes and 12 seconds
...@@ -9,9 +9,9 @@ RUN rm -rf /var/cache/dnf ...@@ -9,9 +9,9 @@ RUN rm -rf /var/cache/dnf
COPY --from=base /usr/bin/spark-operator /usr/bin/ COPY --from=base /usr/bin/spark-operator /usr/bin/
COPY tini /sbin/ COPY tini /sbin/
RUN chmod +x /sbin/tini RUN chmod +x /sbin/tini
COPY --from=base /usr/bin/gencerts.sh /usr/bin/ COPY scripts/gencerts.sh /usr/bin/
RUN chmod +x /usr/bin/gencerts.sh RUN chmod +x /usr/bin/gencerts.sh
COPY --from=base /usr/bin/entrypoint.sh /usr/bin/ COPY scripts/entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh RUN chmod +x /usr/bin/entrypoint.sh
RUN find / -path /proc -prune -o -perm /4000 -exec chmod u-s {} \; RUN find / -path /proc -prune -o -perm /4000 -exec chmod u-s {} \;
RUN find / -path /proc -prune -o -perm /2000 -exec chmod g-s {} \; RUN find / -path /proc -prune -o -perm /2000 -exec chmod g-s {} \;
......
#!/bin/bash
# echo commands to the terminal output
set -ex
# Check whether there is a passwd entry for the container UID
myuid=$(id -u)
mygid=$(id -g)
# turn off -e for getent because it will return error code in anonymous uid case
set +e
uidentry=$(getent passwd $myuid)
set -e
echo $myuid
echo $mygid
echo $uidentry
# If there is no passwd entry for the container UID, attempt to create one
if [[ -z "$uidentry" ]] ; then
if [[ -w /etc/passwd ]] ; then
echo "$myuid:x:$myuid:$mygid:anonymous uid:$SPARK_HOME:/bin/false" >> /etc/passwd
else
echo "Container ENTRYPOINT failed to add passwd entry for anonymous UID"
fi
fi
exec /usr/bin/tini -s -- /usr/bin/spark-operator "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment