0

I want to run a script /usr/sbin/run.sh when I start my container on Jelastic, so I did following:

  1. Set Environment Variable, PATH = /usr/sbin
  2. In RUN command section, I set it to run.sh

Then I follow normal procedure to add container on Jelastic, but it gave following error(everything will be fine if I don't set environment variable and RUN command):

  {
   "result":99,
   "source":"JEL",
   "error":"java.lang.NullPointerException",
   "params":{
      "extip":"false",
      "session":"114x1d38909aa5d9848b418276a6ca653875",
      "actionkey":"changetopology;dbde54d07b423f0a770cf08727f19272;licds30",
      "fixedCloudlets":"1",
      "ismaster":"false",
      "flexibleCloudlets":"16",
      "appid":"dbde54d07b423f0a770cf08727f19272",
      "nodeType":"docker",
      "displayName":"licds30/baoqi:v3",
      "metadata":{
         "dockerHubUser":"sdfs23fs",
         "dockerName":"licds30/baoqi",
         "dockerRunArgs":"run.sh",
         "dockerHubUrl":"https://index.docker.io/",
         "dockerEnvVars":{
            "PATH":"/usr/sbin"
         },
         "layer":"cp",
         "dockerTag":"v3",
         "dockerHubPassword":"xxs23saddjd"
      }
   },
   "methodName":"addNode(docker)"
}

Can anyone advise how to resolve the issue?

Many thanks!

J.

Shantanu Gupta
  • 20,688
  • 54
  • 182
  • 286
J John
  • 5,591
  • 3
  • 11
  • 9

1 Answers1

0

As I know environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. https://en.wikipedia.org/wiki/Environment_variable

In Jelastic Docker's environment variables are designed for specifying of the destination directory/application paths and for the specifying of the specific/needed information about ports, hosts, enabled/disabled features.

envs

In your case the correct scenario is to Set Environment Variable HOME = /usr/sbin, since the default location of the HOME directory is /root.

Environment Variable PATH contains a colon-separated list of directories that the shell searches for commands that do not contain a slash in their name (commands with slashes are interpreted as file names to execute, and the shell attempts to execute the files directly) in other words it is determines location of the main system components. (For example: when you are executing command ping system is actually runs binary of the program that is located at /bin/ping)

leo
  • 346
  • 1
  • 7