Skip to content

docker-entrypoint.sh has a subtle bug #10

@littlefyr

Description

@littlefyr

If for some reason the startup process is interupted, such that ./osrm-extract $DATA_PATH/$2.osm.pbf completes but ./osrm-contract $DATA_PATH/$2.osrm does not, you will never actually be able to initialize the data correctly.

It would be more robust if you did something like

if [ ! -f $DATA_PATH/$2.initialized ]; then
    if [ ! -f $DATA_PATH/$2.osm.pbf ]; then
        curl $3 > $DATA_PATH/$2.osm.pbf
    fi
    if [ ! -f $DATA_PATH/$2.osrm ]; then
        ./osrm-extract $DATA_PATH/$2.osm.pbf
    fi
    ./osrm-contract $DATA_PATH/$2.osrm
    touch $DATA_PATH/$2.initialized
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions