- Account in AWS
- Docker Account
- Bitbucket Account
- Create a repository in bitbucket and docker
- Create two environment variable (DOCKER_USER_NAME and DOCKER_PASS) for Docker User Name and Password (Path :- Repository -> Setting -> Environment variables
- Edit the bitbucket-pipelines.yml as per your Docker cloud details
- Check-in the code to code bitbucket repository
- Check whether build is successfull on bitbucket
- Check whether docker image is pushed to Docker repository
- Create role in AWS (Go to this URL : https://console.aws.amazon.com/iam/home?#/roles and click on “Create Role”)
- Follow the steps mentioned here : https://docs.docker.com/docker-cloud/cloud-swarm/link-aws-swarm/
- Copy the ARN Role and link Docker with AWS
- In Docker in Node Section, Create Node
- Create Stack file to deploy image to AWS Container
autodestroy: always
autoredeploy: true
image: 'kuldeep99/dbtest:latest'
links:
- mysqlkuldeep
ports:
- '8080:8080'
target_num_containers: 1
mysqlkuldeep:
environment:
- MYSQL_DATABASE=test
- MYSQL_PASS=root
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=demo_user
image: 'mysql:5.5'
ports:
- '3306:3306'
- Click on create and deploy, docker cloud will create container and deploy the latest image in the container