docker-0.0.1

KOSI Plugin docker Version 0.0.1

Summary

With the containerRunitme Plugin you can manage you containerRuntime. You can use options to ecexute commands with or without flags. Additionally its possible to gather information about the current containerRuntime status. The plugin supports the following usage:

Keys

Key Description
command - Will be the command you want to execute inside the container.
containerName - Will be the Name of the contianer you choose or the Name of the temporarily stored Name of the created cluster.
destImage - Will be the new image name for the tages srcImage.
flag - The value of the “flag” key stores information on which options you want to enable. You will have to confirm which flag the “option” of your command allows. Examples for ps are “-a or –all” for all or “-n or –last” for last of the list of container, you can append any number of flags, like in example 3.
srcImage - Will be the Image which you want to pull.
option Mandatory Depending on which operation you want to execute select one of these as a variable of the key. Following example 1, if you want to execute a command like run, you take “option” as a key and “run” as a value.

The Values can be followed:

  • ps lists you all existing container.
  • images list all existing Images.
  • run starts an Container.
  • status will be showing the state of the containerRuntim like “active”, if the runtime is running.
  • exec will be executing an command within an running Container.
  • tag will be renamed the Imagename, for example: docker tag -t Image NewImage
  • pull will be pulling the given Image.
  • push will be pushing the given Image.
  • start will be starting a stopped container.
  • stop will be stopping a running container.
  • deleteCon will be deleting a given container

Example 1 - docker ps

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
  input="template.yaml";
}

containers =
{
    example=["docker.io", "nginx", "latest"];
}

install
{
    docker(option='"ps"'; flag='"--last"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 2 - docker Images

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
  input="template.yaml";
}

containers =
{
    example=["docker.io", "nginx", "latest"];
}

install
{
    docker(option='"images"'; flag='"--all"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 3 - docker run

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
  input="template.yaml";
}

containers =
{
    example=["docker.io", "nginx", "latest"];
}

install
{
    docker(option='"run"'; flag='"-w /path/to/dir/ -i -t"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 4 - docker status

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
  input="template.yaml";
}

containers =
{
    example=["docker.io", "nginx", "latest"];
}

install
{
    docker(option='"status"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 5 - docker exec

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
  input="template.yaml";
}

containers =
{
    example=["docker.io", "nginx", "latest"];
}

install
{
    docker(option='"exec"';flag='"-d"';containerName='"registry.kubernative.net/lima:v0.8.0"';command='"touch /tmp/testdir"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 6 - docker tag

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
  input="template.yaml";
}

containers =
{
    example=["docker.io", "nginx", "latest"];
}

install
{
    docker(option='"tag"';flag='"-t"';srcImage='"registry.kubernative.net/lima:v0.8.0"';destImage='"yourRegistry/yourName:v0.8.0"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 7 - docker pull /push

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
  input="template.yaml";
}

containers =
{
    example=["docker.io", "nginx", "latest"];
}

install
{
    docker(option='"pull / push"';flag='"-t"';srcImage='"registry.kubernative.net/lima:v0.8.0"';sudo='"true"';sudoPassword='"Drowssap"');
}

Example 8 - docker start / stop / deleteCon

languageversion = "0.1.0";
apiversion = "kubernative/kubeops/kosi/user/v3";
name = "kosi-example-packagev3";
description = "kosi-example-package";
version = "0.1.0";
docs = "docs.tgz";
logo = "logo.png";

files =
{
  input="template.yaml";
}

containers =
{
    example=["docker.io", "nginx", "latest"];
}

install
{
    docker(option='"start / stop / deleteCon"';containerName='"myFirstContainer"';sudo='"true"';sudoPassword='"Drowssap"');
}