Custom Docker Image for Scripts

Overview

This section provides details on the custom worker image for callouts/scripts if you prefer to execute external callout scripts in an isolated Docker container.

  • Create a public or private docker registry to host the new Docker worker image.

  • This Docker registry must be reachable from the CloudCenter Suite cluster

  • If the registry requires authentication, create a Kubernetes secret.

    kubectl create secret docker-registry custom-image-pull-secret 
    --docker-username=<user> --docker-password=<pwd> 
    --docker-email=custom@image.com --docker-server=devhub.com -n 
    <namespace>
  • The bundle store contains the agent and service bundles. This custom Docker image is hosted by Workload Manager at http://cdn.cliqr.com/release-5.1.0/docker/worker-release-5.1.0.tar for the CloudCenter Suite 5.1.1 release. See Local Bundle Store (Conditional) for additional details on the bundle store.

Customize the Docker Image

  1. Access the Local Bundle Store (Conditional) and verify that you have access to the custom Docker image.

  2. Log into any server that has access to custom Docker image.

  3. Download the file and create a worker:release-5.1.0 docker image in your Docker registry by issuing the following command.

    docker load < worker-release-5.1.0.tar
  4. Now create a file within this folder with the following contents and name it Dockerfile.

    FROM worker:<TAG>
    RUN apk update; pip install requests 
    # Add your customization here - for example, python requests module
    ENTRYPOINT ["/worker.sh"]
  5. Save this file and run the following commands.

    docker build -t devhub.com/worker:custom-version .
  6. Upload created image in Step 4 to your docker repository.

    docker push devhub.com/worker:custom-version

Update the configMap Image set

To update the configured image set you must edit the following name, value pairs in the cloudcenter-ces config map as listed in this procedure.

  1. Edit the cloudcenter-ces config map.

    kubectl edit configmap cloudcenter-ces -o yaml
  2. Add the following lines into the data section of the ConfigMap.

    ces.image.pull.secret: custom-image-pull-secret
    ces.container.image: devhub.com/worker:custom-version
  3. Save the configMap changes. This should cause the cloudcenter-ces pod to restart.

  4. Run callouts to pick up the new images for all callouts.

Additional Considerations for Cloud Remote

If you are using Cloud Remote in your environment to execute the callout scripts, the above process to build the Docker images remains the same.

Be sure to save the Docker image and load this on the Cloud Remote worker nodes.

  1. Save the Docker image as a tgz file.

    docker save worker:custom-version > custom-version.tar
  2. As Docker is already installed on the Cloud Remote instance(s), load the above tar file on each instance.

    docker load --input=custom-version.tar
    docker tag worker:custom-version ces_worker:latest



  • No labels

3 Comments

  1. docker build -t devhub.com/worker:custom-version .
    replace the devhub.com with your docker registry that will host the custom version of the worker image
  2. on
    7. Create a kubernetes secrets with which you can access this image from your private repository. 
  3. ?
    Create a secrets in kubernetes with credentials to access the docker registry hosting the custom docker image
Terms & Conditions Privacy Statement Cookies Trademarks