We're running an Elastic Beanstalk Multi-container Docker environment on Amazon Linux 1, which has been deprecated and needs to be migrated to Amazon Linux 2.
The documentation presents two options for doing so:
As far as I understand, they recommend the first option, because the ECS platform it is more similar to the current platform on AL1.
I'm wondering, however, what the practical differences between those two options are. What even is the role of ECS in this, what advantages does it have over pure Docker?
On ECS, we deploy with a Dockerrun.aws.json, which we generate from a docker-compose.yml with container-transform. This works, but it would be nice if we could skip that transformation. With the second option, without ECS, would it be possible to deploy a docker-compose.yml file directly?
We use a single instance, without a load-balancer (but want to keep the option open for the future).
Has anyone done this migration, with either option, and can provide some insights about the process?
I asked this question last year, and it didn't get any answers or upvotes, so it was deleted by the community bot. I'm posting it again, because I have to do the migration now, and I was advised to do so.
In the meantime, Amazon Linux 2023 has been released, but the question remains basically the same (Docker platform or ECS platform?).
I'm in the process of doing the migration now, and can share what I have learned so far.
With the release of Amazon Linux 2023, they have also updated the documentation. I have found the following to be most relevant to make a decision:
Source
Emphasis mine. To summarize: The ECS platform offers an easier migration, but the Docker platform is simpler and uses less resources.
Since we have to update the configuration anyway, it seems like a good idea to migrate to the Docker platform even when that is more work, because I prefer to use a "simpler approach" that "uses less resources". It is also more familiar to work with docker-compose directly than with ECS tasks.
Before, we used to transform a docker-compose file to a Dockerrun.aws.json with container-transform. On the Docker platform, this step isn't needed anymore, and we can instead deploy the
docker compose
directly.I had to add the following options to the
docker-compose.yml
file, for each container:mem_limit
env_file: .env
restart: no
for containers that wereessential: false
in theDockerrun.aws.json
No other changes were necessary in the deployment artifact. We now bundle the
docker-compose.yml
together with the.ebextensions
, like we did before with theDockerrun.aws.json
.