# HG changeset patch # User Goffi # Date 1456779283 -3600 # Node ID a3f9cfa2721e8755de4ac1e512556d1312e4269a # Parent 51dc15fbd813325485a9d47596890d9944aff203 docker (libervia_cont): workaround for copying config when Docker version is below 1.8.0 diff -r 51dc15fbd813 -r a3f9cfa2721e docker/libervia_cont.sh --- a/docker/libervia_cont.sh Mon Feb 29 21:54:41 2016 +0100 +++ b/docker/libervia_cont.sh Mon Feb 29 21:54:43 2016 +0100 @@ -434,11 +434,17 @@ mkdir -p "$TMP_DIR" fi - docker cp "$VOLUME_ALIAS:$CONT_CONF_FILE" "$TMP_DIR/$HOST_CONF_FILE" + docker cp "$VOLUME_ALIAS:$CONT_CONF_FILE" "$TMP_DIR/" "$EDITOR" "$TMP_DIR/$HOST_CONF_FILE" if [ $? -eq 0 -a -s "$TMP_DIR/$HOST_CONF_FILE" ]; then printf "updating configuration\n" - docker cp "$TMP_DIR/$HOST_CONF_FILE" "$VOLUME_ALIAS:$CONT_CONF_FILE" + check_docker_version 1 8 0 + if [ $? -eq 0 ]; then + docker cp "$TMP_DIR/$HOST_CONF_FILE" "$VOLUME_ALIAS:$CONT_CONF_FILE" + else + eprintf "Old Docker version detected, using workaround, please update!\n" + docker run --rm $DK_VOLUME -v "$TMP_DIR:/tmp_config" debian:jessie /bin/cp -f "/tmp_config/$HOST_CONF_FILE" "$CONT_CONF_FILE" + fi fi rm -rf "$TMP_DIR" ;;