Skip to content

Create a prebuilt plugins Dockerfile #17583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ vendor/*
contracts/lcov.info
contracts/out/
/cache

# Used by plugins/chianlink.prebuilt.Dockerfile
bin/
lib/
18 changes: 18 additions & 0 deletions plugins/chainlink.prebuilt.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
##
# Takes Chainlink core as a base image and layers in private plugins.
##
ARG BASE_IMAGE=public.ecr.aws/chainlink/chainlink:v2.23.0-plugins

##
# Final image
##
FROM ${BASE_IMAGE} AS final
# This directory should contain a bin/ subdir with the plugins and an optional lib/ subdir with shared libraries.
ARG PKG_PATH=./build

# Copy/override any (optional) additional shared libraries.
# Square brackets in "li[b]" make this path optional - Docker build won't fail
# if the directory doesn't exist.
COPY ${PKG_PATH}/li[b] /usr/lib/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the square brackets some kind of well known hack?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, added a comment to clarify this in 4291268.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a "hack" to make lib COPY optional (don't fail if ${PKG_PATH}/lib doesn't exist), suggested here: https://stackoverflow.com/a/76040555

# Copy/override plugins.
COPY ${PKG_PATH}/bin /usr/local/bin
Loading