-
Notifications
You must be signed in to change notification settings - Fork 123
Add dockerfile. #2414
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
base: main
Are you sure you want to change the base?
Add dockerfile. #2414
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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..." | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| FROM rust:latest | ||
fnando marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| 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 && \ | ||
fnando marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| rm -rf /var/lib/apt/lists/* /tmp/stellar-cli.deb | ||
|
Comment on lines
+5
to
+12
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the motivation of installing from the deb? The inefficiency we've seen in the past is that to get a docker image requires a long round trip of getting a deb built, etc. Where-as if the image is built from source, there's no dependency hoop jumping. I'd make this build from source because of that.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seemed easier than downloading the tar, uncompressing and moving to the right place. This also ensures we're dogfooding the installer. I don't see a benefit on building from source in this one particular case, but maybe I'm being shortsighted. 🤔 |
||
|
|
||
| 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 [] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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)" | ||
fnando marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| export GNOME_KEYRING_CONTROL | ||
fnando marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| export SSH_AUTH_SOCK | ||
|
|
||
| cd /source | ||
| exec "$@" | ||
Uh oh!
There was an error while loading. Please reload this page.