I have the following yml file:
api:
restart: always
image: docker.registry-test.com/api:3.4.1
api-server:
restart: always
image: docker.registry-test.com/api-server
I'm running sed to update the version of image to 3.4.2 in api section:
sed -i "/^[[:space:]]*api:/,/^[^[:space:]]/ s/\(docker.registry-test.com\/api\).*$/\1:3.4.2/" docker.yaml
But it also changes the the image name and version in api-server section. I'm trying to make a change avoid from changing second section.