The variable $task_definition
contains json content. I need to update a specific value in that json. The variable $docker_image
contains value of the image name. When the below script gets executed it puts the variable name and not the value of the variable $docker_image
. How do I make it put the value of the variable.
jq '.taskDefinition.containerDefinitions[0].image = "$docker_image"' <<< "$task_definition" > task-definition.json
output:
{
"taskDefinition": {
"taskDefinitionArn": "arn:aws:ecs:us-east-1:123454566788:task-definition/nodejs-webapp:21",
"containerDefinitions": [
{
"name": "webapp",
"image": "$docker_image",
}
]
}
}