Install and Verify the Docker Image
This section describes the procedure to install and verify the Docker image.
Before you begin
Make sure you have following in your computer.
- Must have ICD 7612 build or greater (lower versions of ICD are not supporter with VNC remote diagnostic).
Procedure
What to do next
Note: Below steps are not mandatory but recommended.
- Ensure that the content trust for Docker is enabled
-
Run below command and this must return a value of 1:
echo $DOCKER_CONTENT_TRUSTTo enable content trust in a bash shell, run below command:
export DOCKER_CONTENT_TRUST=1
-
- Ensure that, if applicable, SELinux security options are set
-
Run the below command:
docker ps --quiet --all | xargs docker inspect --format '{{ .Id }}: SecurityOpt={{ .HostConfig.SecurityOpt }}If no options (SecurityOpt=<no value>) then:- Edit the /etc/selinux/config file, set SELINUX=enforcing.
- Edit the /etc/sysconfig/selinux file, set SELINUX=enforcing.
- Start Docker in daemon mode with SELinux enabled. For example:
docker daemon --selinux-enabled
-
- Do the test for the following and troubleshoot as necessary:
-
Ensure that the memory usage for containers is limited:
- Run the command below, and if this command returns 0, that means memory limits are not in
place:
docker ps --quiet --all | xargs docker inspect --format '{{ .Id }}: Memory={{ .HostConfig.Memory }}
- Run the command below, and if this command returns 0, that means memory limits are not in
place:
-
Ensure that the CPU priority is set appropriately on the container:
- Run the command below, and if this command returns 0 or 1024, it means that CPU shares are not
in
place:
docker ps --quiet --all | xargs docker inspect --format '{{ .Id }}: CpuShares={{ .HostConfig.CpuShares }}
- Run the command below, and if this command returns 0 or 1024, it means that CPU shares are not
in
place:
-
Ensure that the 'on-failure' container restart policy is set to 5:
- Run the command below, and if this command returns RestartPolicyName=always, then the system
configurations are not in
place:
docker ps --quiet --all | xargs docker inspect --format '{{ .Id }}: RestartPolicyName={{ .HostConfig.RestartPolicy.Name }} MaximumRetryCount={{ .HostConfig.RestartPolicy.MaximumRetryCount }}
- Run the command below, and if this command returns RestartPolicyName=always, then the system
configurations are not in
place:
-
Ensure that the container is restricted from acquiring additional privileges (Privileges not restricted: compassionate_kalam):
- Run the command below, this command must return all the security options currently configured
for containers, no-new-privileges must be one of
them:
docker ps --quiet --all | xargs docker inspect --format '{{ .Id }}: SecurityOpt={{ .HostConfig.SecurityOpt }}
- Run the command below, this command must return all the security options currently configured
for containers, no-new-privileges must be one of
them:
-
Ensure that the PIDs group limit is used (PIDs limit not set: compassionate_kalam):
- Run the command below, this command must not return PIDs Limit 0 or -1. A PIDs Limit of 0 or -1
means that any number of processes can be forked concurrently inside the
container:
docker ps --quiet --all | xargs docker inspect --format '{{ .Id }}: PidsLimit={{ .HostConfig.PidsLimit }}
- Run the command below, this command must not return PIDs Limit 0 or -1. A PIDs Limit of 0 or -1
means that any number of processes can be forked concurrently inside the
container:
-
- If any of the test given in above step fails, run below command to troubleshoot:
- Update the docker_launcher.sh or docker_launcher.cmd script:
- Add comment (add # symbol) on below
command:
ssh $dockerCredentials "docker run -u vnc --rm -d -p $port_ssh:22 -e SSH_ENABLE_ROOT=false icdvnc:v1 container $public_key $connection_timeout $hard_timeout - Uncomment (remove # symbol) on below
command:
#ssh $dockerCredentials "docker run -u vnc -d -p $port_ssh:22 -e SSH_ENABLE_ROOT=false --pids-limit 100 --security-opt=no-new-privileges --restart on-failure:5 --cpu-shares 256 --memory 256m icdvnc:v1 container $public_key $connection_timeout $hard_timeout"
- Add comment (add # symbol) on below
command:
- Update the docker_launcher.sh or docker_launcher.cmd script:
- To make sure that incoming container traffic is bound to a specific host interface, update the
above command as
follow:
#ssh $dockerCredentials "docker run -u vnc -d --publish <hostip>:$port_ssh:22 -e SSH_ENABLE_ROOT=false --pids-limit 100 --security-opt=no-new-privileges --restart on-failure:5 --cpu-shares 256 --memory 256m icdvnc:v1 container $public_key $connection_timeout $hard_timeout"where hostip is the docker IP address.