remove docker-in-docker - use volumes

This commit is contained in:
will Farrell 2017-02-12 16:57:19 -07:00
parent 816d1f0fd5
commit aa36fb61ef
5 changed files with 14 additions and 9 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
.idea .idea
*.iml *.iml
config.json home_dir

View File

@ -1,12 +1,9 @@
FROM library/alpine:3.5 FROM library/alpine:3.5
ENV HOME_DIR=/opt/crontab ENV HOME_DIR=/opt/crontab
RUN apk add --no-cache --virtual .run-deps bash curl jq docker \ RUN apk add --no-cache --virtual .run-deps bash curl jq \
&& mkdir -p ${HOME_DIR} && mkdir -p ${HOME_DIR}
# Dev
#COPY config.json ${HOME_DIR}/
COPY docker-entrypoint / COPY docker-entrypoint /
ENTRYPOINT ["/docker-entrypoint"] ENTRYPOINT ["/docker-entrypoint"]

View File

@ -1,6 +1,6 @@
# docker-crontab # docker-crontab
A simple wrapper over `docker` to all complex cron job to be run in other containers. A simple wrapper over `docker` to all complex cron job to be run in other containers. All in <45MB.
## Supported tags and Dockerfile links ## Supported tags and Dockerfile links
@ -10,7 +10,7 @@ A simple wrapper over `docker` to all complex cron job to be run in other contai
## Why? ## Why?
Yes, I'm aware of [mcuadros/ofelia](https://github.com/mcuadros/ofelia), it was the main inspiration for this project. Yes, I'm aware of [mcuadros/ofelia](https://github.com/mcuadros/ofelia) (280MB), it was the main inspiration for this project.
A great project, don't get me wrong. It was just missing certain key enterprise features I felt were required to support where docker is heading. A great project, don't get me wrong. It was just missing certain key enterprise features I felt were required to support where docker is heading.
## Features ## Features
@ -40,6 +40,8 @@ See `./config.sample.json` for examples.
docer build -t crontab . docer build -t crontab .
docker run -d \ docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock \ -v /var/run/docker.sock:/var/run/docker.sock \
-v /usr/bin/docker:/usr/bin/docker \
-v /path/to/config/dir:/opt/crontab \
crontab crontab
``` ```

View File

@ -11,3 +11,5 @@ services:
restart: always restart: always
volumes: volumes:
- "/var/run/docker.sock:/var/run/docker.sock" - "/var/run/docker.sock:/var/run/docker.sock"
- "/usr/bin/docker:/usr/bin/docker"
- "/Users/willfarrell/Development/docker/crontab/home_dir:/opt/crontab"

View File

@ -156,8 +156,12 @@ function build_crontab() {
# Used to pass json to functions - total hack, I know # Used to pass json to functions - total hack, I know
TMP_JSON= TMP_JSON=
if [ "$1" = "crond" ] && [ -f ${CONFIG} ]; then if [ "$1" = "crond" ]; then
build_crontab if [ -f ${CONFIG} ]; then
build_crontab
else
echo "Unable to find ${HOME_DIR}/config.json"
fi
fi fi
echo "$@" echo "$@"