Skip to content

Commit

Permalink
add support to build horizon docker images from apt stable
Browse files Browse the repository at this point in the history
### What
build horizon docker image from core "stable" and horizon "stable"

### Why
this is needed in order to support the new workflow described in the
ticket

### Testing
this has been tested and works with apt "testing"

### Issue addressed by this PR
stellar/ops#3124
  • Loading branch information
mwtzzz committed Sep 24, 2024
1 parent 4bb244b commit 844f847
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
18 changes: 18 additions & 0 deletions services/horizon/docker/Dockerfile.stable
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# install Core from apt "stable"and horizon from apt "stable" 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 stable" | 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"]
16 changes: 14 additions & 2 deletions services/horizon/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,23 @@ ifndef VERSION
$(error VERSION environment variable must be set. For example VERSION=2.4.1-101 )
endif
ifndef STELLAR_CORE_VERSION
$(error STELLAR_CORE_VERSION environment variable must be set. )
else
$(SUDO) docker build --file ./Dockerfile.core-testing --pull $(DOCKER_OPTS) \
--label org.opencontainers.image.created="$(BUILD_DATE)" \
--build-arg VERSION=$(VERSION) -t $(TAG) .
--build-arg VERSION=$(VERSION) --build-arg STELLAR_CORE_VERSION=$(STELLAR_CORE_VERSION) \
-t $(TAG) .
endif

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

0 comments on commit 844f847

Please sign in to comment.