7 Commits
0.2.0 ... 0.4.0

Author SHA1 Message Date
02a89f6dac fix: clean up logic and only apply group if needed 2018-06-30 15:23:27 -06:00
b89e312569 fix: Change group id
Change group id to not conflict with host common id

Fix #13
2018-02-27 23:44:47 -07:00
f601ca262d Merge pull request #11 from kendokan/master
fixed failure if docker group already existed
2018-01-11 09:15:18 -07:00
b52842b07a fixed failure if docker group already existed
This error prevents the container from restarting.
2018-01-11 08:13:11 -08:00
147e900f8b Merge pull request #10 from kendokan/master
fixed https://github.com/willfarrell/docker-crontab/issues/9
2018-01-09 20:16:50 -07:00
40b8b93c2a fixed https://github.com/willfarrell/docker-crontab/issues/9 2018-01-09 13:17:49 -08:00
d5cfe3bc76 #6 Added adduser to the build script 2017-11-14 14:04:30 -07:00
3 changed files with 16 additions and 2 deletions

View File

@ -2,7 +2,8 @@ FROM library/docker:stable
ENV HOME_DIR=/opt/crontab ENV HOME_DIR=/opt/crontab
RUN apk add --no-cache --virtual .run-deps bash jq \ RUN apk add --no-cache --virtual .run-deps bash jq \
&& mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects && mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects \
&& adduser -S docker -D
COPY docker-entrypoint / COPY docker-entrypoint /
ENTRYPOINT ["/docker-entrypoint"] ENTRYPOINT ["/docker-entrypoint"]
@ -10,4 +11,4 @@ ENTRYPOINT ["/docker-entrypoint"]
HEALTHCHECK --interval=5s --timeout=3s \ HEALTHCHECK --interval=5s --timeout=3s \
CMD ps aux | grep '[c]rond' || exit 1 CMD ps aux | grep '[c]rond' || exit 1
CMD ["crond","-f"] CMD ["crond","-f"]

View File

@ -22,6 +22,17 @@ CRONTAB_FILE=/etc/crontabs/docker
# Ensure dir exist - in case of volume mapping # Ensure dir exist - in case of volume mapping
mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects
# Create docker group using correct gid from host, and add docker user to it
if ! grep -q "^docker:" /etc/group; then
DOCKER_GID=$(stat -c '%g' ${DOCKER_SOCK})
if [ "${DOCKER_GID}" != "0" ]; then
addgroup -g ${DOCKER_GID} docker
adduser docker docker
else
adduser docker root
fi
fi
slugify() { slugify() {
echo "$@" | iconv -t ascii | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z echo "$@" | iconv -t ascii | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
} }

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
# This file is for testing the logging of docker output #8
LOG_FILE=./jobs.log LOG_FILE=./jobs.log
touch ${LOG_FILE} touch ${LOG_FILE}
UUID="xxxxxxxxxxxxxxxxx" UUID="xxxxxxxxxxxxxxxxx"