compose-cli icon indicating copy to clipboard operation
compose-cli copied to clipboard

Error Deploying Docker containers on ECS

Open navata opened this issue 2 years ago • 8 comments

Description I have use Docker Compose CLI for Deploying Docker containers on ECS. But it is error and auto delete ECS resource. I can't check log and know reason This is my docker-compose.yml Screen Shot 2022-04-03 at 09 31 17

Steps to reproduce the issue:

  1. docker context create ecs myecscontext
  2. docker context use myecscontext
  3. docker compose up

Describe the results you received: Error message: CreateFailed Resource creation cancelled

Screen Shot 2022-04-03 at 08 50 55 Screen Shot 2022-04-03 at 09 30 16

Describe the results you expected: I want deploy to successfully and can inspect error when deploy failed.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker compose version:

Docker Compose version v2.3.3

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.1)
  compose: Docker Compose (Docker Inc., v2.3.3)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 3
  Running: 1
  Paused: 0
  Stopped: 2
 Images: 6
 Server Version: 20.10.13
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2a1d4dbdb2a1030dc5b01e96fb110a9d9f150ecc
 runc version: v1.0.3-0-gf46b6ba
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.104-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 7.667GiB
 Name: docker-desktop
 ID: QGS2:E6J4:FTJQ:4ORS:IWV3:EMDM:LN63:Y7OH:KT7T:RYST:NOS2:5W5H
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details:

navata avatar Apr 03 '22 02:04 navata

i currently face exactly the same issue. i do have a compose with two services. one seems to start (i can see logs in CloudWatch) the other files for a unknown reason. since i can not find any hints why it fails it's hard to analyse.

arauchberger avatar Sep 21 '22 09:09 arauchberger

currently facing same issue, is there any fix for this... am deploying about five services with docker-compose. The cluster gets created but then it automatically deletes containers created, seems kinda strange

Joshua-Igoni avatar Sep 27 '22 08:09 Joshua-Igoni

what i found out so far ist that you need to use the detached option to get it running (seems to be a bug)

docker compose -f my.yml up -d

arauchberger avatar Sep 27 '22 08:09 arauchberger

Thanks that helped @arauchberger

Joshua-Igoni avatar Sep 27 '22 08:09 Joshua-Igoni

Shameless input here: instead of using this docker compose plugin to do all this, you can try out ECS Compose-X which we use daily to do all our deployments across multiple accounts and environments. It is a lot more flexible on the resources to create and re-use (using tag based import and otherwise AWS APIs) to connect / deploy your services into.

JohnPreston avatar Sep 27 '22 09:09 JohnPreston

Thanks a lot @arauchberger ! It worked like a charm!

hodlen avatar Sep 29 '22 12:09 hodlen

what i found out so far ist that you need to use the detached option to get it running (seems to be a bug)

docker compose -f my.yml up -d

I CANNOT BELIEVE THIS WORKED! Been banging my head on the wall with this issue for over a week now. THANKS BRO ILY <3

ghost avatar May 15 '23 17:05 ghost

If --detach (as suggested above) doesn't solve the issue then it's worth checking it if the AWS ELB health checker succeeds on your service's published ports. So for instance if your cluster deploys among others a http service which publishes ports 80 & 443 then make sure the service responds successfully on both ports (http/200). If the health check will fail so will your service, thus your cluster deployment will fail as well.

eugenmihailescu avatar Aug 11 '23 02:08 eugenmihailescu