Man page for dockerfile: http://bit.ly/2jdIkV2
Docker documentation on Dockerfile: https://docs.docker.com/engine/reference/builder/
Explanation of the main instructions.
The FROM instructions tells docker which image to use, the "AS name" can be used to give a new name for an image for a new build stage in the Dockerfile. Only the ARG instruction can go above the FROM.
FROM <image> [AS <name>]
FROM <image>[:<tag>] [AS <name>]
FROM <image>[@<digest>] [AS <name>]
The RUN instruction has two forms, notice the square brackets when using the exec form. You can have a number of RUN instruction that run one after another, performing commits after each. The exec form does not read environment variables, as it does not invoke a command shell, use shell form if you want to use variables.
Shell form: RUN <command>
Exec form: RUN ["executable", "param1", "param2"]
The CMD instruction has three forms and you can only have one CMD instruction, if you have more than one the last one is used. The main purpose for the CMD is to provide defaults to the executing container. Many people get confused when beginning to use Dockerfiles, asking what the difference between RUN & CMD is, RUN actually executes commands and CMD does not, CMD specifies the intended command for the image.
Exec form: CMD ["executable","param1","param2"]
Defaults to ENTRYPOINT: CMD ["param1","param2"]
Shell form: CMD command param1 param2
The ENTRYPOINT instruction allows you to configure a container that will run as an executable. There are two forms of ENTRYPOINT
Exec form: ENTRYPOINT ["executable", "param1", "param2"]
Shell form: ENTRYPOINT command param1 param2
It executes as follows:
If in shell form then CMD and Docker run arguments are ignored
if in exec form and docker run arguments specified, it overrides CMD
if in exec form and CMD is specified, it will use CMD
The ENV instruction has two forms, and specified an environment variable.
ENV key value
Allows multiple variables ENV key1=value1 key2=value2 ...
The LABEL adds metadata to an image.
LABEL <key>=<value> <key>=<value> <key>=<value> ...
The EXPOSE tell the docker daemon what port(s) the container will have exposed. The -p & -P in docker run actually do the publishing of the ports.
EXPOSE <port> [<port>/<protocol>...]
The USER instruction switch to the user, which much exist for it to switch to it.
The WORKDIR instruction sets the working directory, it's like using $ cd on the command line. It can be combined with ENV variables.
The COPY instruction copeis files or directories from src to dest on the container. It has two forms, the second form is used for white space paths
COPY <src>... <dest>
COPY ["<src>",... "<dest>"]
The ADD instruction is similar to COPY, but moves file or directories to the container.
The VOLUME instruction creates a mount point on the container from the host or other computer.
virsh, is the part of Kernel-based Virtual Machines, (KVM), virsh is part of the libvirt-client package.
It allow you to create, configure, pause, list, and shutting down virtual machines, as well as manage virtual networks & loading virtual machine disk images.
As this is a command line tool, you can script around it.
VMware vSphere is a whole suite of VMware products.
It can be split into two sections, Infrastructure software & Application Software.
Infrastructure Software include components like:
VMWare ESXi Server and all its components & vCenter server..
Application Software include components like:
vMotion, Storage vMotion, vCloud, VMware tools...
To configure virtual machines, you use the VMware vSphere client, either web based or desktop software.
The vSphere client communicated with the vCenter server, which is either installed on a windows server or as a virtual appliance.
The high level workflow is vSphere client -> vCenter Server(s) -> VMware ESXi hosts
Full virtualization A virtualization where the Virtualization Layer directly interacts the with underlying hardware, the guest has a full operating system. Examples are: VMware Vsphere & Oracle Virtualbox
Paravirtualization Uses a modified OS, to have a hypervisor to create virtual guest machines, the guest is aware that it is part of a bigger machine sharing resources. Examples are XEN
Also see: Difference between type-1 & type-2 hypervisors
Type-1 - Is where the hypervisor is built into the machine hardware or integrated into the operating system, then after boot up of the machine, virtual machines are created using this built-in hypervisor.
Some examples are: Xen, ESXi Hyper-V, & KVM.
Type-2 - is where additional software is installed on top of the operating system, then virtual machines are created using this software.
Some examples are: Virtualbox, Parallels, & VMware Player.