Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] broken docker configuration on amzn2 ECS image #58

Closed
hogarthj opened this issue Feb 20, 2020 · 2 comments
Closed

[BUG] broken docker configuration on amzn2 ECS image #58

hogarthj opened this issue Feb 20, 2020 · 2 comments

Comments

@hogarthj
Copy link

hogarthj commented Feb 20, 2020

The user_data.tpl template appends the following line to /etc/sysconfig/docker:

echo 'OPTIONS="$${OPTIONS} --storage-opt dm.basesize=${docker_storage_size}G"' >> /etc/sysconfig/docker

The amzn2 ECS images use a proper systemd unit to start docker instead of a sysvinit script.

The /etc/sysconfig/docker file is referenced for environment variables but the file isn't sourced, as in the way the sysvinit scripts work, so that appended line doesn't result in the OPTIONS envvar being built up, but rather being set to that. This then causes the docker service to fail on reboot of the instance or restart of the service with the error "dockerd accepts no arguments".

This is not noticed normally because the next line in the template /etc/init.d/docker restart is invalid in the amzn2 systemd instances so it doesn't actually restart docker and encounter this broken config .... you only get caught out by it on a service restart or a reboot.

In our use of this module we're now doing a sed -i '/OPTIONS="${OPTIONS}/d' /etc/sysconfig/docker to avoid this particular problem.

@ibrahima
Copy link

ibrahima commented Apr 10, 2023

I found this via Google for a related issue, and this was helpful, so I just wanted to add a few things.

(I'm not actually using this module at all, but I ran into a similar issue and wanted to clarify these points for anyone else who comes across this.)

@antonbabenko
Copy link
Member

Please consider using a much more up-to-date and maintained Terraform AWS module for ECS - https://github.com/terraform-aws-modules/terraform-aws-ecs

PS: We need to wait a few more days to get through this PR - terraform-aws-modules/terraform-aws-ecs#76

PPS: This module is not maintained anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants