Skip to content

Commit

Permalink
plugins: Simpilfy image build, builds can use module cache now on podman
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Sep 25, 2024
1 parent 0bf0cc1 commit 6453f9f
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions plugins/chainlink.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down

0 comments on commit 6453f9f

Please sign in to comment.