Docker Community Forums

Share and learn in the Docker community.

Beginner help with Dockerfile


(Jfhidakatsu) #1

Hello, I’m new with Docker and trying to simply serve an image on Heroku which should run and accept HTTP requests. Everything works locally, but when I try to push, it says “unsupported: Your Docker image must specify a CMD instruction.” So, it turns out I need a Dockerfile. I’m trying to make a simple Dockerfile which will run the image and use $PORT. Any help would be appreciated. Thank you.


(Jfhidakatsu) #2

Found my answer. The following worked:

FROM tf-serve
CMD [“tf-serve”]

where tf-serve was my image name. Not sure if the port is working yet, but this at least gets it up and running.


(Bodnar) #3

To expose ports, use EXPOSE 80 443 in the Dockerfile.


(Jfhidakatsu) #4

Ended up going a different route and didn’t need the Dockerfile. Thanks though!