feat: Adds entrypoint.sh script to docker to allow attaching to a shell inside the container.
This commit is contained in:
@@ -55,6 +55,8 @@ RUN export DEBIAN_FRONTEND=nointeractive DEBCONF_NOINTERACTIVE_SEEN=true && \
|
||||
&& rm -r /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=build /staging/hpa /usr/local/bin
|
||||
COPY docker/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Setup volumes
|
||||
RUN mkdir /config && \
|
||||
@@ -67,5 +69,5 @@ RUN mkdir /config && \
|
||||
|
||||
VOLUME /config /consults /playbook /template
|
||||
|
||||
ENTRYPOINT [ "/usr/local/bin/hpa" ]
|
||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||
CMD ["--help"]
|
||||
|
||||
19
docker/entrypoint.sh
Normal file
19
docker/entrypoint.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Allows to attach to a shell inside the container, otherwise run the 'hpa' script
|
||||
# with the given arguments.
|
||||
#
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "/bin/bash" ]] || [[ $1 == "bash" ]]; then
|
||||
shift
|
||||
/bin/bash "$@"
|
||||
exit $?
|
||||
elif [[ $1 == "/bin/sh" ]] || [[ $1 == "sh" ]]; then
|
||||
shift
|
||||
/bin/sh "$@"
|
||||
exit $?
|
||||
else
|
||||
/usr/local/bin/hpa "$@"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
Reference in New Issue
Block a user