Skip to content

Commit

Permalink
allow for the bundling of Core package from apt "testing" pool
Browse files Browse the repository at this point in the history
### What
a new Dockerfile to install Core from the "testing" pool
an update to the Makefile specifically for this case

### Why
adding support for the "testing" pool to the Dockerfile would make
the file more confusing to read, so I decided to use a separate Dockerfile

### Testing
I will test this manually shortly

### Issue addressed by this PR
stellar/ops#3124
  • Loading branch information
mwtzzz committed Sep 19, 2024
1 parent f668d5b commit 4bb244b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions services/horizon/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# install Core from apt "stable" or "unstable" pool, and horizon from apt "testing" pool
FROM ubuntu:focal

ARG VERSION
Expand Down
19 changes: 19 additions & 0 deletions services/horizon/docker/Dockerfile.core-testing
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# install both horizon and core from apt "testing" pool
FROM ubuntu:focal

ARG VERSION
ARG STELLAR_CORE_VERSION
ARG DEBIAN_FRONTEND=noninteractive
ARG ALLOW_CORE_UNSTABLE=no

RUN apt-get update && apt-get install -y wget apt-transport-https gnupg2 && \
wget -qO /etc/apt/trusted.gpg.d/SDF.asc https://apt.stellar.org/SDF.asc && \
echo "deb https://apt.stellar.org focal testing" | tee -a /etc/apt/sources.list.d/SDF.list && \
cat /etc/apt/sources.list.d/SDF.list && \
apt-get update && \
apt-cache madison stellar-core && eval "apt-get install -y stellar-core${STELLAR_CORE_VERSION+=$STELLAR_CORE_VERSION}" && \
apt-cache madison stellar-horizon && apt-get install -y stellar-horizon=${VERSION} && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/log/*.log /var/log/*/*.log

EXPOSE 8000
ENTRYPOINT ["/usr/bin/stellar-horizon"]
17 changes: 17 additions & 0 deletions services/horizon/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ BUILD_DATE := $(shell date -u +%FT%TZ)

TAG ?= stellar/stellar-horizon:$(VERSION)

# build with Core from apt "stable" or "unstable", and horizon from apt "testing"
docker-build:
ifndef VERSION
$(error VERSION environment variable must be set. For example VERSION=2.4.1-101 )
Expand All @@ -22,6 +23,22 @@ else
-t $(TAG) .
endif

# build Core and Horizon from apt "testing"
docker-build-core-testing:
ifndef VERSION
$(error VERSION environment variable must be set. For example VERSION=2.4.1-101 )
endif
ifndef STELLAR_CORE_VERSION
$(SUDO) docker build --file ./Dockerfile.core-testing --pull $(DOCKER_OPTS) \
--label org.opencontainers.image.created="$(BUILD_DATE)" \
--build-arg VERSION=$(VERSION) -t $(TAG) .
else
$(SUDO) docker build --pull $(DOCKER_OPTS) \
--label org.opencontainers.image.created="$(BUILD_DATE)" \
--build-arg VERSION=$(VERSION) --build-arg STELLAR_CORE_VERSION=$(STELLAR_CORE_VERSION) \
-t $(TAG) .
endif

docker-push:
ifndef TAG
$(error Must set VERSION or TAG environment variable. For example VERSION=2.4.1-101 )
Expand Down

0 comments on commit 4bb244b

Please sign in to comment.