in order to test with a local fork of cosmos-sdk. However, that won't work because the docker container cannot access that path.
My workaround has been the following:
Create a new subdirectory protocol/my_forks
Clone dydx's forks of cosmos-sdk, cometbft and iavl into that subdirectory
Add the new subdirectory to .gitignore
Mount the new subdirectory in the Dockerfile:
diff --git a/protocol/Dockerfile b/protocol/Dockerfile
index e7246444..868c820b 100644
--- a/protocol/Dockerfile
+++ b/protocol/Dockerfile
@@ -20,6 +20,7 @@ WORKDIR /dydxprotocol
COPY go.* ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
+ --mount=type=bind,source=my_forks,dst=/dydxprotocol/my_forks,ro \
go mod download
If that sounds like the right approach, I will create a PR that updates the README. I'm not doing that yet because I'm a newcomer to both the dydx and docker and there might be a smarter way.
protocol/README.md suggests inserting the following replace directive in
go.mod
in order to test with a local fork of cosmos-sdk. However, that won't work because the docker container cannot access that path.
My workaround has been the following:
protocol/my_forks
.gitignore
If that sounds like the right approach, I will create a PR that updates the README. I'm not doing that yet because I'm a newcomer to both the dydx and docker and there might be a smarter way.