When you create your docker container using the image you can specify the docker directories and ports which need to expose to outside (physical server)
docker create -t -v /home/user/app/service/appconf:/home/user/app/service/appconf -v /home/user/app/service/back:/home/user/app/service/back -v /home/user/app/service/log:/home/user/app/service/log -p 9020:9020 p 9099:9099 --net=host --hostname=docker-dk-lk --name=docker-dk docker-dk-server:docker-dk-server_v1
This is the command which we used in creating the container.
Right after the folder mapping we can do the mapping for ports.
- --net=host - This is the tag which we used to get all the physical server network routings in to the docker container. This tag is very useful whenever you struggle to get the UDP traffic in to the container.Even though by default TCP traffic ought to reach into the container, you need this parameter to route the multicast/UDP traffic in.
- --hostname - This allows you to configure the required hostname for the container
- --name - Container name which is stored in the server under.
End of the command we can find the relevant image repository location and the image name need to download.
No comments:
Post a Comment