WORKDIR not working

In a Dockerfile, the WORKDIR command seems to be overridden by the Fly console now. This is new behavior that did not occur in the past. Has happened today to me and at least two other Django developers on existing projects.

This is likely to break many build scripts. It also means, for newcomers, that if you have set a WORKDIR you expect to be able to fly ssh console and run Python/Django commands from there instead of needing to cd now into whatever directory your WORKDIR is set to.

1 Like

So it sounds like “fly ssh console” used to take the Dockerfile WORKDIR into account?

(to my knowledge it never did - at least in my experience! The stuff that makes SSH work isn’t run through the “docker” setup BUT i also don’t work on that system and could def be wrong )

Let me know if i’m incorrect in your meaning!

I know the pre release commands will take WORKDIR into account since they are basically CMD being passed to ENTRYPOINT.

That’s very interesting. It sounds like this behavior is built into Fly then and won’t be changing, which is helpful to know. And to note in tutorials/docs.

It’s possible this difference is what tripped us up. I’ll ask around some more. Thanks for the quick informed response!

1 Like