primitive icon indicating copy to clipboard operation
primitive copied to clipboard

Add docker usage in README

Open alexandregv opened this issue 5 years ago • 2 comments

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.

alexandregv avatar Mar 01 '20 16:03 alexandregv

This seems useful.

laurenceforshaw avatar May 03 '20 22:05 laurenceforshaw

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.

alexandregv avatar May 04 '20 00:05 alexandregv