I'm working on deploying some of our containers from an existing docker swarm into an aws ecs cluster. The container images are identical between swarm and ecs version that I'm deploying.
Most of the containers deployed without issue. One container in particular though refuses to start and gives the error
/bin/sh: 1: /srv/src/enketo_express/setup/docker/start.sh: not found
Running this container in docker swarm, and locally works fine. That .sh file does exist and starts the process.
https://github.com/enketo/enketo-express/blob/master/Dockerfile
Here's my ecs container definition - omitted some parts for brevity:
{
"family": "wsb-dfp-enketo",
"containerDefinitions": [
{
"name": "enketo",
"image": "enketo/enketo-express:6.0.0",
"cpu": 0,
"portMappings": [
{
"name": "enketo-8005-tcp",
"containerPort": 8005,
"hostPort": 8005,
"protocol": "tcp",
"appProtocol": "http"
}
],
"essential": true,
"entryPoint": [
"docker-entrypoint.sh"
],
"command": [
"/bin/bash",
"/srv/src/enketo_express/setup/docker/start.sh"
],
"environment": [
{
"name": "DEBUG",
"value": "openrosa*"
}
],
"mountPoints": [
{
"sourceVolume": "config",
"containerPath": "/srv/src/enketo_express/",
"readOnly": false
}
],
"volumesFrom": [],
"workingDirectory": "/srv/src/enketo_express",
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-create-group": "true",
"awslogs-group": "/ecs/wsb-dfp-enketo",
"awslogs-region": "us-east-2",
"awslogs-stream-prefix": "ecs"
}
}
}
],
"executionRoleArn": "arn:aws:iam::...:role/ecsTaskExecutionRole",
"networkMode": "awsvpc",
"volumes": [
{
"name": "config",
"efsVolumeConfiguration": {
"fileSystemId": "fs-...",
"rootDirectory": "/volumes/enketo/config"
}
}
],
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "256",
"memory": "512",
"ephemeralStorage": {
"sizeInGiB": 21
},
"runtimePlatform": {
"cpuArchitecture": "X86_64",
"operatingSystemFamily": "LINUX"
}
}
Has anyone seen similar issues, and found a resolution?
You are overrwriting the entire /srv/src/enketo_express
folder and all folders underneath it with an EFS volume mounted to /srv/src/enketo_express
. Since that is where your docker image's application files are, you are basically making those application files invisible to the operating system running in the docker container, and replacing them with whatever is in the /volumes/enketo/config
folder in your EFS volume.
The problem configuration is here:
"mountPoints": [
{
"sourceVolume": "config",
"containerPath": "/srv/src/enketo_express/",
"readOnly": false
}
],
I assume that containerPath
setting probably needs to be something like "/srv/src/enketo_express/config/"