primitive
primitive copied to clipboard
Add docker usage in README
Just a quick PR to add a simple docker usage in the README.
It allows to run primitive without installing Go and primitive itself.
I was thinking to create a Dockerfile and maybe push the image on the DockerHub, but I though a simple one-liner would be enough since installing primitive in the base golang image is really quick. Let me know what you think about it.
This seems useful.
What solution is better in your oponion ?
- A simple one-liner, usable without even having to clone the repo
docker run -v ${PWD}:/tmp golang sh -c 'go get -u github.com/fogleman/primitive; primitive -i /tmp/input.png -o /tmp/output.png -n 100'`
- A Dockerfile, having to clone the repo and build the image
git clone https://github.com/fogleman/primitive.git
cd primitive
docker build -t primitive .
docker run -v ${PWD}:/tmp primitive -i /tmp/input.png -o /tmp/output.png -n 100
- The same Dockerfile, but with image published on the DockerHub, allowing users to run it directly
docker run -v ${PWD}:/tmp fogleman/primitive -i /tmp/input.png -o /tmp/output.png -n 100
Currently I only edited the README to include the first one-liner.
The "standard" way is the second, and the best for end-users is the third.