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

Disussion - Rule 8. End the Dockerfile with build and run commands #15

Closed
psychemedia opened this issue Oct 24, 2019 · 2 comments
Closed

Comments

@psychemedia
Copy link
Collaborator

This is an eminently sensible and practical rule, though it maybe also hints back to Rule 6?

The rationale is to make it easy for a novice to get started; as such, it makes sense to show how to:

  • deploy / run / access services (Rule 7);
  • mount data volumes (Rule 5)
  • pass in envt vars (eg Rule 6?)

Port mapping is something else to mention?

One note: don't do things like map: -p 8888:8888; for a novice, if I want to expose on localhost port 8899, which one do I change?

I think novices can also be confused by things in {}, things prefixed with $, etc; you also need to take care not to introduce platform shell dependencies in the way things are passed (Windows, Max/Linux vars / commands etc).

Generally, I try to remember to give an example of pretty much every likely command switch over several (explained/ contextualised) docker run commands.

If you are making your container available for other people to access from eg dockerhub, also provide a docker push command, along with relevant comments about tagging strategies used.

nuest added a commit that referenced this issue Dec 10, 2019
nuest added a commit that referenced this issue Dec 10, 2019
@nuest
Copy link
Owner

nuest commented Dec 10, 2019

I concur the ordering of ports in -p is a commonly faced problem, but also one that is widely documented > included in #46

Good point about potentially confusing examples > added to final checks at #7

It would be great if you could help out adding the several example commands where you see fit!

I would advice against docker push, because it is not transparent. Can you live with that?

@psychemedia
Copy link
Collaborator Author

Sorry, yes, I should try to make changes direct. Just a thought that comes to mind on things I've seen from command line that I don't remember offhand are in a rule elsewhere: docker can copy over local context when you build from a local directory, so if you have a huge datafile in the directory, or a subdir with lots of stuff in it (like a .git folder), then that can be copied into the Docker build context even if you don't call on it. .dockerignore is your friend here... It can save time and potentially save you from copying all that private patient data over to a remote build system...

@nuest nuest closed this as completed Mar 2, 2020
nuest added a commit that referenced this issue Mar 2, 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

No branches or pull requests

2 participants