Skip to content

Commit

Permalink
docker-rust example
Browse files Browse the repository at this point in the history
  • Loading branch information
hathawayj committed Jan 31, 2025
1 parent 76891b0 commit b267925
Show file tree
Hide file tree
Showing 13 changed files with 22,121 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docker-rust/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM continuumio/anaconda3:latest
# https://github.com/potatosalad/docker-jupyter-rust/blob/master/Dockerfile
RUN /opt/conda/bin/conda install jupyter -y --quiet

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.83.0

RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='a46fe67199b7bcbbde2dcbc23ae08db6f29883e260e23899a88b9073effc9076' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='6af5abbbae02e13a9acae29593ec58116ab0e3eb893fa0381991e8b0934caea1' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='51862e576f064d859546cca5f3d32297092a850861e567327422e65b60877a1b' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='91456c3e6b2a3067914b3327f07bc182e2a27c44bff473263ba81174884182be' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.18.3/${rustArch}/rustup-init"; \
wget "$url"; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;

RUN set -eux; \
apt-get update; \
apt-get install -y build-essential libzmq3-dev pkg-config libssl-dev;

RUN set -eux; \
cargo install evcxr_jupyter; \
evcxr_jupyter --install;

WORKDIR /notebooks

CMD jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root --NotebookApp.token=''
7 changes: 7 additions & 0 deletions docker-rust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Rust for Data Science

- https://github.com/evcxr/evcxr/blob/main/evcxr_repl/README.md
- https://github.com/wiseaidev/rust-data-analysis/tree/main?tab=readme-ov-file
- https://rust-lang-nursery.github.io/rust-cookbook/intro.html


7 changes: 7 additions & 0 deletions docker-rust/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
jupyter:
build: .
volumes:
- ./notebooks:/opt/notebooks
ports:
- 8888:8888
Loading

0 comments on commit b267925

Please sign in to comment.