Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker support #317

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

pataquets
Copy link

@pataquets pataquets commented May 7, 2020

Thank you very much for this awesome piece of software. As I've started to tinker with it, I'd like to share the Dockerfile which enabled a Docker workflow for me.

Add Dockerfile to enable image building. Useful for development and tests under Docker workflow.
Using the official Python 3 image, latest tag. More info at https://hub.docker.com/_/python/

Just adding files, setting working dir and running install and build instructions. requirements.txt is added and pip install'ed in a separate step to speed up rebuilds, since it will take advantage of Docker image build layer caching on subsequent builds after modifying code.

Build:

$ docker build -t grip .

Build (no checkout needed):

$ docker build -t grip https://github.com/pataquets/grip#add-docker-support.

Run:

$ docker run --rm -it -v ${PWD}:/grip/ -p 6419:6419 grip [options...] /grip/ 0.0.0.0

FYI, there's a still quicker to test, already built image old image on my Docker Hub. Test it by running:

$ docker run --rm -it -v ${PWD}:/grip/ -p 6419:6419 pataquets/grip-src [options...] /grip/ 0.0.0.0

The examples mount the current dir inside the Docker container (-v) and map container's internal port to outside host (p). Adding 0.0.0.0 is required, since otherwise container's localhost would not be reachable from outside (the host).
Using --rm causes container it to be deleted after stop and -it makes the container not to go background and run interactively. Stop by CTRL+C'ing.

Optional improvement to come (maybe in another issue):

  • Create an 'official', based on your repo, automated build using Github Actions at Docker Hub for the image: https://docs.docker.com/docker-hub/builds/ . Just requires a free Docker Hub account and a separate PR following a quick 'Create automated build' process. I'll be happy to help on it, if needed.

@pataquets
Copy link
Author

@joeyespo ping

@pataquets
Copy link
Author

@joeyespo Is grip still maintained? I have also a few changes lying around and would like to send them in return, too. No obligation, thou. In case you're no longer interested, you might find this useful: https://adoptoposs.org/
In any case, thanks for sharing this useful software!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant