Skip to content

Small Example of connecting server and client by creating docker image and using docker-compose.

Notifications You must be signed in to change notification settings

Rchanger/docker-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

docker-example

Small Example of connecting server and client by creating docker image and using docker-compose.

Just execute following command to make it work

docker-compose up

The other way of linking two container is using the --link option.

Perform following step to achieve the same.

  1. First inside server folder update the copy command in dockerfile from /server . to . . and then execute following command to build server image.
    sudo docker build -t server . 
    
  2. Run the server container by executing following command.
    sudo docker run -d -p 8090:8090 -e Port=3030 --name server -v test-volume:/serverdata -t server 
    
  3. Modify the copy command of dockerfile inside client folder from /client . to . . and excute following command to build the client image.
    sudo docker build -t client .
    
  4. Run the client container by executing following command.
    sudo docker run -d -p 9090:9090 -e ServerHost=server -e ServerPort=3030 --name client --link server -v test-volume:/clientdata -t  client
    

About

Small Example of connecting server and client by creating docker image and using docker-compose.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published