OpenShift CI/CD Concepts TODEPLETE: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
=Overview=
=Container=
 
 
 
 
 
 
 
 
* Physically, a container is a reference to a [[#Layered_Image|layered filesystem image]] and some metadata about configuration ([[#Environment_Variables|environment variables]], for example). <font color=red>A running container has a name and a [[#Tag|tag]]. The tag is generally used to identify a particular release of an image.</font>
* A specific container can only exist once.
* [[#Privileged_Container|Privileged container]].
* Any output directed to stdout in a running container is captured in a log file that can be viewed with [[docker logs]] command.
* Containers are ephemeral. Any in-memory state is lost when the container stops. When a container is deleted, any data written to the container’s file system is deleted as well.
 
==Restart Policy==
 
The container's restart policy specifies how container are restarted when the docker server is restarted. It is maintained in <tt>/var/lib/docker/containers/<container-id>/hostconfig.json</tt> as:
 
<pre>
{ ... "RestartPolicy":{"Name":"no","MaximumRetryCount":0}, ... }
</pre>
 
Note that the json file must not be edited directly. If the restart policy has to be changed, that must be done with [[docker update]].
 
The policy for a specific container can be retrieved with [[Docker_inspect|docker inspect]].
 
Also see {{Internal|Docker - Start a Container Automatically|Start a Container Automatically}}

Revision as of 22:58, 4 December 2017

Container

  • Physically, a container is a reference to a layered filesystem image and some metadata about configuration (environment variables, for example). A running container has a name and a tag. The tag is generally used to identify a particular release of an image.
  • A specific container can only exist once.
  • Privileged container.
  • Any output directed to stdout in a running container is captured in a log file that can be viewed with docker logs command.
  • Containers are ephemeral. Any in-memory state is lost when the container stops. When a container is deleted, any data written to the container’s file system is deleted as well.

Restart Policy

The container's restart policy specifies how container are restarted when the docker server is restarted. It is maintained in /var/lib/docker/containers/<container-id>/hostconfig.json as:

{ ... "RestartPolicy":{"Name":"no","MaximumRetryCount":0}, ... }

Note that the json file must not be edited directly. If the restart policy has to be changed, that must be done with docker update.

The policy for a specific container can be retrieved with docker inspect.

Also see

Start a Container Automatically