wormhole/Dockerfile.proto

48 lines
1.5 KiB
Docker
Raw Normal View History

# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
node: upgrade to go 1.21.9 (#3855) * node: update quic-go Ran via: go get github.com/quic-go/quic-go@v0.42.0 * node: update mongo-drive dependency Ran via: go get go.mongodb.org/mongo-driver@latest * node: upgrade libp2p-go Ran via: go get github.com/libp2p/go-libp2p@v0.33.1 Refs: #3863 * node: fallout from the go upgrade in the go.sum Run via: go mod tidy This updates the go.sum and removes unnecessary indirect references. * docs: use go1.21.8 * github: use go1.21.8 Except for wormchain. * node: update dockerfiles to use go 1.21.8 This was done with scripts/update-go-version.sh * scripts: update linter dockerfile to use go 1.21.8 This was done with scripts/update-go-version.sh * wormchain: update ibc-relayer to use go 1.21.8 This was done with scripts/update-go-version.sh * scripts: add update-go-version.sh This is a little helper to make updating the version of go a bit nicer. * scripts: update-go-version.sh fixes * set the default docker command to "dokcer" * update the comment for the humongous sed command for dockerfiles * github: fix go linting * Upgrade golangci-lint to a version built with go 1.21.x. The older version was a binary version built with go 1.20.x and it was failing against the newer code built with go 1.21.x * print the golangci-lint version in each run to see what version of go it was built with in case there are incompatibilties during the next upgrade * remove the linter config skipping over pkg/supervisor entirely and instead put in an override to ignore the `unused` linter for the pkg/supervisor testhelpers bits for unsed test functions necessary to satisfy the test interface. * scripts: update golang linter cli invocation * github: use the latest version of golangci-lint Because 1.52.2 is built with go 1.20.x which has issues with this project now that it is upgraded to 1.21.8. * node: remove implicit memory aliasing in a loop Caught by an upgraded golangci-lint with the gosec linter: ::medium file=node/pkg/watchers/evm/connectors/batch_poller.go,line=226,col=8::G601: Implicit memory aliasing in for loop. (gosec) ::medium file=node/pkg/watchers/evm/connectors/batch_poller.go,line=285,col=8::G601: Implicit memory aliasing in for loop. (gosec) ::medium file=node/pkg/watchers/evm/connectors/batch_poller_test.go,line=128,col=37::G601: Implicit memory aliasing in for loop. (gosec) See also: https://husni.dev/beware-of-implicit-memory-aliasing-in-go-foor-loop/ * node: update logging * Update go to 1.21.9 Automated via: scripts/update-go-version.sh 1.21.9 * node: update test root context teardown time Otherwise things get really sad. * scripts: additions to update-go-versions.sh * Standardized on prefacing functions with `function` for consistency * Added a few more comments to explain how things work * Automatically increment the go version and toolchain in go.mod * Standardized on prefacing functions with `function` for consistency * Make the go image debian version a variable for ease of maintenance * node: update go.mod to specify 1.21.9 * node: update node tests Review feedback from @pires * scripts: run go mod tidy in update-go-version.sh Required after running go mod edit or it refuses to build. * node: update go.mod Running `go mod tidy` removes the toolchain so the build works. * node: update node tests --------- Co-authored-by: Ryan Hamphrey <hamphreyryan26@gmail.com>
2024-04-19 11:43:36 -07:00
FROM docker.io/golang:1.21.9-bullseye@sha256:311468bffa9fa4747a334b94e6ce3681b564126d653675a6adc46698b2b88d35 AS go-tools
RUN mkdir /app
2022-07-05 13:40:42 -07:00
COPY tools/build.sh /app/tools/
COPY tools/go.* /app/tools/
RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \
cd /app/tools && CGO_ENABLED=0 ./build.sh
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
node: upgrade to go 1.21.9 (#3855) * node: update quic-go Ran via: go get github.com/quic-go/quic-go@v0.42.0 * node: update mongo-drive dependency Ran via: go get go.mongodb.org/mongo-driver@latest * node: upgrade libp2p-go Ran via: go get github.com/libp2p/go-libp2p@v0.33.1 Refs: #3863 * node: fallout from the go upgrade in the go.sum Run via: go mod tidy This updates the go.sum and removes unnecessary indirect references. * docs: use go1.21.8 * github: use go1.21.8 Except for wormchain. * node: update dockerfiles to use go 1.21.8 This was done with scripts/update-go-version.sh * scripts: update linter dockerfile to use go 1.21.8 This was done with scripts/update-go-version.sh * wormchain: update ibc-relayer to use go 1.21.8 This was done with scripts/update-go-version.sh * scripts: add update-go-version.sh This is a little helper to make updating the version of go a bit nicer. * scripts: update-go-version.sh fixes * set the default docker command to "dokcer" * update the comment for the humongous sed command for dockerfiles * github: fix go linting * Upgrade golangci-lint to a version built with go 1.21.x. The older version was a binary version built with go 1.20.x and it was failing against the newer code built with go 1.21.x * print the golangci-lint version in each run to see what version of go it was built with in case there are incompatibilties during the next upgrade * remove the linter config skipping over pkg/supervisor entirely and instead put in an override to ignore the `unused` linter for the pkg/supervisor testhelpers bits for unsed test functions necessary to satisfy the test interface. * scripts: update golang linter cli invocation * github: use the latest version of golangci-lint Because 1.52.2 is built with go 1.20.x which has issues with this project now that it is upgraded to 1.21.8. * node: remove implicit memory aliasing in a loop Caught by an upgraded golangci-lint with the gosec linter: ::medium file=node/pkg/watchers/evm/connectors/batch_poller.go,line=226,col=8::G601: Implicit memory aliasing in for loop. (gosec) ::medium file=node/pkg/watchers/evm/connectors/batch_poller.go,line=285,col=8::G601: Implicit memory aliasing in for loop. (gosec) ::medium file=node/pkg/watchers/evm/connectors/batch_poller_test.go,line=128,col=37::G601: Implicit memory aliasing in for loop. (gosec) See also: https://husni.dev/beware-of-implicit-memory-aliasing-in-go-foor-loop/ * node: update logging * Update go to 1.21.9 Automated via: scripts/update-go-version.sh 1.21.9 * node: update test root context teardown time Otherwise things get really sad. * scripts: additions to update-go-versions.sh * Standardized on prefacing functions with `function` for consistency * Added a few more comments to explain how things work * Automatically increment the go version and toolchain in go.mod * Standardized on prefacing functions with `function` for consistency * Make the go image debian version a variable for ease of maintenance * node: update go.mod to specify 1.21.9 * node: update node tests Review feedback from @pires * scripts: run go mod tidy in update-go-version.sh Required after running go mod edit or it refuses to build. * node: update go.mod Running `go mod tidy` removes the toolchain so the build works. * node: update node tests --------- Co-authored-by: Ryan Hamphrey <hamphreyryan26@gmail.com>
2024-04-19 11:43:36 -07:00
FROM docker.io/golang:1.21.9-bullseye@sha256:311468bffa9fa4747a334b94e6ce3681b564126d653675a6adc46698b2b88d35 AS go-build
COPY --from=go-tools /app /app
2022-07-05 13:40:42 -07:00
COPY buf.* /app
COPY proto /app/proto
RUN --mount=type=cache,target=/root/.cache \
cd /app && \
tools/bin/buf lint && \
tools/bin/buf generate
FROM node:16-alpine@sha256:004dbac84fed48e20f9888a23e32fa7cf83c2995e174a78d41d9a9dd1e051a20 AS node-build
COPY --from=go-tools /app /app
2022-07-05 13:40:42 -07:00
COPY buf.* /app
COPY proto /app/proto
2022-07-05 13:40:42 -07:00
COPY tools/package.json /app/tools/
COPY tools/package-lock.json /app/tools/
RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/root/.npm \
cd /app/tools && npm ci
RUN --mount=type=cache,target=/root/.cache \
cd /app && \
tools/bin/buf generate --template buf.gen.web.yaml
FROM scratch AS go-export
COPY --from=go-build /app/node/pkg/proto pkg/proto
FROM scratch AS node-export
COPY --from=node-build /app/sdk/js-proto-web/src sdk/js-proto-web/src
COPY --from=node-build /app/sdk/js-proto-node/src sdk/js-proto-node/src