Guangning Yu's Blog
Home
Code
Data
Setup
Industry
MachineLearning
Archive
Publish or expose port (-p, --expose)
2019-02-26 13:42:45
|
Docker
``` $ docker run -p 127.0.0.1:80:8080/tcp ubuntu bash ``` This binds port 8080 of the container to TCP port 80 on 127.0.0.1 of the host machine. You can also specify udp and sctp ports. ``` $ docker run --expose 80 ubuntu bash ``` This exposes port 80 of the container without publishing the port to the host system’s interfaces.
Previous:
Access another container in Docker
Next:
Fix Chinese characters won't display in SSH