-
-
Notifications
You must be signed in to change notification settings - Fork 541
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
ECS with EC2 autoscaling cannot use DIND but dockerd daemon starts successfully after enabling privileged = true #105
Comments
I found the issue. It looks like you have defined a different naming convention for the default definition of Docker from mountPoints to mount_points. But the rest of the arguments like containerPath, sourceVolume and f.e. readOnly you allowed the default naming convention that can be seen in the outputs. For example the following block solved the issue:
After applying the update, the output looks like the following:
This is a bit confusing to be honest. But looking at your module I can see that you are using a dynamic The ongoing issues is related to using a non root user inside the container. On my local pc, I am using the exact same image and forging start with the created user. Dockerfile:
From my terminal (local pc) I can run the docker version command with user runner:
From ECS task, I get an error that I the user does not have sufficient privileges: terraform: User declaration under container_definitions:
Command-line parameters:
If I disable the Please can you see anything wrong on my side here or am I missing some extra parameter please ? |
the variables used by the container definition can be found here https://github.com/terraform-aws-modules/terraform-aws-ecs/blob/master/modules/container-definition/variables.tf Terraform currently does not have a resource for ECS container definition hashicorp/terraform-provider-aws#17988 The ECS API simply takes in a JSON payload for the container definition, and this module tries to support that through a psuedo-Terraform way. Its standard convention that the Terraform arguments are written in snake-case, but the ECS container definition API is camelCase. As always, look at the variable definitions to provide the correct form |
Thanks a lot @bryantbiggs for the reply and the documentation link. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
I cannot mount /var/run/docker.sock on the task container although defining mountPoints and volume in the module.
container_definitions
And in services on the same level as container definitions:
If your request is for a new feature, please use the
Feature request
template.Versions
Reproduction Code [Required]
Steps to reproduce the behaviour:
When providing the above mentioned arguments to the resource, the volume is not mounted and container fails with the following error:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
Expected behaviour
As I can start the dockerd by calling the binary from entrypoint -> command but there is no other space to execute other commands
Actual behavior
Container is not able to run DIND
Terminal Output Screenshot(s)
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
Additional context
The text was updated successfully, but these errors were encountered: