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 #16

Merged
merged 2 commits into from
Jan 10, 2018
Merged

Add Docker support #16

merged 2 commits into from
Jan 10, 2018

Conversation

pataquets
Copy link
Contributor

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

Just adding files, setting working dir and running build instructions.
I've hardcoded --bind 0.0.0.0 option in the entrypoint, since tsproxy won't be reachable from outside the container, otherwise.

Build:

$ docker build -t tsproxy .

Run:

$ docker run --rm -it -p 1080:1080 tsproxy [tsproxy options]

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

$ docker run --rm -it -p 1080:1080 pataquets/tsproxy [tsproxy options]

Using --rm causes the container to be deleted after stop.

Optional improvement to come (maybe in another issue):

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

@pmeenan
Copy link
Contributor

pmeenan commented Jan 9, 2018

Any chance you can also create a docker readme markdown file with the options for running it?

I already have a dockerhub org so adding tsproxy will be trivial - just want to have a doc to point it to as well.

@pataquets
Copy link
Contributor Author

Done. Hope I've referenced the right org.

@pmeenan pmeenan merged commit 100fc3e into catchpoint:master Jan 10, 2018
@pmeenan
Copy link
Contributor

pmeenan commented Jan 10, 2018

Thanks. Project is set up and builds have been kicked off: https://hub.docker.com/r/webpagetest/tsproxy/builds/

@pataquets
Copy link
Contributor Author

Great!
It should be possible to tweak the automatically generated image tags from the AB configuration settings to map 'tsproxy-1.0' git tags to '1.0' image tags by using some regexp, but I've not done it previously.
Head to https://hub.docker.com/r/webpagetest/tsproxy/~/settings/automated-builds/ if interested.

Also I'm deleting my image on Docker Hub to avoid confusing users.

@pataquets
Copy link
Contributor Author

pataquets commented Jul 26, 2018

@pmeenan: I've seen there has been a commit that successfully triggered its corresponding image build on DH. However, it's not tagged and it would be an ideal test to the 'tag built image from git tags' mapping I propose above.
Currently, built image:tags look kinda redundant: docker pull webpagetest/tsproxy:tsproxy-1.0. I think it would be better to trim the tsproxy- git tag prefix when mapping into an image tag.

@pmeenan
Copy link
Contributor

pmeenan commented Jul 26, 2018

Looks like the regex is for selecting the tags to build and there is limited control for changing the name. The basic solution is to keep the release tags here simple and just tag it 1.0, 1.1, etc. I'll try tagging the latest as 1.1 and see how it goes.

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.

2 participants