Beruflich Dokumente
Kultur Dokumente
Containers have also been seen as less secure than the full
isolation of hypervisor virtualization.
Requirements:
$ uname -a
$ ls -l /sys/class/misc/device-mapper
$ sudo grep device-mapper /proc/devices
#wget https://download.docker.com/linux/centos/docker-
ce.repo -O /etc/yum.repos.d/docker-ce.repo
# yum install docker-ce -y
# systemctl start docker
# systemctl enable docker
# systemctl status docker
Installing Docker
# docker version
#docker info
#docker images
#docker ps
Getting Started with Docker
Now let's try and launch our first container with Docker. We're
going to use the docker run command to create a container.
The docker run command provides all of the "launch" capabilities
for Docker.
We'll be using it a lot to create new containers.
#docker run hello-world
#docker run -i -t ubuntu /bin/bash
Getting Started with Docker
Container naming
#docker ps
#docker ps -a
#docker start bob_the_container
#docker start aa3f365f0f4e
Getting Started with Docker
Attaching to a container
Deleting a container
#docker rm 80430f8d0921
#docker rm `docker ps -a -q`
Working with Docker images and repositories
#docker images
#docker pull fedora
#docker images fedora
#docker search puppet
#docker pull jamtur01/puppetmaster
Working with Docker images and repositories
# mkdir -p /data/docker/mysql
# mkdir -p /data/docker/mysql/database
# ls -l /data/docker/mysql/database/
# docker ps
Data-only containers
Sharing data between containers
Data-only containers
Sharing data between containers
Each Docker container has its own network stack, and this is due
to the Linux kernel NET namespace, where a new NET
namespace for each container is instantiated and cannot be seen
from outside the container or from other containers.
docker0 can be configured via the --net flag and has, in general,
four modes:
--net default
--net=none
--net=container:$container2
--net=host
Networking and Docker
With this mode, the container created is truly isolated and cannot
connect to the network.
Networking and Docker
# docker network ls
# ifconfig |more
# brctl show