ECS 'Unknown volume' error

Hello,

I am trying to get our app to deploy to ECS thru pipelines, but do not understand how to take care of the following error

 

+ python ecs_deploy.py task_definition.json $DOCKER_IMAGE:$TAG 1 0 200 Failed to update the stack. An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Unknown volume 'etc'.

 

Here is what I have in my container definition for mount points

 

"mountPoints": [{
  "containerPath": "/home/app/etc",
  "sourceVolume": "etc",
  "readOnly": false
}],

I am following this example

https://bitbucket.org/awslabs/amazon-ecs-bitbucket-pipelines-python/src/a7f2ec188250?at=master

How do I make it aware of the volume? 

 

1 answer

This widget could not be displayed.

looks like your task definition contains a mountPoint but no volumes (to be mounted); see the example at http://docs.aws.amazon.com/cli/latest/reference/ecs/register-task-definition.html

 

{
      "family": "web-timer",
      "containerDefinitions": [
      {
              "name": "web",
              "image": "nginx",
              "cpu": 99,
              "memory": 100,
              "portMappings": [{
                      "containerPort": 80,
                      "hostPort": 80
              }],
              "essential": true,
              "mountPoints": [{
                      "sourceVolume": "webdata",
                      "containerPath": "/usr/share/nginx/html",
                      "readOnly": true
              }]
      }, {
              "name": "timer",
              "image": "busybox",
              "cpu": 10,
              "memory": 20,
              "entryPoint": ["sh", "-c"],
              "command": ["while true; do date > /nginx/index.html; sleep 1; done"],
              "mountPoints": [{
                      "sourceVolume": "webdata",
                      "containerPath": "/nginx/"
              }]
      }],
      "volumes": [{
              "name": "webdata",
              "host": {
                      "sourcePath": "/ecs/webdata"
              }}
      ]
}

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,315 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you