aws / amazon-ecs-init

Amazon Elastic Container Service RPM
http://aws.amazon.com/ecs
Apache License 2.0
198 stars 119 forks source link

fix(docker): check for iptables directories before adding to list of binds #477

Closed stuart-warren closed 3 months ago

stuart-warren commented 2 years ago

Summary

Permits ecs-init to work on a read only root file system

fixes aws/amazon-ecs-agent#3152

This previously did not work due to docker attempting to create host directories that did not exist and stopping the ecs-agent container from starting

Implementation details

check for directory existing prior to adding to slice of binds

Testing

New tests cover the changes: no - existing tests are sufficient

Currently have modified tests to not be as strict. Open for alternative suggestions.

Description for the changelog

Bug - permit ecs-agent to start on a readonly root file system

Licensing

This contribution is under the terms of the Apache 2.0 License: yes