Docker `RUN --mount=type=bind,target=.` support
Any plans on supporting bind mounts? Because it's quite convenient to do
instead of
5 Replies
Project ID:
N/A
N/A
I've never seen someone do that instead of using COPY
there's no reason railway should support something so very non-standard imo
Docker officially do this and also it's a common practice:
https://github.com/docker/compose/blob/v2/Dockerfile#L65
https://github.com/docker/buildx/blob/master/Dockerfile#L72
and so on...
Search for
--mount=type=bind
and --mount=.
they are the same.
The point is when you bind you can restrict write (while you copy you lose control) + files stay in the intermediate layer in your local cache like "come on man" π
Also it's faster (especially on Mac with gGRP transport).
That's ok if you don't want to implement it. I get it.
Just add it into documentation plz because it's not obvious at all. The build just breaks while it works locally and looks fine -- the worst type of error π
Also both COPY and --mount=type=bind
can't get access to files outside of the context directory and can't access files mentioned in .dockerignore
.BTW no offence but the official documentation is literally saying to get rid of COPY π€£
https://docs.docker.com/build/guide/mounts/#add-bind-mounts