Skip to content

Commit

Permalink
fix(VER-2693): Fix Azle dev envs (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
fxgst authored Mar 20, 2024
1 parent 47a5bf1 commit 25516c7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ RUN . "${NVM_DIR}/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "${NVM_DIR}/nvm.sh" && nvm alias default v${NODE_VERSION}

# Install dfx
ENV DFXVM_INIT_YES=true
RUN sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
RUN DFXVM_INIT_YES=true sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
ENV PATH="/root/.local/share/dfx/bin:$PATH"
ENV DFX_VERSION=

Expand All @@ -33,3 +32,6 @@ RUN pip3 install pocket-ic==${POCKET_IC_PYTHON_VERSION} --break-system-packages
RUN curl -Ls https://github.com/dfinity/pocketic/releases/download/${POCKET_IC_SERVER_VERSION}/pocket-ic-x86_64-linux.gz -o pocket-ic.gz
RUN gzip -d pocket-ic.gz
RUN chmod +x pocket-ic

# Clean apt
RUN apt-get autoremove && apt-get clean
25 changes: 18 additions & 7 deletions azle/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/typescript-node:dev-20-bookworm

ENV DFX_VERSION=0.17.0
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/typescript-node:dev-20-bookworm

# Install a basic environment needed for our build tools
RUN apt -yq update && \
apt -yqq install --no-install-recommends curl ca-certificates \
RUN apt-get -yq update
RUN apt-get -yqq install --no-install-recommends curl ca-certificates \
build-essential pkg-config libssl-dev llvm-dev liblmdb-dev clang cmake rsync git

# Install dfx
ENV DFXVM_INIT_YES=true
RUN sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
RUN DFX_VERSION=0.18.0 DFXVM_INIT_YES=true sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
ENV PATH="/root/.local/share/dfx/bin:$PATH"

# Dug out from [here](https://github.com/demergent-labs/azle/blob/main/.github/workflows/test.yml#L251)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.73.0 --profile=minimal
ENV PATH="/root/.cargo/bin:$PATH"
RUN rustup target add wasm32-wasi

RUN cargo install --git https://github.com/wasm-forge/wasi2ic --rev 806c3558aad24224852a9582f018178402cb3679

RUN git clone https://github.com/demergent-labs/wasmedge-quickjs && cd wasmedge-quickjs && git checkout 6c81d7e6fe4b22a468beceed0ee697f4163e7ca8
RUN mkdir -p ${HOME}/.config/azle
RUN mv /wasmedge-quickjs ${HOME}/.config/azle/wasmedge_quickjs_$(npx [email protected] dockerfile-hash)

# Clean apt
RUN apt-get autoremove && apt-get clean

0 comments on commit 25516c7

Please sign in to comment.