Browse Source

fix: [cron] ``dc`` command would fail in user environment

On user launched ``compose`` (using ``~/.compose/sessions`` as
session dir, the ``dc`` command would fail getting it's environment
file correctly, and subsequently would fail running.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/1/head
Valentin Lab 3 years ago
parent
commit
a43ab6d49c
  1. 8
      cron/hooks/init

8
cron/hooks/init

@ -19,6 +19,12 @@ fi
exit 1
}
[ "$HOST_COMPOSE_LAUNCHER_OPTS" ] || {
err "\$HOST_COMPOSE_LAUNCHER_OPTS is expected to be set."
exit 1
}
[ "$COMPOSE_LAUNCHER_BIN" ] || {
err "\$COMPOSE_LAUNCHER_BIN is expected to be set."
exit 1
@ -31,7 +37,7 @@ $CHARM_NAME:
- /etc/timezone:/etc/timezone:ro
- \$DOCKER_COMPOSE_PATH/bin/dc:/bin/dc:ro
- $COMPOSE_LAUNCHER_BIN:/bin/compose:ro
- $COMPOSE_LAUNCHER_OPTS:$COMPOSE_LAUNCHER_OPTS:ro
- $HOST_COMPOSE_LAUNCHER_OPTS:$COMPOSE_LAUNCHER_OPTS:ro
environment:
TZ: $timezone
COMPOSE_LAUNCHER_OPTS: $COMPOSE_LAUNCHER_OPTS

Loading…
Cancel
Save