Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Docker
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Concepts== * Docker runs on a Host Operating System. * A '''Docker Container''' is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings, but in difference to VMs it does not include the (guest) OS layer (difference between Docker and VMs see [https://www.docker.com/resources/what-container here]). Containers isolate software from its environment and ensure that it works uniformly despite differences for instance between development and staging. Docker container have their own (temporary) file system. Docker Container are created when you run an image. * A Docker Container is running on the '''Docker Host'''. Multiple container can run on the same host. The '''Docker Daemon''' as part of the host manages the containers * A Docker Container can have the '''states''' 'created', 'running', 'restarting', 'exited', 'paused', 'dead'. There could be several reasons why a running container would exit. Let's look into a few of them: ** The process inside the container was completed, and so it exited. ** The process inside the container encountered an exception while running. ** A container is intentionally stopped using the docker stop command. ** No interactive terminal was set to a container running bash. * The '''Docker Client''' steers the daemon and is accessed via terminal (Powershell, Linux shell, β¦). * A '''Docker Image''' is a unmutable template with instructions for creating Docker containers and is build using a file called Docker file. The Docker image is stored in the Docker Hub or in a registry. * Docker image ---> commands (pull from repository, β¦) ---> Docker container * Images are stored in a registry, the public registry is '''Docker Hub'''. * '''Docker Volumes''' are used to store data and to share data across containers. ===Creating Images=== # create a file called 'Dockerfile'. Dockerfiles define images. # run the following command to build an image docker build Dockerfile -t <IMAGE_NAME> // docker push <IMAGE_NAME> =====Dockerfile===== Dockerfiles contain instructions. Comment lines starts with # (hash). Docker files consists of <INSTRUCTION> <ARGUMENTS>. The first instruction is always FROM <BASE_IMAGE> // which defines the parent or base image e.g. FROM Ubuntu, by default Docker Hub is used as registry Then the RUN is executed to install the application and packages which are required RUN apt-get install python Then copy source code e.g. COPY . /app // app is a directory of the container The work directory defines the directory for the commands e.g. WORKDIR /app To run something the RUN command is used e.g. RUN pip install flask Define default command CMD ... // e.g. 'CMD sleep 5' or 'CMD ["sleep","5"] or ENTRYPOINT["<COMMAND"] // e.g. 'ENTRYPOINT ["sleep"]' and call it with 'docker run <IMAGE_NAME> [<ENTRYPOINT_PARAMETER>] =====Analyzing Images===== * there is a tool called 'dive' to analyze images ===Volumes=== * Volumes are folder on the host which are mounted to a container. ===Networks=== The network in charge of the communication process between containers is by default the '''bridge''' network or the user-defined bridge networks. * host name from container <code>host.docker.internal</code> * default networks [[File:DockerNetwork1.PNG|400px]] * the docker engine has a internal DNS server [[File:DockerNetwork2.PNG|400px]]
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width