(Usage hints for this presentation)
VM OER 2020/2021
Dr. Jens Lechtenbörger (License Information)
Virtualization software provides virtual hardware
“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 ...
with same 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 ...
192.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-2020 Jens Lechtenbörger, is published under the Creative Commons license CC BY-SA 4.0.