From 6453f9f735217e986c4c40315fe84fceadad3047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 8 Aug 2024 21:10:31 +0900 Subject: [PATCH] plugins: Simpilfy image build, builds can use module cache now on podman --- plugins/chainlink.Dockerfile | 40 +++++++++++++----------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/plugins/chainlink.Dockerfile b/plugins/chainlink.Dockerfile index 6d42567c745..d30586d261a 100644 --- a/plugins/chainlink.Dockerfile +++ b/plugins/chainlink.Dockerfile @@ -25,32 +25,19 @@ RUN make install-medianpoc # Install ocr3-capability binary RUN make install-ocr3-capability -# Link LOOP Plugin source dirs with simple names -RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-feeds | xargs -I % ln -s % /chainlink-feeds -RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-data-streams | xargs -I % ln -s % /chainlink-data-streams -RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-solana | xargs -I % ln -s % /chainlink-solana -RUN mkdir /chainlink-starknet -RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-starknet/relayer | xargs -I % ln -s % /chainlink-starknet/relayer - # Build image: Plugins -FROM golang:1.22-bullseye as buildplugins -RUN go version +# FROM golang:1.22-bullseye as buildplugins +# RUN go version -WORKDIR /chainlink-feeds -COPY --from=buildgo /chainlink-feeds . -RUN go install ./cmd/chainlink-feeds +# WORKDIR /chainlink-feeds +# COPY --from=buildgo /chainlink-feeds . +RUN go install $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-feeds)/cmd/chainlink-feeds -WORKDIR /chainlink-data-streams -COPY --from=buildgo /chainlink-data-streams . -RUN go install ./mercury/cmd/chainlink-mercury +RUN go install $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-data-streams)/mercury/cmd/chainlink-mercury -WORKDIR /chainlink-solana -COPY --from=buildgo /chainlink-solana . -RUN go install ./pkg/solana/cmd/chainlink-solana +RUN go install $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-solana)/pkg/solana/cmd/chainlink-solana -WORKDIR /chainlink-starknet/relayer -COPY --from=buildgo /chainlink-starknet/relayer . -RUN go install ./pkg/chainlink/cmd/chainlink-starknet +RUN go install $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-starknet/relayer)/pkg/chainlink/cmd/chainlink-starknet # Final image: ubuntu with chainlink binary FROM ubuntu:20.04 @@ -69,17 +56,18 @@ COPY --from=buildgo /go/bin/chainlink /usr/local/bin/ COPY --from=buildgo /go/bin/chainlink-medianpoc /usr/local/bin/ COPY --from=buildgo /go/bin/chainlink-ocr3-capability /usr/local/bin/ -COPY --from=buildplugins /go/bin/chainlink-feeds /usr/local/bin/ +COPY --from=buildgo /go/bin/chainlink-feeds /usr/local/bin/ ENV CL_MEDIAN_CMD chainlink-feeds -COPY --from=buildplugins /go/bin/chainlink-mercury /usr/local/bin/ +COPY --from=buildgo /go/bin/chainlink-mercury /usr/local/bin/ ENV CL_MERCURY_CMD chainlink-mercury -COPY --from=buildplugins /go/bin/chainlink-solana /usr/local/bin/ +COPY --from=buildgo /go/bin/chainlink-solana /usr/local/bin/ ENV CL_SOLANA_CMD chainlink-solana -COPY --from=buildplugins /go/bin/chainlink-starknet /usr/local/bin/ +COPY --from=buildgo /go/bin/chainlink-starknet /usr/local/bin/ ENV CL_STARKNET_CMD chainlink-starknet # Dependency of CosmWasm/wasmd -COPY --from=buildgo /go/pkg/mod/github.com/\!cosm\!wasm/wasmvm@v*/internal/api/libwasmvm.*.so /usr/lib/ +# COPY --from=buildgo /go/pkg/mod/github.com/\!cosm\!wasm/wasmvm@v*/internal/api/libwasmvm.*.so /usr/lib/ +RUN cp /go/pkg/mod/github.com/\!cosm\!wasm/wasmvm@v*/internal/api/libwasmvm.*.so /usr/lib/ RUN chmod 755 /usr/lib/libwasmvm.*.so RUN if [ ${CHAINLINK_USER} != root ]; then \