Express Docker Setup
The Open Active Management Technology (Open AMT) Cloud Toolkit's Management Presence Server (MPS) and Remote Provisioning Server (RPS) provide support for deploying the microservices as Docker* images, standardized packages containing an application's source code, libraries, environment, and dependencies.
Why Docker*?¶
A Docker container is the instantiation of a Docker image as a virtualized unit that separates the application from the environment. Docker containers start and run reliably, securely, and portably inside different environments, eliminating some of the problems that occur with software deployment on varying platforms.
Get more information about Docker images and containers at Docker resources.
Get the Toolkit¶
To clone the repositories:
-
Open a Terminal or Powershell/Command Prompt and navigate to a directory of your choice for development:
git clone --recursive https://github.com/open-amt-cloud-toolkit/open-amt-cloud-toolkit --branch v1.2.0
-
Change to the cloned
open-amt-cloud-toolkit
directory.cd open-amt-cloud-toolkit
Set Environment Variables¶
The .env.template
file is used by docker to set environment variables.
To set the environment variables:
-
Copy the
.env.template
file to.env
:cp .env.template .env
copy .env.template .env
-
Set
MPS_COMMON_NAME
to your development system's IP Address. Replace YOURIPADDRESS in the command below or use a text editor to modify the.env
file.sed -i "s|MPS_COMMON_NAME=localhost|MPS_COMMON_NAME=YOURIPADDRESS|g" .env
(Get-Content -Path './.env') -replace 'MPS_COMMON_NAME=localhost', 'MPS_COMMON_NAME=YOURIPADDRESS' | Set-Content -Path './.env'
Build and Run the Docker Images¶
Build the MPS, RPS, and Sample UI Docker images and launch the stack.
-
Run docker-compose to start the containers.
sudo docker-compose -f "docker-compose.yml" up -d --build
Important - For Windows* 10
While the
docker-compose up
command is running, you may see a pop-up ask for permission for Docker Desktop Filesharing. You must select Share It for thedocker-compose up
command to execute successfully. If the pop-up expires,docker-compose up
will fail. You must rundocker-compose down -v
and then rerundocker-compose up
to successfully start the containers. -
Check that all of the containers are running.
sudo docker ps --format "table {{.Image}}\t{{.Status}}\t{{.Names}}"
Success
IMAGE STATUS samplewebui Up 6 seconds open-amt-cloud-toolkit_webui_1 rps-microservice:v1 Up 6 seconds open-amt-cloud-toolkit_rps_1 mps-microservice:v1 Up 6 seconds open-amt-cloud-toolkit_mps_1 vault Up 6 seconds open-amt-cloud-toolkit_vault_1 postgres Up 6 seconds open-amt-cloud-toolkit_db_1
If any of the above containers are not running, walk through the steps again or file a github issue here.
Important
Because the vault is running in a dev mode, stored secrets will be lost upon a restart, and profiles and configs must be recreated. They are not persistent in this mode. Be sure to run docker-compose down -v
when bringing down the stack, which removes the volumes, and start fresh upon docker-compose up
. To run vault in production mode, follow the guide here.