From 2d8ec345cdf5fc1e0d40a9c7788d1db2c716730a Mon Sep 17 00:00:00 2001 From: Chirantan Ekbote Date: Wed, 22 Jun 2022 19:06:35 +0900 Subject: [PATCH] Move node Dockerfile to parent directory The node package needs access to the sdk directory so move the Dockerfile up one level so that both directories can be added to the build. --- node/Dockerfile => Dockerfile.node | 7 ++++--- Tiltfile | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) rename node/Dockerfile => Dockerfile.node (94%) diff --git a/node/Dockerfile b/Dockerfile.node similarity index 94% rename from node/Dockerfile rename to Dockerfile.node index 4a5562932..8ceb2315c 100644 --- a/node/Dockerfile +++ b/Dockerfile.node @@ -3,7 +3,7 @@ FROM --platform=linux/amd64 docker.io/golang:1.17.5@sha256:90d1ab81f3d157ca649a9 # libwasmvm.so is not compatible with arm # Support additional root CAs -COPY go.mod cert.pem* /certs/ +COPY node/go.mod cert.pem* /certs/ # Debian RUN if [ -e /certs/cert.pem ]; then cp /certs/cert.pem /etc/ssl/certs/ca-certificates.crt; fi # git @@ -11,16 +11,17 @@ RUN if [ -e /certs/cert.pem ]; then git config --global http.sslCAInfo /certs/ce WORKDIR /app -COPY tools tools +COPY node/tools tools RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ cd tools/ && go build -mod=readonly -o /dlv github.com/go-delve/delve/cmd/dlv -COPY . . +COPY node node ARG GO_BUILD_ARGS=-race RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ + cd node && \ go build ${GO_BUILD_ARGS} -gcflags="all=-N -l" --ldflags '-extldflags "-Wl,--allow-multiple-definition" -X "github.com/certusone/wormhole/node/cmd/guardiand.Build=dev"' -mod=readonly -o /guardiand github.com/certusone/wormhole/node && \ cp /go/pkg/mod/github.com/!cosm!wasm/wasmvm@v0.16.2/api/libwasmvm.so /usr/lib/ diff --git a/Tiltfile b/Tiltfile index 0a7329040..3aae600b9 100644 --- a/Tiltfile +++ b/Tiltfile @@ -121,8 +121,8 @@ if explorer: docker_build( ref = "guardiand-image", - context = "node", - dockerfile = "node/Dockerfile", + context = ".", + dockerfile = "Dockerfile.node", target = "build", )