'Can I specify a custom Dockerfile name with Heroku container:push?
I have a project with two Dockerfiles in the same directory:
project
/Dockerfile.web
/Dockerfile.worker
I can use them to build different parts of the same project very easily with docker-compose. However, I struggle to tell heroku container:push that I want to use a custom Dockerfile. It seems I can only refer to custom directories to build.
Is there a solution to that?
Solution 1:[1]
I found an answer to my question.
There doesn't seem to be a way to specify a custom Dockerfile name to heroku container:push.
However, as per documentation there is --recursive parameter for the heroku container:push command that does exactly what I needed:
Look for Dockerfile.web and build the web dyno:
heroku container:push web --recursive
Look for Dockerfile.worker and build the worker dyno:
heroku container:push worker --recursive
Look for both Dockerfile.web and Dockerfile.worker and build both dynos:
heroku container:push web worker --recursive
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | adamsfamily |
