Normally when binding port, I would do docker run -p hostport:dockerport ...
, but can I specify the port binding inside my Dockerfile
?
I'm starting a server that listens on a port. The server takes the port through cmd line arguments. It would be great if I don't have to repeat the port in two places (in docker run
command and in Dockerfile
)