Trying to wrap my head around docker so any advice is most appreciated.
Install docker
Write a docker file that has commands that will install an image, e.g. ubuntu, step into that image and install any ubuntu updates I may want.
Install using the docker file any extra environment files I might need say a language (ruby, node, php).
Install git from the docker file and have that download a project into the environment
Create a config file so that the container ports are open to the ports I want to use (server)
Run the docker file which will run the image and any cli commands like starting the server, getting data from github etc.
save docker container as new image?
Hoping someone can clarify it is used in this way and add anything I should do or have missed.
Other questions are - if I am sending this to a host, is the host going to take the container or the contents of the container aka ubuntu and just run that? If it takes the container does it mean the host has pre-installed docker and is setup for it (as another layer).
That is pretty much the way it works, although the commands are different. Once you have it all built up the way you want it and have it all set in the dockerfile, you would use docker build to create one single image out of all the pieces. So you wouldnāt have to redo it all to get it setup again. As long as you donāt remove that image, you can remove all the pieces you pulled down to free up some space. As for the second question as long as it uses that same created image it would get everything the first machine had. I am uncertain of what you mean by āsending it to a host.ā If you upload it to the Docker Store, then once the new machine has docker installed, it could pull that single image down and use it, yes. If it has proprietary info in it the you would have to use your free private repository. Or. if you need more than one, go to this web pageā¦ https://www.docker.com/pricing#/pricing_cloud ā¦ their pretty reasonable. (and No, I donāt work for them, I just wish I did )
My badā¦ the images do not combine to a single one, they just look like they do when running. To put it on a new machine, just copy the dockerfile to it and then do a ādocker build dockerfileā and it will install every thing to the new machine. There is never a āsingleā image, just a combination that looks that way.