-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Dockerfile to reproduce the soroban-rpc .deb install issue
- Loading branch information
Paul Bellamy
committed
Apr 12, 2023
1 parent
1682460
commit 659f7f9
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
FROM golang as builder | ||
|
||
# Install rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh | ||
RUN chmod a+x rustup.sh && ./rustup.sh -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Build soroban-rpc | ||
RUN git clone https://github.com/stellar/soroban-tools.git | ||
WORKDIR soroban-tools | ||
RUN make build | ||
RUN go build -o /stellar-soroban-rpc ./cmd/soroban-rpc | ||
|
||
|
||
|
||
FROM ubuntu:focal | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
debhelper \ | ||
devscripts \ | ||
dh-systemd \ | ||
fakeroot \ | ||
lsb-release \ | ||
wget | ||
|
||
# Install the stellar apt repo | ||
RUN wget -qO - https://apt.stellar.org/SDF.asc | apt-key add - | ||
RUN echo "deb https://apt.stellar.org $(lsb_release -cs) unstable" | tee -a /etc/apt/sources.list.d/SDF.list | ||
RUN apt-get update | ||
|
||
# Add our debian package contents | ||
COPY . /packages | ||
WORKDIR /packages | ||
|
||
# Add soroban-rpc binary | ||
COPY --from=builder /stellar-soroban-rpc /packages/stellar-soroban-rpc/stellar-soroban-rpc | ||
|
||
# Configure the debian package build | ||
ARG VERSION=0.7.2 | ||
ARG BUILD_NUMBER=1 | ||
ARG CORE_VERSION=19.8.1-1250.064a2787a.focal~soroban | ||
RUN sed -i "s/_VERSION_/$VERSION/" stellar-soroban-rpc/debian/changelog | ||
RUN sed -i "s/_BUILD_VERSION_/$BUILD_NUMBER/" stellar-soroban-rpc/debian/changelog | ||
RUN sed -i "s/_CORE_VERSION_/$CORE_VERSION/" stellar-soroban-rpc/debian/control | ||
RUN sed -i "s/) stable;/) focal;/" stellar-soroban-rpc/debian/changelog | ||
|
||
# Build the .deb package | ||
RUN cd stellar-soroban-rpc && dpkg-buildpackage --no-sign | ||
|
||
# Try to install the package | ||
CMD apt install -y ./stellar-soroban-rpc_*.deb |