Creating a Docker Container

To create a universal connector when requesting data from mobile device from source, create a Docker container:

Creating a Docker Component on Mobile Platform Server

To create a Docker component on a mobile platform server:

  1. Develop the Docker container image that converts input requests to a valid data source format, and compile it.

  2. Create a *.yml configuration file file to start the universal connector using the docker-compose utility, for example:

```yaml
version: '3.4'
services:
  custom-connector:
    image: <docker-registry>/<connector-repository>:<tag>
    restart: always
    networks:
      - backend
```

NOTE. A universal connector and a mobile platform server should be started within the same network. Specify this network as a value of the networks attribute.

  1. Start the Docker container using the created configuration file:

docker-compose -f <configuration file name>.yml up

docker-compose -f docker-compose.standalone.yml -f <configuration file name>.yml up

TIP. It is recommended to start the Docker container and mobile platform server at the same time. If required, one can place a Docker container on a dedicated server or a data source server and start it manually.

After executing the operations the Docker container is created on mobile platform server, which is started at the same time with the server. Next, proceed to setting up a JSON or WEB data source connection.

Creating a Docker Container in Cluster

To create the Docker container in a cluster:

  1. Develop the Docker container image that converts input requests to a valid data source format, and compile it.

  2. Create a *.yml configuration file to start the universal connector using the Docker container image, for example:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: custom-connector
spec:
  selector:
    matchLabels:
      app: custom-connector
  replicas: 2
  template:
    metadata:
      labels:
        app: custom-connector
    spec:
      containers:
      - name: custom-connector
        image: <docker-registry>/<connector-repository>:<tag>
        ports:
          # specify used port
        - containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: custom-connector
  labels:
    app: custom-connector
spec:
  type: LoadBalancer
  ports:
    # specify port in use
  - port: 8080
  selector:
    app: custom-connector
```

  1. Start the Docker container image:

kubectl apply -f <configuration file name>.yaml

To start the Docker image in OpenShift, observe the following conditions:

NOTE. The universal connector and the cluster should be started in the same namespace. For details see the kubernetes documentation.

The Docker container image will be created and started in the cluster after executing the operations. Next, proceed to setting up a JSON or WEB data source connection.

See also:

Creating a Universal Data Source Connector | Setting Up JSON Data Source Connection | Setting Up WEB Data Source Connection