Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Question: Support for running multiple containers within a single task? #103

Open
holyjak opened this issue Oct 21, 2019 · 4 comments
Open

Comments

@holyjak
Copy link

holyjak commented Oct 21, 2019

Is it possible to run multiple containers as a part of a service/task, i.e. the main "service" container and 1 "side-kick" containers such as a nginx proxy? Thank you!

@dougtoppin
Copy link

@holyjak I was not able to find a way to add containers to the generated task definition when I added the X-Ray agent to my fargate cli started task.
What I did instead was have an entrypoint script run the agent in the background and then the main app in the foreground. That works well for me.

This is what my entrypoint script looks like

#!/bin/sh

# run the x-ray agent in the background and in local mode ( -o  ) to prevent
# the getting container instance metadata error
/usr/bin/xray -t 0.0.0.0:2000 -b 0.0.0.0:2000 -o --config /cfg.yaml &

# run the demo app in the foreground
exec /app.py

@holyjak
Copy link
Author

holyjak commented Dec 16, 2019 via email

@jritsema
Copy link

Our fork (https://github.com/turnerlabs/fargate) doesn't support this either since we haven't had much interest in it. That said, we would consider adding it if there was more demand. For now, we've used terraform to deploy more static type sidecar containers that are really more part of the infrastructure than the application. Here's an example of one that fetches secretsmanager secrets and writes them to a file for the app.

https://github.com/turnerlabs/terraform-ecs-fargate/blob/master/env/dev/secrets-sidecar.tf

@dougtoppin
Copy link

The fargate cli seemed to go quiescent a few months ago and I had been wondering if aws cli v2 was going to add fargate specific support such as this. I have found the fg cli to be useful for my personal stuff and have no complaints.
The second container need that I had was only that I try to always include x-ray support when I can.

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

No branches or pull requests

3 participants