Skip to content
Closed
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
35 changes: 17 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@ ENV NODE_VERSION=22.10.0
ENV POCKET_IC_SERVER_VERSION=8.0.0
ENV POCKET_IC_PYTHON_VERSION=3.0.1

RUN apt -yq update
RUN apt -yqq install --no-install-recommends curl ca-certificates libunwind-dev git python3 python3-pip ssh
RUN apt -yq update \
&& apt -yqq install --no-install-recommends curl ca-certificates libunwind-dev git python3 python3-pip ssh \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install Node.js using nvm
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin:${PATH}"
RUN curl --fail -sSf https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash
RUN . "${NVM_DIR}/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "${NVM_DIR}/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "${NVM_DIR}/nvm.sh" && nvm alias default v${NODE_VERSION}
RUN curl --fail -sSf https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash \
&& . "${NVM_DIR}/nvm.sh" && nvm install ${NODE_VERSION} \
&& . "${NVM_DIR}/nvm.sh" && nvm use v${NODE_VERSION} \
&& . "${NVM_DIR}/nvm.sh" && nvm alias default v${NODE_VERSION}

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

# Add wasm32-unknown-unknown target
RUN rustup target add wasm32-unknown-unknown

# Install PocketIC Python
RUN pip3 install pocket-ic==${POCKET_IC_PYTHON_VERSION} --break-system-packages

# Download the PocketIC server
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
RUN mv pocket-ic /usr/local/bin

# Clean apt
RUN apt-get autoremove && apt-get clean
# Install PocketIC Python and download server
RUN pip3 install pocket-ic==${POCKET_IC_PYTHON_VERSION} --break-system-packages \
&& curl -Ls https://github.com/dfinity/pocketic/releases/download/${POCKET_IC_SERVER_VERSION}/pocket-ic-x86_64-linux.gz -o pocket-ic.gz \
&& gzip -d pocket-ic.gz \
&& chmod +x pocket-ic \
&& mv pocket-ic /usr/local/bin
10 changes: 5 additions & 5 deletions azle/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM --platform=linux/amd64 node:slim

RUN apt -yq update
RUN apt -yqq install --no-install-recommends curl ca-certificates libunwind-dev git python3
RUN apt -yq update \
&& apt -yqq install --no-install-recommends curl ca-certificates libunwind-dev git python3 \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

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

# Clean apt
RUN apt-get autoremove && apt-get clean
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.8'

services:
main:
build:
context: .
dockerfile: Dockerfile
image: icp-dev-env:latest

slim:
build:
context: ./slim
dockerfile: Dockerfile
image: icp-dev-env-slim:latest

azle:
build:
context: ./azle
dockerfile: Dockerfile
image: icp-dev-env-azle:latest
19 changes: 10 additions & 9 deletions slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ ENV NVM_VERSION=v0.40.1
ENV NODE_VERSION=22.10.0
ENV IC_MOPS_VERSION=1.8.0

RUN apt -yq update
RUN apt -yqq install --no-install-recommends curl ca-certificates libunwind-dev git
RUN apt -yq update \
&& apt -yqq install --no-install-recommends curl ca-certificates libunwind-dev git

# Install Node.js using nvm
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin:${PATH}"
RUN curl --fail -sSf https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash
RUN . "${NVM_DIR}/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "${NVM_DIR}/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "${NVM_DIR}/nvm.sh" && nvm alias default v${NODE_VERSION}
RUN curl --fail -sSf https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash \
&& . "${NVM_DIR}/nvm.sh" && nvm install ${NODE_VERSION} \
&& . "${NVM_DIR}/nvm.sh" && nvm use v${NODE_VERSION} \
&& . "${NVM_DIR}/nvm.sh" && nvm alias default v${NODE_VERSION}

# Install ic-mops
RUN npm install -g ic-mops@${IC_MOPS_VERSION}
Expand All @@ -26,9 +26,10 @@ ENV PATH="/root/.local/share/dfx/bin:$PATH"
RUN rustup target add wasm32-unknown-unknown

# Install candid-extractor
RUN curl -fsSL https://github.com/dfinity/candid-extractor/releases/download/0.1.5/candid-extractor-x86_64-unknown-linux-gnu.tar.gz -o candid-extractor.tar.gz
RUN tar -xvf candid-extractor.tar.gz && rm candid-extractor.tar.gz
RUN mv candid-extractor /usr/local/bin
RUN curl -fsSL https://github.com/dfinity/candid-extractor/releases/download/0.1.5/candid-extractor-x86_64-unknown-linux-gnu.tar.gz -o candid-extractor.tar.gz \
&& tar -xvf candid-extractor.tar.gz \
&& rm candid-extractor.tar.gz \
&& mv candid-extractor /usr/local/bin

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