Hacker News new | ask | show | jobs
by smoochy 1482 days ago
I think you're not seeing the actual point. The review isn't solving the issue. If you have two branches with alternating environments and you switch back and forth between them, how do you suppose your Dockerfile would handle it? What if that change isn't as simple as switching the Ruby version, but "compile and install some software" or some obscure config changes? I mean, it would be breaking all of the time, you'd end up having two containers anyway and you'd be scratching your head as to how to switch between them easily.
1 comments

You just build it. I'm not sure I understand the issue.

If you really want then just tag them, but building with a cache would be very quick when you swap.

I'm pretty sure everyone prefers "check out branch, run build command" to transparently do the right thing rather than mental book-keeping of "does the state of my docker container match the Dockerfile of my feature branch"?
Yes, that would be "docker build". Or docker compose if you want to do more things and organise the volume mapping side/other dependencies.

> does the state of my docker container match the Dockerfile of my feature branch"

Why track the state of your docker container? Just build it.