Build MID Server Docker Image for Linux
Deploy Containerized MID Servers on Linux by creating a Docker image with the provided recipes. Containerized MID Server uses a Docker image of the MID Server that allows you to quickly deploy MID Servers at scale.
Before you begin
Role required: admin
|  |
Prerequisites:
The host must use Docker engine and command-line interface (CLI) 20.10.4 or later.
Update the library to the newest version available, or at least the highest version with a security fix. If issues identified are part of a transitive dependency, find a version of the dependent library which includes a newer transitive version. If the transitive dependency cannot be upgraded by upgrading the dependent library, consider excluding the dependency and directly including a secure version.
Note: Check docker availability by running the docker version command as administrator. See the the docker version command documentation for more information.
Procedure
Download the Linux Docker recipe ZIP file from the MID Server download page and verify its signature.
For more information about the MID Server download page and signature verification, see Download MID Server files.
Unzip the ZIP file to a folder.
You can change the current directory to the new folder.
To build an image, run the build command:
> docker build <path-to-docker-recipe> [ --tag <docker-tag> ]For more information on the command, see the Docker build command documentation. The path to the Docker file can be a relative path or the current directory if the file is in the Docker recipe directory.
The default image tag is provided out-of-the box in the .env file with the DOCKER_TAG parameter. You can export this parameter before executing any docker command by running the command:
> export $(grep DOCKER_TAG .env). You can replace<docker-tag>with the DOCKER_TAG value in all the following commands.The build command takes the following build arguments:
| Property | Description | ||||
|---|---|---|---|---|---|
| MID\_INSTALLATION\_URL | The link to download the MID Server installation file. By default, it is set to the download link for the Linux 64 bit Installation ZIP file provided on the MID Server download page. | ||||
| MID\_INSTALLATION\_FILE | The name of a local MID Server installation file. The default value is empty. If this parameter is not empty, the recipe uses the local file instead of downloading from the installation server. This parameter uses the file name only, not the full path. Before the build, the local file must be copied to the `asset/` sub-folder of the recipe directory. MID Server releases prior to Rome are not supported.For example: `> docker build | MID\_SIGNATURE\_VERIFICATION | The signature of the MID Server installation file must be verified. The default value is TRUE. If it is TRUE, the build process always verifies the digital signature of the MID Server installation file whether it is downloaded from the remote server or a local file. Otherwise, the signature verification is skipped.For example: `> docker build | USER\_ID and GROUP\_ID | By default, when not specified, Docker creates a MID Server user with user id = 1001 and group id = 1001. You may pass a custom user id and group id into container by using the USER\_ID and GROUP\_ID build arguments. Docker creates an user for the MID Server with the provided user id and group id. Inside the container image, all files under the MID Server installation folder are owned by this user and the root group \(id=0\). When the image is deployed on Kubernetes platform, this MID Server user becomes the container user who runs the MID Server. When the image is deployed on an OpenShift platform, OpenShift may assign an arbitrary non-admin user id as the container user who runs the MID Server. However, that user always belongs to the root group. In both cases, the container user has full access to the MID Server files. That way, the same image can be deployed on Kubernetes as well as on OpenShift. |
What to do nextTo save disk space, if there are unused or intermediate images, run the following commands to remove those dangling images: For example, before removing dangling images, the command After removing the dangling images, the command Launch Containerized MID ServerContainerized MID Server uses a Docker image of the MID Server that allows you to quickly deploy MID Servers at scale. MID Servers are deployed using orchestration tools like Docker Swarm. Before you beginRole required: admin Prerequisites:
Procedure
Pass sensitive data to a containerized MID Server with Docker SecretsYou can configure containerized MID Servers with configuration parameters passed through environment variables or secret files. Before you beginRole required: Docker Swarm admin About this taskYou can pass sensitive data, such passwords or certificates, into a containerized MID Server using Docker Secret. Setup and start Docker Swarm before using this procedure. When creating deployments, ensure that the replicas are kept to 1. Procedure
Pass sensitive data to a mutual authenticated containerized MID Server with Docker SecretsYou can configure containerized MID Servers with configuration parameters passed through environment variables or secret files. Before you beginRole required: admin Role required: Docker Swarm admin About this taskIf certificate based authentication is enabled on the instance, the MID Server can be configured to auto-validate using a mutual authentication client certificate (PEM file). This can be done via setting the full path to the PEM certificate file inside container with the MID_MUTUAL_AUTH_PEM_FILE environment variable. For example, you can update variable to MID_MUTUAL_AUTH_PEM_FILE= /run/secrets/certificate.pem in the You can pass the PEM certificate file into a container using Docker or Kubernetes secret. The following is an example command to pass the PEM certificate file into a container: The mutual PEM certificate is installed on the MID Server during initialization. MID Server then connects to the instance and auto-validates. When the MID Server connects to the instance with mutual authentication successfully enabled, you might observe some of the following entries in the MID agent log:
Procedure
Pass sensitive data to a containerized MID Server with Kubernetes SecretsYou can configure containerized MID Servers with configuration parameters passed through environment variables or secret files. Before you beginRole required: Kubernetest admin Setup and start Kubernertes cluster before using this procedure. For more information on Kubernetes Secrets, see the Kubernertes secrets documentation. Note: Kubernetes doesn’t work directly with a local image. Upload the MID Server image to a public registry or setup a local registry. See the official Docker instruction on building a docker registry. When creating deployments, ensure that the replicas are kept to 1. Procedure
Pass sensitive data to a mutual authenticated containerized MID Server with Kubernetes SecretsYou can configure containerized MID Servers with configuration parameters passed through environment variables or secret files. Before you beginRole required: Kubernetest admin Prerequisites: If certificate based authentication is enabled on the instance, the MID Server can be configured to auto-validate using a mutual authentication client certificate (PEM file). This can be done via setting the full path to the PEM certificate file inside container with the MID_MUTUAL_AUTH_PEM_FILE environment variable. You can pass the PEM certificate file into a container using Kubernetes secret. The mutual PEM certificate is installed on the MID Server during initialization. MID Server then connects to the instance and auto-validates. When the MID Server connects to the instance with mutual authentication successfully enabled, you might observe some of the following entries in the MID agent log:
Procedure
|