Skip to content
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
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ docs
.github
.ipynb*
.venv
notebooks/.Trash*
notebooks/.Trash*
miniscript-cli/target
8 changes: 4 additions & 4 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
# cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
- name: Run rake spec
run: docker run ${{ env.DOCKER_METADATA_OUTPUT_TAGS }} /bitcoin-dsl/bin/rake spec
- name: Push Docker image
Expand All @@ -61,6 +61,6 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
# cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max

49 changes: 23 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
# syntax=docker/dockerfile:1

FROM alpine:latest as pythonbuilder
RUN apk add gcc python3 python3-dev musl-dev linux-headers
RUN python -m venv /opt/venv
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install jupyterlab notebook


FROM rust:alpine as rustbuilder
RUN apk --no-cache add build-base gcc
COPY miniscript-cli miniscript-cli
RUN cd miniscript-cli && cargo install --path .


FROM alpine:latest

RUN apk update && \
apk --no-cache add curl ruby ruby-dev python3 bash build-base gcc wget git \
RUN apk --no-cache add curl ruby ruby-dev python3 bash build-base gcc wget git \
autoconf automake libtool boost-dev libevent-dev sqlite-dev zeromq-dev linux-headers musl-dev libffi yaml-dev bitcoin python3-dev pipx \
pandoc

Expand All @@ -16,34 +29,18 @@ RUN apk update && \
# make install

WORKDIR /bitcoin-dsl
COPY Gemfile lib spec notebooks Rakefile.rb .

# Setup rust and rust-miniscript
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"

# Install miniscript-cli
COPY miniscript-cli miniscript-cli
RUN cd miniscript-cli && cargo install --path .

# # Install RVM, Ruby, and Bundler
COPY Gemfile Gemfile
RUN gem install bundler:2.5.5 && \
bundle install && \
bundle binstubs --all
bundle install --without=development && \
bundle binstubs --all && \
rm -rf /usr/local/bundle/cache

# Jupyter notebook setup begin
RUN pipx install jupyterlab notebook
COPY --from=rustbuilder /usr/local/cargo/bin/miniscript-cli /usr/local/cargo/bin/miniscript-cli
COPY --from=pythonbuilder /opt/venv /opt/venv

ENV JUPYTER_PORT=8888
EXPOSE $JUPYTER_PORT

# iruby setup
COPY jupyter/kernel.json /root/.local/share/jupyter/kernels/ruby/kernel.json
# iruby setup end

COPY lib lib
COPY spec spec
COPY notebooks notebooks
COPY Rakefile.rb Rakefile.rb
ENV JUPYTER_PORT=8888 PATH="/opt/venv/bin:/usr/local/cargo/bin:${PATH}"
EXPOSE $JUPYTER_PORT

CMD ["jupyter-lab", "--ip", "0.0.0.0", "--no-browser", "--allow-root", "--notebook-dir", "/bitcoin-dsl/notebooks"]
7 changes: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ source "https://rubygems.org"

gem 'bitcoinrb', :git => 'https://github.com/pool2win/bitcoinrb.git', :branch => 'add-witness_v1_taproot_type'

gem "rubocop", "~> 1.62", :require => false, :group => :development

gem "activesupport", "~> 7.1"

gem "test-unit", "~> 3.6"

gem "rake", "~> 13.1", :group => :development
gem "rake", "~> 13.1", :group => :test

gem "rspec", "~> 3.13", :group => :development
gem "rspec", "~> 3.13", :group => :test

gem "solargraph", "~> 0.50.0", :group => :development
gem "rubocop", "~> 1.62", :require => false, :group => :development

gem "irb", "1.12.0"
gem 'iruby', github: 'pool2win/iruby', branch: 'dsl-binding'