Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (47.6k points)

How can Docker be used in deploying microservices to AWS?

1 Answer

0 votes
by (106k points)

It is very simple to use Docker to deploy microservices to AWS. What you can do is just use aws-cli or docker-machine. Deployment of a microservice using docker is easy if you follow the proper methodology.

Let's say you have some micro-services which are independent. I prefer the following steps for the deployment of micro-services.

1) Create an image

a) First, get base docker image that is needed for given microservice for eg. I needed ubuntu:16.04, go:1.6 for my services.

b) Using Dockerfile, we create an image for our service. We can use dockerfile for

  • Install required apts and libraries.- We add service to the image.

Mostly binary of the service is added.

  • Required configuration files are added to the image. It's always a better idea to run a separate configuration server for all micro-services.

  • Add an entry point which is used to start the service. Needed parameters are set here.

  • This is it. All you have to do is run few docker commands and docker will do the rest.

2) Deployment & running microservices

  • Let's say now we have pushed our new image to docker hub

  • Now we need to create an EC2 instance. We will use docker-machine

To know more about these things I would suggest you must take up the following Docker Training Course which will help you master these things. You can also watch the following Docker tutorial to learn more about it.

Browse Categories