Skip to content

Commit

Permalink
⚡️ remove huff and stylus to minimize dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
cairoeth committed Mar 13, 2024
1 parent 8bcdba2 commit 5ac0dd6
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions paradigmctf.py/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
FROM python:3.11.6-slim

# Set up unprivileged user and install dependencies
# TODO: we need bsdmainutils so we have hexdump so foundry-huff can...
# generate some random bytes... :/
RUN true && \
useradd -u 1000 -m user && \
apt-get update && \
apt-get install -y curl git socat bsdmainutils build-essential && \
apt-get install -y curl git socat build-essential && \
rm -rf /var/cache/apt/lists /var/lib/apt/lists/* && \
true

Expand All @@ -20,29 +18,6 @@ RUN true && \
foundryup && \
true

# Install Huff
ENV HUFF_DIR=/opt/huff

ENV PATH=${HUFF_DIR}/bin/:${PATH}

RUN true && \
curl -L http://get.huff.sh | bash && \
huffup && \
true

# Install Stylus
env RUSTUP_HOME=/opt/rust/rustup CARGO_HOME=/opt/rust/cargo
env PATH=${PATH}:/opt/rust/cargo/bin

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /rustup.sh && \
sh /rustup.sh -y --default-toolchain nightly --profile=minimal && \
rm /rustup.sh
RUN rustup component add rust-src --toolchain nightly
RUN rustup target add wasm32-unknown-unknown
RUN RUSTFLAGS="-C link-args=-rdynamic" cargo install --force cargo-stylus

RUN chmod -R 777 /opt/rust/cargo/registry

# (Optimization) Install requirements
COPY requirements.txt /tmp/requirements.txt

Expand All @@ -56,6 +31,6 @@ RUN true && \
rm -rf /tmp/requirements.txt /tmp/paradigmctf.py && \
true

USER 1000
# USER 1000

WORKDIR /home/user
# WORKDIR /home/user

0 comments on commit 5ac0dd6

Please sign in to comment.