Skip to content

Running Docker Containers as Jobs

You can execute Docker images in Predictive Learning (PrL), just as you can with any model stored in PrL.

About Docker Images

Please read through the following important points about pushing Docker images to MindSphere or when executing them:

  • Do not store access data such as usernames, tokens, and secrets within Docker images, even though the storage location itself is secure.
  • The Docker containers you create have limited external connectivity; for example, they can only download Python or R libraries; therefore, you should include in the Docker image all the extra data and libraries they require.
  • When using Docker containers, note that the PrL gateway can only be accessed from within MindSphere, not directly from your local environment; you can, however, access MindSphere from your local environment, then open PrL.
  • Exposing ports from your Docker container has no effect because they run in isolation and other components cannot access them.

Additional Code Required in Dockerfiles

Depending on the type of input your container requires, the Dockerfile used in building the container requires a few extra lines of code to allow the environment to prepare input data, and to extract outputs.

For Data Exchange or Data Lake Input

The Dockerfile for Data Exchange or Integrated Data Lake input requires the following:

RUN ["mkdir", "/tmp/input"]
RUN ["mkdir", "/tmp/output"]
RUN chmod 777 -R /tmp

For IoT Input

The Dockerfile for IoT input requires the following:

RUN ["mkdir", "/tmp/input"]
RUN ["mkdir", "/tmp/output"]
RUN chmod 777 -R /tmp

For PrL Storage Inputs or Outputs

The Dockerfile for PrL storage inputs and outputs requires the following:

RUN ["mkdir", "/tmp/input"]
RUN ["mkdir", "/tmp/output"]
RUN chmod 777 -R /tmp

Any questions left?

Ask the community

Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.

Last update: November 11, 2022