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 Dockerfile support #68

Merged
merged 1 commit into from
Jan 3, 2020
Merged

Add Dockerfile support #68

merged 1 commit into from
Jan 3, 2020

Conversation

pataquets
Copy link
Contributor

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

Install package dependencies, add files, set working dir and build. Nothing too fancy.

Build:

$ docker build -t dms .

Run:

$ docker run --net=host --rm -it -v /some/host/dir/:/var/lib/dms/ dms -path /var/lib/dms/ [other options...]

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

$ docker run --net=host --rm -it -v /some/host/dir/:/var/lib/dms/ pataquets/dms-src -path /var/lib/dms/ [other options...]

Using --rm instead of -d makes the container not go background and it to be deleted after stop. Should stop by CTRL+C'ing it.
Choose some existing media dir from your host filesystem to mount inside the container (-v switch).
Uses the --net=host switch to access the host's network stack instead of using container port mappings, for simplicity.

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.

@anacrolix anacrolix merged commit a66a0c9 into anacrolix:master Jan 3, 2020
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

2 participants