https://github.com/rchanger/docker-example
Small Example of connecting server and client by creating docker image and using docker-compose.
https://github.com/rchanger/docker-example
docker docker-compose golang
Last synced: about 1 month ago
JSON representation
Small Example of connecting server and client by creating docker image and using docker-compose.
- Host: GitHub
- URL: https://github.com/rchanger/docker-example
- Owner: Rchanger
- Created: 2020-04-15T09:23:09.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-02T16:29:15.000Z (over 5 years ago)
- Last Synced: 2023-03-05T17:17:09.110Z (over 3 years ago)
- Topics: docker, docker-compose, golang
- Language: Go
- Size: 4.88 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
~~~