This is typically done with a script, not the Dockerfile. The script (perhaps in bash or python) can run at build time to determine what environment it is in, and act accordingly. This can be included in the RUN command, but it risks becoming quite complex and difficult to read in the Dockerfile. Furthermore, each additional RUN or CMD entry in the ...
The Docker Desktop is giving the option to publish ports to the container ports that have been "exposed" in the image. Exposing a port in an image is documentation from the image creator to those running the image, to know what port the application inside the container should be listening. And in this case, it's Docker Desktop that's running the ...
I would just have a base script that have the things in common for most of the platform like base_install.sh
Then I would have multiple dockerfiles that can use this base script, an example for your amd64 dockerfile DockerfileAMD64:
RUN apt-get install specific64things -y
and you can build it with:
docker build -f ...
Your listen 443 need to have ssl parameter to tell Nginx that all connections accepted on this port should work in SSL mode.
See example at https://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server
Shown here for convenience:
listen 443 ssl;