Skip to content
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

allow CORE_IMAGE bin override #95

Merged
merged 3 commits into from
Jun 18, 2024
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
11 changes: 11 additions & 0 deletions Dockerfile.core
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG CORE_IMAGE=

FROM $CORE_IMAGE as stellar-core

FROM ubuntu
ARG CORE_IMAGE_BIN_PATH=

COPY --from=stellar-core ${CORE_IMAGE_BIN_PATH} /usr/local/bin/stellar-core



12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ FRIENDBOT_IMAGE=
# image must have the bin at /usr/local/cargo/bin/stellar-xdr
RS_XDR_IMAGE=
#
# image must have core bin at /usr/local/bin/stellar-core
# image with stellar-core binary, assumes core bin at /usr/local/bin/stellar-core
CORE_IMAGE=
# define a custom path that core bin is located on CORE_IMAGE, other than /usr/local/bin/stellar-core
CORE_IMAGE_BIN_PATH=
#
# a prebuilt 'soroban-dev' image from the quickstart repo, if this is supplied,
# the other core, rpc, horizon, friendbot config settings are mostly ignored, since the quickstart image
Expand Down Expand Up @@ -146,11 +148,17 @@ build-core:
--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \
--build-arg CONFIGURE_FLAGS="$(CORE_COMPILE_CONFIGURE_FLAGS)" \
-f docker/Dockerfile.testing "$$SOURCE_URL"; \
fi; \
if [ ! -z "$(CORE_IMAGE)" ] && [ ! -z "$(CORE_IMAGE_BIN_PATH)" ]; then \
docker build -t "$(CORE_STAGE_IMAGE)" \
--build-arg CORE_IMAGE="$(CORE_IMAGE)" \
--build-arg CORE_IMAGE_BIN_PATH="$(CORE_IMAGE_BIN_PATH)" \
-f Dockerfile.core .; \
fi

build-quickstart: build-core build-friendbot build-horizon build-rs-xdr build-soroban-rpc
if [ -z "$(QUICKSTART_IMAGE)" ]; then \
CORE_IMAGE_REF=$$( [ -z "$(CORE_IMAGE)" ] && echo "$(CORE_STAGE_IMAGE)" || echo "$(CORE_IMAGE)"); \
CORE_IMAGE_REF=$$( [[ -z "$(CORE_IMAGE)" || ! -z "$(CORE_IMAGE_BIN_PATH)" ]] && echo "$(CORE_STAGE_IMAGE)" || echo "$(CORE_IMAGE)"); \
HORIZON_IMAGE_REF=$$( [ -z "$(HORIZON_IMAGE)" ] && echo "$(HORIZON_STAGE_IMAGE)" || echo "$(HORIZON_IMAGE)"); \
FRIENDBOT_IMAGE_REF=$$( [ -z "$(FRIENDBOT_IMAGE)" ] && echo "$(FRIENDBOT_STAGE_IMAGE)" || echo "$(FRIENDBOT_IMAGE)"); \
SOROBAN_RPC_IMAGE_REF=$$( [ -z "$(SOROBAN_RPC_IMAGE)" ] && echo "$(SOROBAN_RPC_STAGE_IMAGE)" || echo "$(SOROBAN_RPC_IMAGE)"); \
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@
QUICKSTART_IMAGE=<docker registry>/<docker image name>:<docker tag>

# this will skip building core from CORE_GIT_REF and instead
# will use the bin already compiled at /usr/local/bin/stellar-core in the existing docker image provided:
# will use the `stellar-core` by default at /usr/local/bin/stellar-core in the existing docker image provided:
CORE_IMAGE=<docker registry>/<docker image name>:<docker tag>

# define a custom path that `stellar-core` bin is located on CORE_IMAGE,
# to override the default of /usr/local/bin/stellar-core
CORE_IMAGE_BIN_PATH=

# this will skip building soroban-rpc from SOROBAN_RPC_GIT_REF and instead
# will use the bin already compiled at /bin/soroban-rpc in the existing docker image provided:
SOROBAN_RPC_IMAGE=<docker registry>/<docker image name>:<docker tag>
Expand Down
Loading