0

I'm trying to deploy XRAY as a sidecar-container of my main container in AWS ECS Fargate using docker-compose; but it creates 2 tasks (Service and Xray) instead of 1 task containing both, the service and the xray daemon.

I have done this in the past without issues using cfn but I cannot make it work with docker-compose.

This is my docker-compose file:

version: "3.9"

services:
  web: 
    image: link-to-private-repo/web
    ports: ["80:80"]
  xray:
    image: amazon/aws-xray-daemon
    ports:
    - 2000:2000/udp

Thanks.

Peter
  • 2,004
  • 2
  • 24
  • 57
  • 1
    I’ve always seen the daemon separate - how did you deploy them together?! – Ermiya Eskandary Oct 14 '21 at 00:58
  • 1
    @ErmiyaEskandary plain cloudformation. Adding both containers to the containers definitions of the task definition. – Peter Oct 14 '21 at 01:00
  • Ah OK - does this answer help? https://stackoverflow.com/a/60750654/4800344 – Ermiya Eskandary Oct 14 '21 at 01:02
  • Nopes :( Do you have an example of how to consume or interact with the daemon which is deployed as another task? Would this work if I add other tasks? like Task1, Task2, XrayTask. I never tried this. Thanks – Peter Oct 14 '21 at 01:22
  • You show a docker-compoose file, but in a comment you say you are deploying with CloudFormation? How about including the CloudFormation template in your original question? What you want is certainly possible with ECS, but may not be possible with the docker-compose deployment method. – Mark B Oct 14 '21 at 17:53

1 Answers1

0

This is not possible today with the current Docker Compose out of the box experience. This need is tracked in this GH issue. Please weigh in in the issue with your use case.

mreferre
  • 5,464
  • 3
  • 22
  • 29