Skip to content

Commit

Permalink
wip slim
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Sep 6, 2023
1 parent c8826f5 commit 43157ce
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 21 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ EXPOSE 11625
EXPOSE 11626

ADD dependencies /
RUN ["chmod", "+x", "dependencies"]
RUN /dependencies

RUN apt-get -y install libunwind8 postgresql curl sqlite libc++abi1-12 libc++1-12
COPY --from=stellar-core /usr/local/bin/stellar-core /usr/bin/stellar-core

COPY --from=horizon /go/bin/horizon /usr/bin/stellar-horizon
Expand Down
54 changes: 39 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
__PHONY__: build build-deps
__PHONY__: run logs build build-deps build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc

TAG?=dev
CORE_REF?=master
CORE_CONFIGURE_FLAGS?=--disable-tests
SOROBAN_TOOLS_REF?=main
GO_REF?=$(shell ./scripts/soroban_repo_to_horizon_repo.sh $(SOROBAN_TOOLS_REF))
SOROBAN_RPC_REF?=main
HORIZON_REF?=$(shell ./scripts/soroban_repo_to_horizon_repo.sh $(SOROBAN_RPC_REF))
FRIENDBOT_REF?=$(HORIZON_REF)

run:
docker run --rm --name stellar -p 8000:8000 stellar/quickstart:$(TAG) --standalone --enable-soroban-rpc

logs:
docker exec stellar /bin/sh -c 'tail -F /var/log/supervisor/*'

build-latest:
$(MAKE) build TAG=latest \
CORE_REF=v19.13.0 \
HORIZON_REF=horizon-v2.26.1 \
SOROBAN_RPC_REF=v0.4.0

build-testing:
$(MAKE) build TAG=testing \
CORE_REF=v19.13.0 \
HORIZON_REF=horizon-v2.26.1 \
SOROBAN_RPC_REF=v0.4.0

build-soroban-dev:
$(MAKE) build TAG=soroban-dev \
CORE_REF=soroban-preview-10-July20 \
CORE_CONFIGURE_FLAGS='--disable-tests --enable-next-protocol-version-unsafe-for-production' \
HORIZON_REF=soroban-v0.0.9.1 \
SOROBAN_RPC_REF=v0.9.2

build:
$(MAKE) -j 4 build-deps
docker build -t stellar/quickstart:$(TAG) -f Dockerfile . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(CORE_REF) --build-arg HORIZON_IMAGE_REF=stellar-horizon:$(HORIZON_REF) --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(FRIENDBOT_REF) --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(SOROBAN_RPC_REF)

build-deps: build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc

build-deps-core:
docker build -t stellar-core:$(TAG) -f docker/Dockerfile.testing https://github.com/stellar/stellar-core.git#$(CORE_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true --build-arg CONFIGURE_FLAGS="$(CORE_CONFIGURE_FLAGS)"
docker build -t stellar-core:$(CORE_REF) -f docker/Dockerfile.testing https://github.com/stellar/stellar-core.git#$(CORE_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true --build-arg CONFIGURE_FLAGS="$(CORE_CONFIGURE_FLAGS)"

build-deps-horizon:
docker build -t stellar-horizon:$(TAG) -f Dockerfile.horizon --target builder . --build-arg REF="$(GO_REF)"
docker build -t stellar-horizon:$(HORIZON_REF) -f Dockerfile.horizon --target builder . --build-arg REF="$(HORIZON_REF)"

build-deps-friendbot:
docker build -t stellar-friendbot:$(TAG) -f services/friendbot/docker/Dockerfile https://github.com/stellar/go.git#$(GO_REF)
docker build -t stellar-friendbot:$(FRIENDBOT_REF) -f services/friendbot/docker/Dockerfile https://github.com/stellar/go.git#$(FRIENDBOT_REF)

build-deps-soroban-rpc:
docker build -t stellar-soroban-rpc:$(TAG) -f cmd/soroban-rpc/docker/Dockerfile --target build https://github.com/stellar/soroban-tools.git#$(SOROBAN_TOOLS_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true

# the build-deps have the four dependencies for the building of the
# dockers for core, horizon, friendbot and soroban-rpc. Specifying these as dependencies
# allow the make to run these in parallel when sufficient paralalism is specified using the -j option.
build-deps: build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc

build: build-deps
docker build -t stellar/quickstart:$(TAG) -f Dockerfile . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(TAG) --build-arg HORIZON_IMAGE_REF=stellar-horizon:$(TAG) --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(TAG) --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(TAG)
docker build -t stellar-soroban-rpc:$(SOROBAN_RPC_REF) -f cmd/soroban-rpc/docker/Dockerfile --target build https://github.com/stellar/soroban-tools.git#$(SOROBAN_RPC_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
9 changes: 5 additions & 4 deletions dependencies
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ set -e
# dependencies
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y curl wget git apt-transport-https \
libpq-dev libsqlite3-dev libsasl2-dev \
apt-get install -y curl apt-transport-https \
postgresql-client postgresql postgresql-contrib \
sudo vim zlib1g-dev supervisor psmisc \
nginx rsync jq netcat # Parsing stellar-core JSON for standalone network and checking core HTTP server
sudo supervisor psmisc \
nginx rsync jq netcat \
libunwind8 sqlite libc++abi1-12 libc++1-12
apt-get clean
rm -rf /var/lib/apt/lists/*

chown -R www-data:www-data /var/lib/nginx

Expand Down

0 comments on commit 43157ce

Please sign in to comment.