-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathDockerfile
32 lines (24 loc) · 1017 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# To build run 'docker build . -t openchat'
FROM ubuntu:22.04 AS builder
SHELL ["bash", "-c"]
ARG git_commit_id
ARG rust_version=1.84.0
ARG canister_name
ENV GIT_COMMIT_ID=$git_commit_id
ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
apt -yq update && \
apt -yqq install --no-install-recommends curl ca-certificates build-essential
# Install Rust and Cargo in /opt
ENV RUSTUP_HOME=/opt/rustup \
CARGO_HOME=/opt/cargo \
PATH=/cargo/bin:/opt/cargo/bin:$PATH
RUN curl --fail https://sh.rustup.rs -sSf \
| sh -s -- -y --default-toolchain ${rust_version}-x86_64-unknown-linux-gnu --no-modify-path && \
rustup default ${rust_version}-x86_64-unknown-linux-gnu && \
rustup target add wasm32-unknown-unknown
# Install IC Wasm
RUN cargo install --version 0.9.0 ic-wasm
COPY . /build
WORKDIR /build
RUN if [[ -z "$canister_name" ]] ; then sh ./scripts/generate-all-canister-wasms.sh ; else sh ./scripts/generate-wasm.sh $canister_name ; fi