(Usage hints for this presentation)
VM Neuland im Internet 2021
Dr. Jens Lechtenbörger (License Information)
Virtualization software provides virtual hardware
Containerization (e.g., with Docker) as lightweight variant of virtualization
“Docker logo” under Docker Brand Guidelines; from Docker
“Kubernetes logo” under Kubernetes Branding Guidelines; from GitHub
FROM ubuntu LABEL maintainer="Jens Lechtenbörger" RUN apt-get update && apt-get --no-install-recommends install -y \ ca-certificates emacs git \ texlive-bibtex-extra texlive-fonts-recommended texlive-generic-recommended \ texlive-latex-base texlive-latex-extra texlive-latex-recommended COPY manage-packages.el /tmp/
hello-world
as instructed in
Get Started
docker image ls
docker container ls -all
docker container --help
docker container ls --help
docker rmi -f hello-world
docker run -p 8080:80 nginx
-p
: Web server listens on port 80 in container; bind
to port 8080 on host
--name my-nginx
: Assign name to container
for subsequent use
docker stop/start/logs/rm my-nginx
-v
in above docker run ...
(before nginx
)
-v /host-directory/with/html-files:/usr/share/nginx/html
/usr/share/nginx/html
is where nginx expects HTML files,
in particular index.html
docker run --name ...
docker start my-nginx
-p
with same port in several docker run
invocations
docker ps
: Note ID or namedocker stop <ID-or-name>
docker run ...
-v
nginx
with option -v
but your files do not appear
docker inspect <name-or-id-of-container>
binds
, telling you what is mapped to
/usr/share/nginx/html
-v C:\Users\...
with Powershell-v C:\\Users/...
with Bash-v /mnt/c/Users/...
with WSL terminal192.168.99.100
/c/Program Files/Docker Toolbox
C:\Users
can be mounted by default
docker run -p 8080:80 -v
/c/Users/<your-name>/<folder-with-index.html>:/usr/share/nginx/html nginx
This document is part of a larger course. Source code and source files are available on GitLab under free licenses.
Except where otherwise noted, the work “Docker Introduction”, © 2018-2021 Jens Lechtenbörger, is published under the Creative Commons license CC BY-SA 4.0.