mirror of
https://github.com/willfarrell/docker-crontab.git
synced 2025-04-04 14:05:11 +02:00
bug fix
only first w/ onstart was triggered
This commit is contained in:
parent
c4a114a31c
commit
76675e99d5
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
*.iml
|
||||
|
||||
home_dir
|
||||
config.json
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM library/docker:1.13
|
||||
FROM library/docker:stable
|
||||
|
||||
ENV HOME_DIR=/opt/crontab
|
||||
RUN apk add --no-cache --virtual .run-deps bash jq \
|
||||
|
@ -60,7 +60,7 @@ See [`config.sample.json`](https://github.com/willfarrell/docker-crontab/blob/ma
|
||||
docer build -t crontab .
|
||||
docker run -d \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
-v /usr/bin/docker:/usr/bin/docker:ro \
|
||||
-v ./env:/opt/env:ro \
|
||||
-v /path/to/config/dir:/opt/crontab:rw \
|
||||
crontab
|
||||
```
|
||||
|
@ -12,4 +12,4 @@ services:
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
# - "/usr/bin/docker:/usr/bin/docker:ro"
|
||||
- "/Users/willfarrell/Development/docker/crontab/home_dir:/opt/crontab:rw"
|
||||
- "/Users/willfarrell/Development/docker/docker-crontab/home_dir:/opt/crontab:rw"
|
||||
|
@ -12,6 +12,9 @@ CONFIG=${HOME_DIR}/config.json
|
||||
DOCKER_SOCK=/var/run/docker.sock
|
||||
CRONTAB_FILE=/etc/crontabs/docker
|
||||
|
||||
# Ensure dir exist - in case of volume mapping
|
||||
mkdir -p ${HOME_DIR}/jobs ${HOME_DIR}/projects
|
||||
|
||||
make_image_cmd() {
|
||||
DOCKERARGS=$(echo ${1} | jq -r .dockerargs)
|
||||
if [ "${DOCKERARGS}" == "null" ]; then DOCKERARGS=; fi
|
||||
@ -168,7 +171,7 @@ EOF
|
||||
cat ${CRONTAB_FILE}
|
||||
|
||||
echo "##### run commands with onstart #####"
|
||||
for COMMAND in "${ONSTART}"; do
|
||||
for COMMAND in "${ONSTART[@]}"; do
|
||||
echo "${COMMAND}"
|
||||
${COMMAND} &
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user