Skip to content

Commit 505fbbb

Browse files
authored
Add dockerfile. (#2414)
1 parent 6758566 commit 505fbbb

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Docker
3+
4+
on:
5+
workflow_dispatch:
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
permissions: {}
15+
steps:
16+
- run: echo "Building and pushing Docker image..."

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM rust:latest AS builder
2+
3+
ARG STELLAR_CLI_REF=main
4+
5+
RUN apt-get update && \
6+
apt-get install -y --no-install-recommends libdbus-1-dev libudev-dev pkg-config git && \
7+
rm -rf /var/lib/apt/lists/*
8+
9+
RUN git clone https://github.com/stellar/stellar-cli.git /tmp/stellar-cli && \
10+
cd /tmp/stellar-cli && \
11+
git fetch origin "${STELLAR_CLI_REF}" && \
12+
git checkout "${STELLAR_CLI_REF}" && \
13+
cargo install --locked --path cmd/stellar-cli && \
14+
rm -rf /tmp/stellar-cli
15+
16+
FROM rust:latest
17+
18+
RUN rustup target add wasm32v1-none
19+
20+
RUN apt-get update && \
21+
apt-get install -y --no-install-recommends dbus gnome-keyring libdbus-1-3 libudev1 libssl3 && \
22+
rm -rf /var/lib/apt/lists/*
23+
24+
COPY --from=builder /usr/local/cargo/bin/stellar /usr/local/bin/stellar
25+
26+
ENV STELLAR_CONFIG_HOME=/config
27+
ENV STELLAR_DATA_HOME=/data
28+
29+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
30+
RUN chmod +x /usr/local/bin/entrypoint.sh
31+
32+
WORKDIR /source
33+
34+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh", "stellar"]
35+
CMD []

entrypoint.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Start D-Bus session bus
5+
export DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/dbus-session"
6+
dbus-daemon --session --address="$DBUS_SESSION_BUS_ADDRESS" --fork
7+
8+
# Unlock gnome-keyring with an empty password for non-interactive use
9+
eval "$(echo '' | gnome-keyring-daemon --unlock --components=secrets)"
10+
export GNOME_KEYRING_CONTROL
11+
export SSH_AUTH_SOCK
12+
13+
cd /source
14+
exec "$@"

0 commit comments

Comments
 (0)