Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an ECS container have access to the docker socket?

I have a docker image, the sole point of which is to launch sub docker images for continuous integration.

If I were to run it on any docker enabled computer, it would be:

docker run -d \
   -e DRONE_SERVER=wss://ci.fommil.com/ws/broker \
   -e DRONE_SECRET=... \
   -e DOCKER_MAX_PROCS=1 \
   -e DRONE_TIMEOUT=30m \
   -v /var/run/docker.sock:/var/run/docker.sock \
   --restart=always \
   --name=drone-agent \
   drone/drone:0.5 agent

But the ECS panel doesn't seem to allow me to pass the v flag. I don't think this is being passed, even if I select privileged mode.

This image only contains one binary. It is not possible to ssh in and poke around. How can I debug this using ECS tooling? e.g. to see the docker launch parameters.

And how can I get the socket mounted? Am I going to have to fall back to managing my own EC2 instance that launches docker?

like image 749
fommil Avatar asked Feb 14 '17 08:02

fommil


People also ask

Does ECS support Docker?

Amazon ECS is a highly scalable, high performance container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances.

Can ECS pull from Docker hub?

AWS Elastic Container Service (ECS) can pull images from Docker Hub and manage container workload with low-cost AWS Fargate clusters.

Can you SSH into ECS container?

Amazon ECS container instances have no password, and you use a key pair to log in using SSH.

Can we use the existing docker hub repository in ECS?

When the ECS CLI creates a task definition from the compose file, the fields of the web service will be merged into the ECS container definition, including the container image it will use and the Docker Hub repository credentials it will need to access it.


1 Answers

I got this working!

The trick is to add a Volume at the Task level (left hand side of -v) and then in the Container level add this as a mount, choosing where to put it (right hand side of -v).

like image 200
fommil Avatar answered Oct 27 '22 02:10

fommil