A brief story of Docker deployment at AWS

We are creating a new product and it’s strategic for us to deploy it using Docker. The first option was to use AWS Elastic Beanstalk, choosing the option to deploy dockers. The deploy works perfectly. The problem is the re-deploy.

We don’t know the root cause but sometimes when we re-deploy a container we get this error:

Stop the container before attempting removal or force remove

We think that this is an AWS problem due to 2 reasons:

Sometimes the re-deploy works perfectly

I should not care about stopping a container. This is an AWS problem 🙂

We even tried StackOverflow to solve this problem, but no answers until now.

One of the tries was to deploy a temporary container before deploying the final container. So instead of doing this:

Actually, in this “-C” parameter we pass all necessary commands to redeploy a container: docker stop, docker rm, docker rmi and docker run.

So to summarize our opinion: AWS Elastic Beanstalk can be great to quickly deploy a product or to do a Proof of Concept. But sometimes the excess of layers and abstractions can make you be less productive. Think about it 😉