Skip to content

Commit 665e03b

Browse files
committed
Update Docker image packages
1 parent 0a6c4ea commit 665e03b

2 files changed

Lines changed: 40 additions & 45 deletions

File tree

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,59 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.04
22

3-
ARG USERNAME=developer
4-
ARG USER_UID=1000
5-
ARG USER_GID=$USER_UID
3+
ARG USERNAME=ubuntu
4+
ARG VERSION_MXPY="11.3.1"
5+
ARG VERSION_RUST="1.90.0"
6+
ARG VERSION_SC_META="0.64.2"
67

7-
ARG VERSION_MXPY="v11.1.1"
8-
ARG VERSION_RUST="1.86.0"
9-
ARG VERSION_SC_META="0.62.0"
8+
ENV DEBIAN_FRONTEND=noninteractive
109

11-
# Create the user
12-
RUN groupadd --gid $USER_GID $USERNAME \
13-
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
14-
#
15-
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
16-
&& apt-get update \
17-
&& apt-get install -y sudo \
18-
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
19-
&& chmod 0440 /etc/sudoers.d/$USERNAME
20-
21-
# Install some dependencies as root
10+
# Base system dependencies
2211
RUN apt-get update && apt-get install -y \
23-
wget \
24-
build-essential \
25-
python3.10 python3-pip python3.10-venv \
12+
sudo \
13+
curl \
2614
git \
15+
build-essential \
2716
pkg-config \
28-
libssl-dev && \
29-
rm -rf /var/lib/apt/lists/*
30-
31-
# Switch to regular user
32-
USER $USERNAME
17+
libssl-dev \
18+
python3 \
19+
python3-venv \
20+
python3-pip \
21+
pipx \
22+
ca-certificates \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
# Give sudo access to the user without password
26+
RUN echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} \
27+
&& chmod 0440 /etc/sudoers.d/${USERNAME}
28+
29+
USER ${USERNAME}
3330
WORKDIR /home/${USERNAME}
3431

32+
# Environment variables
3533
ENV MULTIVERSX="/home/${USERNAME}/multiversx-sdk"
3634
ENV PATH="/home/${USERNAME}/.local/bin:${PATH}"
3735
ENV PATH="/home/${USERNAME}/.cargo/bin:${PATH}"
3836

39-
# Install pipx
40-
RUN python3 -m pip install --no-cache-dir --user pipx
41-
42-
# Install mxpy
37+
# Install mxpy via pipx
4338
RUN pipx install multiversx-sdk-cli==${VERSION_MXPY}
4439

45-
# Install rust
46-
RUN wget -O rustup.sh https://sh.rustup.rs && \
47-
chmod +x rustup.sh && \
48-
CARGO_HOME=/home/${USERNAME}/.cargo RUSTUP_HOME=/home/${USERNAME}/.rustup ./rustup.sh --verbose --default-toolchain ${VERSION_RUST} --profile minimal -y && \
49-
rm rustup.sh
40+
# Install Rust
41+
RUN curl https://sh.rustup.rs -sSf | \
42+
sh -s -- -y --profile minimal --default-toolchain ${VERSION_RUST}
5043

5144
# Install sc-meta tools
52-
RUN CARGO_HOME=/home/${USERNAME}/.cargo RUSTUP_HOME=/home/${USERNAME}/.rustup PATH="/home/${USERNAME}/.cargo/bin:${PATH}" \
53-
cargo install multiversx-sc-meta --version ${VERSION_SC_META} --locked
54-
55-
RUN CARGO_HOME=/home/${USERNAME}/.cargo RUSTUP_HOME=/home/${USERNAME}/.rustup PATH="/home/${USERNAME}/.cargo/bin:${PATH}" \
56-
sc-meta install all
45+
RUN cargo install multiversx-sc-meta --version ${VERSION_SC_META} --locked \
46+
&& sc-meta install all
5747

5848
# Install test wallets
59-
RUN mxpy deps install testwallets && rm ${MULTIVERSX}/*.tar.gz
49+
RUN mxpy deps install testwallets
50+
51+
# Rust components + cleanup
52+
RUN rustup component add rustfmt \
53+
&& rm -rf /home/${USERNAME}/.cargo/registry \
54+
&& rm -rf /home/${USERNAME}/.cargo/git
6055

61-
RUN rustup component add rustfmt && rm -rf /home/${USERNAME}/.cargo/registry/* && rm -rf /home/${USERNAME}/.cargo/git/*
56+
# Devcontainer resources
57+
COPY post_create_command.py ${MULTIVERSX}/devcontainer-resources/
6258

63-
# This command will be executed once the devcontainer is created
64-
COPY "post_create_command.py" "${MULTIVERSX}/devcontainer-resources/"
59+
CMD ["bash"]

src/smart-contracts-rust/devcontainer-template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "smart-contracts-rust",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"name": "MultiversX: Smart Contracts Development (Rust)",
55
"description": "Develop smart contracts for MultiversX. Includes Rust, mxpy, VSCode extensions etc.",
66
"documentationURL": "https://github.com/multiversx/mx-template-devcontainers/blob/main/src/smart-contracts-rust",

0 commit comments

Comments
 (0)