Editing Docker

Jump to navigation Jump to search

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.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
[[wikipedia:Docker_(software)|Docker]] is a software utility to pack, ship and run any [[container]]s application available since March [[2013]].
 
[[wikipedia:Docker_(software)|Docker]] is a software utility to pack, ship and run any [[container]]s application available since March [[2013]].
* [[Google trends]]: https://trends.google.com/trends/explore?date=all&q=Docker
 
* <code>[[docker --help]]</code>
 
  
 
== Features ==
 
== Features ==
 
Docker offer the following features:
 
Docker offer the following features:
 
* Package an application and its dependencies in a virtual container that can run on any Linux server ([[docker images]])
 
* Package an application and its dependencies in a virtual container that can run on any Linux server ([[docker images]])
* Pull or push [[docker images]] to a [[container repository]]/[[container registry]] (<code>[[docker pull]]</code><ref>https://docs.docker.com/engine/reference/commandline/pull/</ref>, <code>[[docker push]]</code>). By default docker hub but you can specify any other registry.
+
* Pull or push [[docker images]] to a [[container repository]]/container registry (<code>[[docker pull]]</code><ref>https://docs.docker.com/engine/reference/commandline/pull/</ref>, <code>[[docker push]]</code>). By default docker hub but you can specify any other registry.
  
 
== Installing Docker ==
 
== Installing Docker ==
Line 12: Line 10:
  
 
On macOS you can follow official documentation https://docs.docker.com/docker-for-mac/install/ which requires to create and account to download installer. You can also try:
 
On macOS you can follow official documentation https://docs.docker.com/docker-for-mac/install/ which requires to create and account to download installer. You can also try:
<code>[[brew cask install docker]]</code> or try to follow https://pilsniak.com/how-to-install-docker-on-mac-os-using-brew/ instructions:
+
<code>brew cask install docker</code> or try to follow https://pilsniak.com/how-to-install-docker-on-mac-os-using-brew/ instructions:
 
: <code>brew install docker [[docker-compose]] docker-machine</code>(to install docker and docker-compose)
 
: <code>brew install docker [[docker-compose]] docker-machine</code>(to install docker and docker-compose)
 
: <code>brew cask install virtualbox</code>
 
: <code>brew cask install virtualbox</code>
Line 21: Line 19:
 
: <code>[[docker run]] hello-world</code> (will pull hello-world image and run it on docker)
 
: <code>[[docker run]] hello-world</code> (will pull hello-world image and run it on docker)
  
=== Ubuntu ===
+
On Ubuntu:
 
* <code>[[apt install docker.io]]</code>
 
* <code>[[apt install docker.io]]</code>
 
*  <code>[[snap]] install docker</code> (officially provided by [[Canonical]])
 
*  <code>[[snap]] install docker</code> (officially provided by [[Canonical]])
Line 34: Line 32:
 
=== Configuration files ===
 
=== Configuration files ===
 
Ubuntu:
 
Ubuntu:
* <code>[[/etc/docker/daemon.json]]</code> (Ref: https://docs.docker.com/engine/reference/commandline/dockerd/)
+
* <code>/etc/docker/[[daemon.json]]</code> (Ref: https://docs.docker.com/engine/reference/commandline/dockerd/)
 
* <code>/etc/docker/[[key.json]]</code>
 
* <code>/etc/docker/[[key.json]]</code>
  
 
=== Directories ===
 
=== Directories ===
  [[/var/lib/docker/]] (The Docker daemon was explicitly designed to have exclusive access to)<ref>https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/</ref>
+
  [[/var/lib/]]docker (The Docker daemon was explicitly designed to have exclusive access to)<ref>https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/</ref>
  
 
== Docker Releases  ([[Docker Engine release notes]]) ==
 
== Docker Releases  ([[Docker Engine release notes]]) ==
Line 46: Line 44:
 
You can download Docker CE source code from GitHub<ref>https://github.com/docker/docker-ce/releases</ref>.
 
You can download Docker CE source code from GitHub<ref>https://github.com/docker/docker-ce/releases</ref>.
  
== Docker Command Line ==
+
= Docker Command Line =
 
You can read official docker command line documentation in https://docs.docker.com/engine/reference/commandline/docker/. Before being able to run docker commands you will have to install Docker on your machine.
 
You can read official docker command line documentation in https://docs.docker.com/engine/reference/commandline/docker/. Before being able to run docker commands you will have to install Docker on your machine.
  
Line 84: Line 82:
  
 
== Docker image and container creation ==
 
== Docker image and container creation ==
* Create a new [[docker image]] base on ''alpine'' linux distribution and login into the new container: <code>[[docker run]] -it alpine sh</code>
+
* Create a new docker image base on ''alpine'' linux distribution and login into the new container: <code>[[docker run]] -it alpine sh</code>
 
* Create a new docker image: <code>[[docker build]]</code>
 
* Create a new docker image: <code>[[docker build]]</code>
 
** Create a new docker image by creating a new text file with instructions, usually called <code>[[Dockerfile]]</code><ref>https://docs.docker.com/engine/reference/builder/</ref>: <code>docker build -f /path/to/a/Dockerfile .</code>
 
** Create a new docker image by creating a new text file with instructions, usually called <code>[[Dockerfile]]</code><ref>https://docs.docker.com/engine/reference/builder/</ref>: <code>docker build -f /path/to/a/Dockerfile .</code>
Line 102: Line 100:
 
** <code>docker container ls -a </code>. See also <code>[[docker-compose]] ps</code>
 
** <code>docker container ls -a </code>. See also <code>[[docker-compose]] ps</code>
  
* '''Login'''/[[Connect into a running container]]:
+
* '''Login/Connect''' into a running container:
 
** <code>[[docker exec]]<ref>https://docs.docker.com/engine/reference/commandline/exec/</ref> -it <my_container_name> bash</code>
 
** <code>[[docker exec]]<ref>https://docs.docker.com/engine/reference/commandline/exec/</ref> -it <my_container_name> bash</code>
 
** <code>docker exec -it <my_container_name> sh</code>
 
** <code>docker exec -it <my_container_name> sh</code>
** <code>[[docker run]] -it --user USER_NAME CONTAINER_NAME</code>
+
** <code> docker run -it --user USER_NAME CONTAINER_NAME</code>
  
 
*  '''Start''' stopped containers: <code>docker start $(docker ps -a -q -f status=exited)</code>
 
*  '''Start''' stopped containers: <code>docker start $(docker ps -a -q -f status=exited)</code>
* '''Restart''' all containers: <code>[[docker restart]] $(docker ps -aq)</code> previously <code>docker restart $(docker ps -q)</code><code>-a all -q quiet</code><ref>https://stackoverflow.com/questions/38221463/command-for-restarting-all-running-docker-containers</ref>
+
* '''Restart''' all containers: <code>docker restart $(docker ps -aq)</code> previously <code>docker restart $(docker ps -q)</code><code>-a all -q quiet</code><ref>https://stackoverflow.com/questions/38221463/command-for-restarting-all-running-docker-containers</ref>
  
 
* [[Start configuration behavior and restart policy]]<ref>https://docs.docker.com/config/containers/start-containers-automatically/#use-a-restart-policy</ref>  
 
* [[Start configuration behavior and restart policy]]<ref>https://docs.docker.com/config/containers/start-containers-automatically/#use-a-restart-policy</ref>  
Line 130: Line 128:
  
 
=== Docker: Working with remote repositories/registries ===
 
=== Docker: Working with remote repositories/registries ===
You will be using mainly the following commands <code>[[docker login]]</code>, <code>[[docker logout]]</code>, <code>[[docker pull]]</code> and <code>docker push</code>. Docker registry allow to configure notifications. <ref>https://docs.docker.com/registry/notifications/</ref>. Docker has a public repository called Docker Hub and cloud providers offer repositories services such as AWS Elastic Container Registry (ECR).
+
You will be using mainly the following commands <code>[[docker login]]</code>, <code>docker logout</code>, <code>[[docker pull]]</code> and <code>docker push</code>. Docker registry allow to configure notifications. <ref>https://docs.docker.com/registry/notifications/</ref>. Docker has a public repository called Docker Hub and cloud providers offer repositories services such as AWS Elastic Container Registry (ECR).
  
 
=== Docker Information ===
 
=== Docker Information ===
Line 166: Line 164:
 
=== [[Docker Volumes]] ===
 
=== [[Docker Volumes]] ===
 
{{docker volumes}}
 
{{docker volumes}}
 
Related terms: [[Bind Mounts]]
 
  
 
=== Secrets ===
 
=== Secrets ===
Line 178: Line 174:
 
* <code>[[docker registry]]</code>
 
* <code>[[docker registry]]</code>
 
* [[OverlayFS]]
 
* [[OverlayFS]]
* [[Docker Enterprise]] (2017)
 
* [[Docker Desktop on Windows]] ~ 500 MB
 
* [[Benjamin Golub]]
 
* [[Docker download rate limit]] <ref>https://docs.docker.com/docker-hub/download-rate-limit/</ref>
 
* [[Docker Swarm]], [[Docker Scout]]
 
* <code>[[crane]]</code> tool for interacting with [[remote images]] and [[registries]].
 
* [[systemctl restart]]
 
  
 
== Activities ==
 
== Activities ==
 
# Read docker blog: https://blog.docker.com/
 
# Read docker blog: https://blog.docker.com/
 
# Read [[Docker Engine release notes]] (2017) and [[Docker CE]] or [[Docker EE]] releases.
 
# Read [[Docker Engine release notes]] (2017) and [[Docker CE]] or [[Docker EE]] releases.
# Understand the difference between an [[docker image|image]] and a container, Docker Images vs. Containers: https://stackoverflow.com/a/26960888
+
# Understand the difference between an image and a container, Docker Images vs. Containers: https://stackoverflow.com/a/26960888
 
# Understand the difference between <code>[[docker start]]</code> and <code>[[docker run]]</code>: https://stackoverflow.com/questions/34782678/difference-between-running-and-starting-a-docker-container. See also [[runC]]
 
# Understand the difference between <code>[[docker start]]</code> and <code>[[docker run]]</code>: https://stackoverflow.com/questions/34782678/difference-between-running-and-starting-a-docker-container. See also [[runC]]
 
# Read Stackoverflow questions related to docker: https://stackoverflow.com/questions/tagged/docker?tab=Votes
 
# Read Stackoverflow questions related to docker: https://stackoverflow.com/questions/tagged/docker?tab=Votes
 
# Read about Docker Image Manifest Version 2, Schema 2: https://github.com/docker/distribution/blob/fda42e5ef908bdba722d435ff1f330d40dfcd56c/docs/spec/manifest-v2-2.md
 
# Read about Docker Image Manifest Version 2, Schema 2: https://github.com/docker/distribution/blob/fda42e5ef908bdba722d435ff1f330d40dfcd56c/docs/spec/manifest-v2-2.md
# Duplicate and image using <code>[[docker commit]]</code> command
 
  
 
== See also ==
 
== See also ==
* {{docker cmd}}
 
 
* {{Docker}}
 
* {{Docker}}
 
* {{Dockerd}}
 
* {{Dockerd}}
 +
* [[wikipedia:Docker (software)| Docker Hub]] official Docker container image [[registry]]
 
* {{docker-compose}}
 
* {{docker-compose}}
 +
* [[Elastic Container Service]] ([[ECS]])
 +
* AWS Elastic Container Registry ([[ECR]])
 +
* {{K8s}}
 +
* {{K8s cloud services}}
 +
* {{container orchestration}}
 +
* {{Virtualization}}
 +
 +
  
 
{{CC license}}
 
{{CC license}}
 
Source: https://en.wikiversity.org/wiki/DevOps/Docker
 
Source: https://en.wikiversity.org/wiki/DevOps/Docker
  
 +
 +
[[Category:Cloud computing]]
 +
[[Category:Software development]]
 +
[[Category:Server administration]]
 
[[Category:Docker]]
 
[[Category:Docker]]
 
[[Category:Linux containers]]
 
[[Category:Linux containers]]

Please note that all contributions to wikieduonline 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 Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: