Virtualization refers to the use of software to simulate portions of a computer system.
Virtualization presents the simulation of a guest machine via special software running on a host machine.
Forms of virtualization:
a.k.a., emulation
These include the first virtualization systems (IBM 1966), often used to avoid/delay porting large application systems.
More modern instances:
a.k.a., OS-assisted virtualization, a.k.a., hypervisors
Architectures:
a.k.a., type 2 hypervisor, client hypervisor
Runs the simulation as a host OS application.
a.k.a. type 1 hypervisor, bare metal hypervisor
The simulator is a “thin” OS sitting on top of the hardware.
Instances:
chroot
docker
hosted on Windows can virutalize wither Linux or Windows (but not both)Docker containers are defined in a dockerfile, e.g.:
Dockerfile
FROM nginx:1.10
RUN apt-get clean && apt-get update && apt-get install -y nano spawn-fcgi fcgiwrap wget curl libxml2-dev libxslt1-dev
RUN [ "apt-get", "install", "-qy", "--force-yes", \
"perl", \
"build-essential", \
"cpanminus", \
"libxml-libxslt-perl" \
]
RUN ["cpanm", "CGI"]
RUN ["cpanm", "LockFile::Simple"]
RUN sed -i 's/www-data/nginx/g' /etc/init.d/fcgiwrap
RUN chown nginx:nginx /etc/init.d/fcgiwrap
COPY ./vhost.conf /etc/nginx/conf.d/default.conf
COPY ./htpasswd /etc/nginx/htpasswd
WORKDIR /var/www
CMD /etc/init.d/fcgiwrap start \
&& nginx -g 'daemon off;'
FROM
command lists a base machine definition (on DockerHub) that we use as the starting point.
RUN
and COPY
commands are a script to install various additional Linux packages onto that machine and copy some web content into place.CMD
command launches programs to perform a computation or to start up a service.
The Docker Compose facility allows you to launch a collection of separate virtual machines, each providing a specialized service, and connect them together, e.g.,
docker-compose.yml
version: '3'
services:
web:
container_name: web_cgi_server
build:
context: .
volumes:
- ./../build/website:/var/www
- ./../build/log:/var/log/nginx/web
ports:
- "8081:80"
This launches web_cgi_server
(defined in the DockerFile
just shown)
/var/www
directory (from which web content is served) mapped onto my ../build/website
directory.../build/log
directory.Remember that “Infrastructure as Data” was one of the defining principles of DevOps.