Reputation: 430
When you create a private container on Docker, it seems to me that there are two viable options :
1 - create a private container
2 - sharing the dockerfile on a private git repository.
I'm not sure about which approach I have to chose depending on my usage, (maybe both ?), so I wanted to know if someone is interested about sharing his experience with the subject.
Upvotes: 3
Views: 138
Reputation: 782
Both are effectively the same thing
A rough analogy would be saying:
You can choose anything.. but if the end user isn't interested in modifying the source, you might as well make it convenient for them and just share the compiled executable.
Same goes for the dockerfile or the image created using the dockerfile.
Upvotes: 3
Reputation: 28305
A Dockerfile is use to create a docker image by issuing
docker build --tag xxx .
Notice it ends with . to pickup the Dockerfile from the current dir (you can also give the path to a Dockerfile ) ... Now you can push that image to a repository for later use or to be shared. Keep in mind nothing is executing at this point ... you have just created an image which is just a chunk of code ... Sometime later you decide to launch an app using that image by doing
docker run -d -P --name cool-container-name image-name
Above creates a container called cool-container-name which is an instantiation of the docker image ... the container is executing the code as outlined in your Dockerfile
So now its clear we can share either a Dockerfile or an image, however since a container is a chunk of executing code its not what gets shared
Upvotes: 1