I had such error " Invalid Port Exposed (Possible Bug)" with that part in my Dockerfile: ARG PORT=5000 ENV PORT $PORT EXPOSE $PORT Is that a wrong approach? The idea behind is to have an option to steer the exposed port value during a build time.