Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

luizcarloscf/docker-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Basics

Building application with 3 services: A, B and C.

A: Generates M square matrices of order N of random numbers. The matrices should be generated at a rate of F matrices per second. Sends the results to B.

B: Inverts the input matrix and calculates determinant. Sends the results to C.

C: Receives the value of the determinant and shows on the screen.

Each service must run in a different container.

Installation

First of all you need to install docker. Go to Oficial page for more details about installation.

Image

Once you have docker installed, you can get the image of this aplication from my repository on Docker Hub.

docker pull luizcarloscf/servers-socket

Or you can build the image.

docker build --tag=servers-socket .

Network

Create our user-definied network.

docker network create my-net

Containers

Run the container that shows the results.

docker run --network=my-net --name=result servers-socket python3 result.py port=80

Run the container that calculate the determinant and forward the messages.

docker run -d --network=my-net --name=forward-det servers-socket python3 forward-det.py port_on=80 port_to=80

Run the container that generate the matrix.

docker run --network=my-net --name=generate-matrix servers-socket python3 generate-matrix.py port=80 m=1 n=10 f=2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published