amazon-ecs-cli icon indicating copy to clipboard operation
amazon-ecs-cli copied to clipboard

ECS_CONTAINER_METADATA_URI is not accessible in macOS

Open hkawa608 opened this issue 3 years ago • 0 comments

Summary

Programs cannot access the /var/run/docker.sock file in a container when it is a symbolic link with the host path. This means a curl ${ECS_CONTAINER_METADATA_URI} command fails.

Description

  • Which specific command was run? ecs-cli local up --force --task-def-file ${taskDefinitionPath}
  • Which version of the CLI you are using? (Run: ecs-cli --version) ecs-cli version 1.21.0 (bb0b8f0)
  • Which version of Go are you using? (Run: go version) go version go1.17.2 darwin/amd64
  • What platform are you using to run ECS CLI commands? (E.g. Linux, macOS, Windows) macOS

Config files

We use a task-definition file.

Expected Behavior

The curl ${ECS_CONTAINER_METADATA_URI} command succeeds from inside a container.

Observed Behavior

At a terminal inside a conainer

sh-4.2# curl -v --unix-socket /var/run/docker.sock http://v1.27/containers/json?limit=0
*   Trying /var/run/docker.sock...
* Immediate connect fail for /var/run/docker.sock: No such file or directory
* Closing connection 0
curl: (7) Couldn't connect to server

hkawa608 avatar Feb 22 '22 11:02 hkawa608