diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..3386b5f23 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,15 @@ +--- +name: Docker + +on: + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - run: echo "Building and pushing Docker image..." diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..1c95820fb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM rust:latest + +RUN rustup target add wasm32v1-none + +RUN apt-get update && \ + apt-get install -y --no-install-recommends dbus gnome-keyring libdbus-1-3 libudev1 libssl3 && \ + LATEST=$(curl -s https://api.github.com/repos/stellar/stellar-cli/releases/latest | grep '"tag_name"' | sed 's/.*"v\(.*\)".*/\1/') && \ + ARCH=$(dpkg --print-architecture) && \ + curl -fsSL "https://github.com/stellar/stellar-cli/releases/download/v${LATEST}/stellar-cli_${LATEST}_${ARCH}.deb" \ + -o /tmp/stellar-cli.deb && \ + dpkg -i /tmp/stellar-cli.deb && \ + rm -rf /var/lib/apt/lists/* /tmp/stellar-cli.deb + +ENV STELLAR_CONFIG_HOME=/config +ENV STELLAR_DATA_HOME=/data + +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh + +WORKDIR /source + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh", "stellar"] +CMD [] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 000000000..832c4786e --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e + +# Start D-Bus session bus +export DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/dbus-session" +dbus-daemon --session --address="$DBUS_SESSION_BUS_ADDRESS" --fork + +# Unlock gnome-keyring with an empty password for non-interactive use +eval "$(echo '' | gnome-keyring-daemon --unlock --components=secrets)" +export GNOME_KEYRING_CONTROL +export SSH_AUTH_SOCK + +cd /source +exec "$@"