Difference between revisions of "Docker run -p"

From wikieduonline
Jump to navigation Jump to search
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
  [[docker run]] -p
+
  [[docker run]] -p     It will overwrite value defined by <code>EXPOSE</code> in <code>[[Dockerfile]]</code>
 +
  -p, [[--publish]] list                  Publish a container's port(s) to the host
  
  
  -p
+
  -p [[--publish]]
  -P
+
  -P --publish-all                    Publish all exposed ports to random ports
 +
 
 +
 
 +
docker run -p 9092:9092 [[apache]]/[[kafka]]:3.7.0
  
 
== Related ==
 
== Related ==
* [[EXPOSE]]
+
* <code>[[EXPOSE]]</code>
 
* [[PortBindings (Docker)]]
 
* [[PortBindings (Docker)]]
 +
* <code>[[docker start]]</code>
 +
* <code>[[--network]]</code>
 +
* [[ECS]]: <code>[[containerDefinitions]]</code>
 +
* [[docker run -d]]
  
 
== See also ==
 
== See also ==
 
* {{docker run}}
 
* {{docker run}}
 +
* {{Docker networking}}
  
 
[[Category:Docker]]
 
[[Category:Docker]]

Latest revision as of 09:41, 21 March 2024

docker run -p     It will overwrite value defined by EXPOSE in Dockerfile
 -p, --publish list                   Publish a container's port(s) to the host


-p --publish
-P --publish-all                    Publish all exposed ports to random ports


docker run -p 9092:9092 apache/kafka:3.7.0

Related[edit]

See also[edit]

Advertising: