BLAM Docker Container Building
This guide will go through the steps for building the Docker Containers for the BLAM API, Workflow and other services ready for deploying to a Docker environment.
This is typically performed on a Windows development machine using Powershell.
Configure AWS Connection
$ aws configure
$ blam-containers
$ eu-west-1
$ [ACCESS_KEY_ID]
$ [SECRET_ACCESS_KEY]
Login to AWS
$ aws ecr get-login-password –region eu-west-1 | docker login –username AWS –password-stdin 365894649245.dkr.ecr.eu-west-1.amazonaws.com
Build the Containers
BLAM API and Workflow
Change directory to BLAM3/BLAM3.
$ docker build -t api -f .\API\Dockerfile ./
$ docker build -t workflow -f .\Workflow\Dockerfile ./
BLAM Microservices
Change Directory into the BLAM3/Microservices/specific_microservice_directory to build the microservices.
$ docker build -t streaming-server -f .\StreamingServer\Dockerfile ./
$ docker build -t sns-service -f .\AWSSNSService\Dockerfile ./
Recording Microservices
Change Directory into the BLAM3/Microservices/recording_microservice_directory.
Copy the two shared libraries into the Project folder before the build.
$ Copy-Item -Path “..\..\SharedLibraries\QUICToolsAPI\QUICToolsAPI\*” -Destination “.\QUICToolsAPI” -Force -Recurse
$ Copy-Item -Path “..\MicroserviceLibraries\RecordingSchedulerService\*” -Destination “.\RecordingSchedulerService” -Force -Recurse
$ docker build -t quantel-recording-service -f .\QuantelRecordingService\Dockerfile ./
Update the AWS Elastic Container Registry (ECR)
To use the updated Containers in BLAM3 Deployments, they must be pushed into our AWS Elastic Container Registry. The steps below will use the API Container in the examples. The steps are the same for all Containers you are updating and pushing.
Tag the Container
Each build command returns a [CONTAINER_ID] in the Powershell window. Copy this ID and replace the [CONTAINER_ID] in the relevant docker tag command below.
If you are updating the default release Docker Container Images, you can use the default Tag.
$ docker tag [CONTAINER_ID] 365894649245.dkr.ecr.eu-west-1.amazonaws.com/api
If you are building and uploading a non-standard Docker Container Image (for example, from a branch not yet completed and checked in), use a Tag to identify it:
$ docker tag [CONTAINER_ID] 365894649245.dkr.ecr.eu-west-1.amazonaws.com/api:sky
Push the Container Images
$ docker push 365894649245.dkr.ecr.eu-west-1.amazonaws.com/api
Pushing a Tagged Container Image
$ docker push 365894649245.dkr.ecr.eu-west-1.amazonaws.com/api:sky
Full Container List Examples
$ docker tag [CONTAINER_ID] 365894649245.dkr.ecr.eu-west-1.amazonaws.com/api
$ docker tag [CONTAINER_ID] 365894649245.dkr.ecr.eu-west-1.amazonaws.com/workflow
$ docker tag [CONTAINER_ID] 365894649245.dkr.ecr.eu-west-1.amazonaws.com/streaming-server
$ docker tag [CONTAINER_ID] 365894649245.dkr.ecr.eu-west-1.amazonaws.com/sns-service
$ docker tag [CONTAINER_ID] 365894649245.dkr.ecr.eu-west-1.amazonaws.com/quantel-recording-service
$ docker push 365894649245.dkr.ecr.eu-west-1.amazonaws.com/api
$ docker push 365894649245.dkr.ecr.eu-west-1.amazonaws.com/workflow
$ docker push 365894649245.dkr.ecr.eu-west-1.amazonaws.com/streaming-server
$ docker push 365894649245.dkr.ecr.eu-west-1.amazonaws.com/sns-service
$ docker push 365894649245.dkr.ecr.eu-west-1.amazonaws.com/quantel-recording-service