Product Features
...
Applications
Containers
Overview of 'docker run'
6min
you can run custom images in docker containers within manufacturing connect edge (mc edge) the docker command used for this purpose is docker run and several options can be passed to this command to change its behavior in this section, you will view some examples of how the docker run command can be used to run a docker container in mc edge notes the docker run command is a very versatile tool with numerous configuration options this section is only intended as an introduction to some of the possible uses of docker run it does not serve as a comprehensive reference see the docker documentation for the official, maintained and complete description of docker run and its capabilities the run button in the containers pane can only be used for docker run commands other commands, including any other docker commands, cannot be used the most basic example of a docker run command is docker run \<image> , where \<image> is the path to the image to be run in docker to use options to modify the behavior of docker run , insert the option between docker run and the path to the image docker run d \<image> adds the d option, for example this is called 'passing' the option to the ( docker run ) command to run a custom docker image log in to manufacturing connect edge from the navigation panel, select applications the dashboard pane appears click containers in the navigation sub panel the containers pane appears click run at the upper right corner of the pane the enter command to run text field appears enter the docker run command you wish to run into the field click run the command runs and the custom image container is created this section covers the use of the following options d or detach restart \<restart options> it expose or p volume e detach pass the d or detach option to docker run to run the docker container in the background important using the d option is mandatory to run a docker container in mc edge restart there are several ways the restart option can be passed to docker run note the typical approach is to pass restart always if this option is not set (or set differently), the container will have to be started again manually after the mc edge instance is rebooted interactive bash shell and tty the it option, when passed to docker run , starts an interactive bash shell in the container and allows the user to interact with said shell through a pseudo tty this is a combination of the t and i options (short for tty and interactive respectively) expose and/or publish ports the expose option allows the user to expose one or several ports of the container similarly, p (short for publish ) publishes a container's port or ports to the host device these options are passed by following an option by \<ip address of host> \<port number> or just \<port number> for example, port x could be exposed by passing the option expose x to docker run see system requirements docid\ uohaurey maauleidy hj to review the list of required and optional ports bind mount a volume you can mount and bind a volume into the container by using the volume option ( v for short) the general syntax is volume \<host path of the directory to be mounted> \<mount path in container> set environment variables you can set environment variables in the container by passing the env option ( e for short) the syntax is env \<variable name>=\<variable value> , where \<variable name> is generally in all capital letters