'\" t .\" Title: ocf_heartbeat_docker .\" Author: ClusterLabs contributors (see the resource agent source for information about individual authors) .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 06/07/2017 .\" Manual: OCF resource agents .\" Source: resource-agents 4.0.0~rc1-4~bpo8+1 .\" Language: English .\" .TH "OCF_HEARTBEAT_DOCKER" "7" "06/07/2017" "resource-agents 4.0.0~rc1-4~bp" "OCF resource agents" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ocf_heartbeat_docker \- Docker container resource agent\&. .SH "SYNOPSIS" .HP \w'\fBdocker\fR\ 'u \fBdocker\fR [start | stop | monitor | meta\-data | validate\-all] .SH "DESCRIPTION" .PP The docker HA resource agent creates and launches a docker container based off a supplied docker image\&. Containers managed by this agent are both created and removed upon the agent\*(Aqs start and stop actions\&. .SH "SUPPORTED PARAMETERS" .PP \fBimage\fR .RS 4 The docker image to base this container off of\&. .sp (required, string, no default) .RE .PP \fBname\fR .RS 4 The name to give the created container\&. By default this will be that resource\*(Aqs instance name\&. .sp (optional, string, no default) .RE .PP \fBallow_pull\fR .RS 4 Allow the image to be pulled from the configured docker registry when the image does not exist locally\&. NOTE, this can drastically increase the time required to start the container if the image repository is pulled over the network\&. .sp (optional, boolean, no default) .RE .PP \fBrun_opts\fR .RS 4 Add options to be appended to the \*(Aqdocker run\*(Aq command which is used when creating the container during the start action\&. This option allows users to do things such as setting a custom entry point and injecting environment variables into the newly created container\&. Note the \*(Aq\-d\*(Aq option is supplied regardless of this value to force containers to run in the background\&. .sp NOTE: Do not explicitly specify the \-\-name argument in the run_opts\&. This agent will set \-\-name using either the resource\*(Aqs instance or the name provided in the \*(Aqname\*(Aq argument of this agent\&. .sp (optional, string, no default) .RE .PP \fBrun_cmd\fR .RS 4 Specifiy a command to launch within the container once it has initialized\&. .sp (optional, string, no default) .RE .PP \fBmonitor_cmd\fR .RS 4 Specifiy the full path of a command to launch within the container to check the health of the container\&. This command must return 0 to indicate that the container is healthy\&. A non\-zero return code will indicate that the container has failed and should be recovered\&. .sp If \*(Aqdocker exec\*(Aq is supported, it is used to execute the command\&. If not, nsenter is used\&. .sp Note: Using this method for monitoring processes inside a container is not recommended, as containerd tries to track processes running inside the container and does not deal well with many short\-lived processes being spawned\&. Ensure that your container monitors its own processes and terminates on fatal error rather than invoking a command from the outside\&. .sp (optional, string, no default) .RE .PP \fBforce_kill\fR .RS 4 Kill a container immediately rather than waiting for it to gracefully shutdown .sp (optional, boolean, no default) .RE .PP \fBreuse\fR .RS 4 Allow the container to be reused after stopping the container\&. By default containers are removed after stop\&. With the reuse option containers will persist after the container stops\&. .sp (optional, boolean, no default) .RE .SH "SUPPORTED ACTIONS" .PP This resource agent supports the following actions (operations): .PP \fBstart\fR .RS 4 Starts the resource\&. Suggested minimum timeout: 90\&. .RE .PP \fBstop\fR .RS 4 Stops the resource\&. Suggested minimum timeout: 90\&. .RE .PP \fBmonitor\fR .RS 4 Performs a detailed status check\&. Suggested minimum timeout: 30\&. Suggested interval: 30\&. .RE .PP \fBmeta\-data\fR .RS 4 Retrieves resource agent metadata (internal use only)\&. Suggested minimum timeout: 5\&. .RE .PP \fBvalidate\-all\fR .RS 4 Performs a validation of the resource configuration\&. Suggested minimum timeout: 30\&. .RE .SH "EXAMPLE CRM SHELL" .PP The following is an example configuration for a docker resource using the \fBcrm\fR(8) shell: .sp .if n \{\ .RS 4 .\} .nf primitive p_docker ocf:heartbeat:docker \e params \e image=\fIstring\fR \e op monitor timeout="30" interval="30" depth="0" .fi .if n \{\ .RE .\} .SH "EXAMPLE PCS" .PP The following is an example configuration for a docker resource using \fBpcs\fR(8) .sp .if n \{\ .RS 4 .\} .nf pcs resource create p_docker ocf:heartbeat:docker \e image=\fIstring\fR \e op monitor timeout="30" interval="30" depth="0" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \m[blue]\fB\%http://clusterlabs.org/\fR\m[] .SH "AUTHOR" .PP \fBClusterLabs contributors (see the resource agent source for information about individual authors)\fR