How to make remote hiring effective?
HR - August 17, 2020The outbreak of the COVID-19 has the world locked down...
Docker packages application and all its dependencies together in the form of a docker container to ensure that application works seamlessly in any environment. However, if you want to create more than one container for your application, you have to create several Docker files. Maintaining them can be a complex process and also quite time-consuming. Docker Compose, Azure Pipelines and Amazon ECR solves this problem by allowing you to automatically build, store and run multiple docker images.
Compose solves the problem by allowing you to use a YAML file to operate multi-container applications at once. You can set the desired amount of containers counts, their builds, and storage designs, and then with a single set of commands you can build, run and configure all the containers.
Docker Compose is great for development, testing, and staging environments, as well as continuous integration work-flows. Compose file is a YAML file which defines services, networks and volumes.
A service definition contains configuration that is applied to each container started for that service, much like passing command-line parameters to docker run. Likewise, network and volume definitions are analogous to docker network create and docker volume create.
So, using Compose is basically a three-step process:
Example Docker Compose
.env file sample
TAG=latest
ENV_DEV=Development
ENV_UAT=Uat
ENV_PROD=Production
DEV_PORT=8000
UAT_PORT=8001
PROD_PORT=8002
Build sample
This compose file builds dockerfile “Demo/Dockerfile” and creates the docker image “demo.webapp:${TAG}”
Release sample
version: “3.4”
services:
Docker Compose Commands:
Amazon Elastic Container Registry (ECR) is a fully-managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images.
AWS Cli commands:
Alternatives :
Azure Pipelines helps to Automate your builds and deployments with Pipelines so you spend less time with the nuts and bolts and more time being creative. It works with just aboupt any language or project type. Azure Pipelines combines continuous integration (CI) and continuous delivery(CD) to constantly and consistently test and build your code and ship it to any target.
Using Docker Compose and Amazon ECR with azure devops pipelines