add simple entrypoint script
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2019-03-12 11:18:14 +01:00
parent a5944e43eb
commit 8ef1761404
2 changed files with 20 additions and 0 deletions

17
docker-entrypoint.sh Normal file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
if [ "${GCE_SSH_KEY}" ]; then
echo "${GCE_SSH_KEY}" > $HOME/.ssh/google_compute_engine
chmod 600 $HOME/.ssh/google_compute_engine
fi
if [ "${GCE_CREDENTIALS_JSON}" ] && [ "${GCE_CREDENTIALS_FILE}" ]; then
DIR=$(dirname "${GCE_CREDENTIALS_FILE}")
mkdir -p "${DIR}"
echo "${GCE_CREDENTIALS_JSON}" > "${GCE_CREDENTIALS_FILE}"
fi
if [ "${MOLECULE_CUSTOM_MODULES_REPO}" ]; then
mkdir ./library/
git clone "${MOLECULE_CUSTOM_MODULES_REPO}" ./library/
fi

View File

@ -20,6 +20,8 @@ ENV PIP_PACKAGES="\
pycrypto \ pycrypto \
" "
COPY ./docker-entrypoint.sh /
RUN \ RUN \
apk update \ apk update \
&& apk add --update --no-cache ${PACKAGES} \ && apk add --update --no-cache ${PACKAGES} \
@ -32,3 +34,4 @@ RUN \
USER root USER root
ENV SHELL /bin/bash ENV SHELL /bin/bash
ENTRYPOINT ["/docker-entrypoint.sh"]