maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
227 stars 24 forks source link

Enable mounting config while using docker #48

Closed addshore closed 5 years ago

addshore commented 6 years ago

So the main thing that stops a user from being able to mount a config into the image while using docker to run the command is the fact that the config file is in the same dir as the code.

For example, in the docker image currently the config is @ /usr/local/lib/node_modules/wikidata-cli/config.json

If we could change that to /usr/local/lib/node_modules/wikidata-cli/config/config.json then the config dir could be mounted from the local system when running using docker. This would mean the config could persist between containers.

the via docker README could then be updated to show

# Might require to be run with sudo depending on your Docker installation
docker run --rm -it maxlath/wikidata-cli
# If you want to mount a local file for the config
docker run --rm -it -v /home/addshore/.config-wikidata-cli:/usr/local/lib/node_modules/wikidata-cli/config maxlath/wikidata-cli
# You can make an alias out of it:
alias wd="docker run --rm -t maxlath/wikidata-cli"
maxlath commented 5 years ago

solved by 89ba3b0