Note: All installation instructions are specific to
[Amazon Linux 2 AMI (HVM), SSD Volume Type - ami-01720b5f421cf0179 (64-bit x86) / ami-04c2a5c7e6c051fb2 (64-bit Arm)]
- 
Prerequisite - Running  EC2 instance [Amazon Linux 2 AMI (HVM), SSD Volume Type - ami-01720b5f421cf0179 (64-bit x86) / ami-04c2a5c7e6c051fb2 (64-bit Arm)]
- Security groups having SSH permission
- Security groups having 5000 port openfor docker-compose demo
 
- Running  EC2 instance 
- 
Install Docker >`sudo yum update -y` >`sudo amazon-linux-extras install docker`
Note: Please refer the below link for more details: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html
- 
Install Docker-Compose sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- 
Install python 3 >`sudo yum install python3`Note: python3 is required to run the program. 
- 
Change Permission of Docker-Compose: >`sudo chmod +x /usr/local/bin/docker-compose`
- 
Configure Docker Service: - 
Start the Docker service >`sudo service docker start`
- 
Add the ec2-userto thedockergroup so you can execute Docker commands without usingsudo.>`sudo usermod -a -G docker ec2-user`
- 
Enable Docker Service >`sudo systemctl enable docker.service`
 Note: - Log out and log back in again to pick up the new dockergroup permissions. You can accomplish this by closing your current SSH terminal window and reconnecting to your instance in a new one. Your new SSH session will have the appropriatedockergroup permissions.
 - Verify that the ec2-usercan run Docker commands withoutsudo.
 docker info
- 
- 
config.pyClassBelow are the config parameter defined in config.pyclass.- DOCKERIZE_PY_APP_PATH (default './DOCKERIZE_PY_APP/')
- DOCKERIZE_PY_APP_FILE (default'app.py'[3.8 version])
- DOCKERIZE_PY2_APP_FILE (default 'app2.py'[2.7 version])
- DOCKER_COMPOSE_APP_PATH (default './DOCKER_COMPOSE_DEMO_APP/')
- DOCKER_FILE_TEMPLATE (template for creating docker file)
 
- DOCKERIZE_PY_APP_PATH (default 
- 
Copy DOCKER_CLIand runrequirements.txt- Copy the DOCKER_CLIfrom local to Docker node using winscp or any other tool.
- Go to root dir  DOCKER_CLI
- Run below command
> sudo python3 -m pip install -r requirements.txt
 
- Copy the 
- 
Run Docker-CLI program Note: Do the SSHto Docker Node- 
Go to root dir DOCKER_CLI
- 
Run below command >`python3 DockerCli.py`
 
- 
Press-1for navigate toDocker Basic OperationsMenu.
Press-2for navigate toContainerize a Python ProgramMenu.
Press-3for navigate toDocker Compose DemoMenu.
Press-4for navigate toSettingMenu.
Press-5for Exit.
Press-1List all containers.
Press-2Run a container[detach Mode].
Press-3Stop containers.
Press-4Remove stopped/exited containers.
Press-5Go Back.
Press-1Containerize and Run a Python Program.
Press-2Run a Python Program.
Press-3Go Back.
Press-1Run Docker Compose Demo.
Press-2Go Back.
Press-1for disabling the color menu. (defaultenable)
Press-2for enable color menu after disabling.
Press-3for display "Docker Client Info" in Main Menu.(defaultdisplay)
Press-4for hiding "Docker Client Info" in Main Menu.
Press-5Go Back.
- For Docker Compose i have taken the reference from below link and modified(Added new containers) for demo. https://github.com/arsenidze/microservice_application
- Docker-Compose APP Details:
- After
Docker-Compose Demorun successfully.App can be open in browser usingDocker AMI public IPhttp://Public_IP_of_Docker_Node:5000






