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

updates to horizon docker builds #5466

Merged
merged 3 commits into from
Sep 26, 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
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
mwtzzz marked this conversation as resolved.
Show resolved Hide resolved

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"]
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"]
29 changes: 29 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,34 @@ 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
$(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) --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 --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) .
endif

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