Run adapter inside Docker container
- Last UpdatedJun 26, 2025
- 2 minute read
The following procedure contain instructions on how to run the adapter inside a Docker container with different options enabled.
Create a Network File Share (NFS)
-
In Windows, use PowerShell utilities to create and manage the file share using the following commands:
new-NfsShare -Name "<fileshare>" -Path "<localsharedfilefolder>" -Permission "readwrite" -AnonymousGid -2 -AnonymousUID -2 -EnableAnonymousAccess $False
Get-NfsShare
Remove-NfsShare -Name "<fileshare>"
-
Create the input, output and discovery directories:
New-Item -ItemType Directory -Force -Path "<localsharedfilefolder>\Input"
New-Item -ItemType Directory -Force -Path "<localsharedfilefolder>\Output"
New-Item -ItemType Directory -Force -Path "<localsharedfilefolder>\Discovery"
-
Assign the appropriate security for each directory. The following example give full control to everyone:
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("Everyone", "FullControl", "ContainerInherit, ObjectInherit", "None", "Allow")
$acl = Get-ACL -Path "<localsharedfilefolder>\Input"
$acl.AddAccessRule($accessRule)
Set-Acl -Path "<localsharedfilefolder>\Input" -AclObject $acl
Create Docker volume
-
Use the following command to point to the new NFS share:
docker volume create --driver local --opt type=nfs --opt o=addr=”<hostname>”,rw,soft,timeo=3 --opt device=:”<fileshare>” “<VolumeName>”
Start the Docker container
To run the adapter inside a Docker container while using the host for persistent storage, complete the following steps. This procedure also enables access to the adapter REST API from the local host.
-
Use the Docker container image <componentType>adapter created previously.
-
Type the following in the command line (sudo may be necessary):
docker run -d --network host -v “<VolumeName>”:”<Local Container Folders>” “<DockerImageName>”
-
Verify the docker is running on the port:
curl http://localhost:5590/api/v1/diagnostics/productinformation
Port 5590 is accessible from the host and you can make REST calls to the adapter from applications on the local host computer. In this example, all data written to the container is instead written to the host directory and the host directory is a directory on the local machine, /<adapter>. You can specify any directory.
-
When configuring data source for input, output and discovery directories, use the following data source directories:
”<Local Container Folders>/Input”
”<Local Container Folders>/Output”
”<Local Container Folders>/Discovery”