123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- FROM ubuntu:22.04
- SHELL ["/bin/bash", "-c"]
- RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
- apt-get update && apt-get install -y \
- gcc-riscv64-unknown-elf gdb-multiarch dosfstools cmake \
- git wget python3 vim file curl \
- autoconf automake autotools-dev libmpc-dev libmpfr-dev libgmp-dev \
- gawk build-essential bison flex texinfo gperf libtool patchutils bc \
- zlib1g-dev libexpat-dev \
- ninja-build pkg-config libglib2.0-dev libpixman-1-dev libsdl2-dev \
- && rm -rf /var/lib/apt/lists/*
- ARG QEMU_VERSION=7.0.0
- RUN cd /tmp && \
- wget https://download.qemu.org/qemu-${QEMU_VERSION}.tar.xz && \
- tar xf qemu-${QEMU_VERSION}.tar.xz && \
- cd qemu-${QEMU_VERSION} && \
- ./configure --target-list=riscv64-softmmu,riscv64-linux-user && \
- make -j && \
- make install && \
- cd .. && \
- rm -rf qemu-${QEMU_VERSION} qemu-${QEMU_VERSION}.tar.xz
- ARG CODE_VERSION=4.10.1
- RUN cd /usr/local/ && \
- wget https://github.com/coder/code-server/releases/download/v${CODE_VERSION}/code-server-${CODE_VERSION}-linux-amd64.tar.gz && \
- tar xf code-server-${CODE_VERSION}-linux-amd64.tar.gz && \
- ln -s /usr/local/code-server-${CODE_VERSION}-linux-amd64/bin/code-server /usr/bin/code && \
- rm code-server-${CODE_VERSION}-linux-amd64.tar.gz && \
- wget https://openvsxorg.blob.core.windows.net/resources/rust-lang/rust-analyzer/linux-x64/0.3.1435/rust-lang.rust-analyzer-0.3.1435@linux-x64.vsix && \
- code --install-extension rust-lang.rust-analyzer-0.3.1435@linux-x64.vsix && \
- rm rust-lang.rust-analyzer-0.3.1435@linux-x64.vsix && \
- wget https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hans/1.75.0/file/MS-CEINTL.vscode-language-pack-zh-hans-1.75.0.vsix && \
- code --install-extension MS-CEINTL.vscode-language-pack-zh-hans-1.75.0.vsix && \
- rm MS-CEINTL.vscode-language-pack-zh-hans-1.75.0.vsix
- WORKDIR /root
- ARG RUST_VERSION=nightly
- ENV RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
- ENV RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
- RUN mkdir .cargo && \
- echo '[source.crates-io]' >> .cargo/config && \
- echo 'registry = "https://github.com/rust-lang/crates.io-index"' >> .cargo/config && \
- echo 'replace-with = "ustc"' >> .cargo/config && \
- echo '[source.ustc]' >> .cargo/config && \
- echo 'registry = "git://mirrors.ustc.edu.cn/crates.io-index"' >> .cargo/config && \
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init && \
- chmod +x rustup-init && \
- ./rustup-init -y --default-toolchain ${RUST_VERSION} --target riscv64imac-unknown-none-elf && \
- rm rustup-init && \
- cargo install cargo-binutils && \
- rustup component add llvm-tools-preview && \
- rustup component add rust-src
- EXPOSE 8080/tcp
- CMD ["code", "--auth", "none", "--bind-addr", "0.0.0.0:8080"]
- FROM ubuntu:22.04
- LABEL email="liuyuqi<liuyuqi.gov@msn.cn>"
- ENV key=value
- WORKDIR /app
- RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
- RUN sed -i s@/security.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
- RUN apt update && apt install -y curl wget
- RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash
- RUN apt install -y nodejs
- RUN echo '\n\
- registry=http://registry.npm.taobao.org \n\
- sass_binary_site=https://npmmirror.com/mirrors/node-sass/ \n\
- electron_mirror=https://npmmirror.com/mirrors/electron/ \n\
- ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/ \n\
- ' > ~/.npmrc
- RUN npm install -g yarn pnpm serve
- RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
- apt-get update && apt-get install -y \
- gcc-riscv64-unknown-elf gdb-multiarch dosfstools cmake \
- git wget python3 vim file curl \
- autoconf automake autotools-dev libmpc-dev libmpfr-dev libgmp-dev \
- gawk build-essential bison flex texinfo gperf libtool patchutils bc \
- zlib1g-dev libexpat-dev \
- ninja-build pkg-config libglib2.0-dev libpixman-1-dev libsdl2-dev
- RUN apt install -y libwebkit2gtk-4.0-dev \
- libssl-dev \
- libgtk-3-dev \
- libayatana-appindicator3-dev \
- librsvg2-dev
- ARG QEMU_VERSION=7.0.0
- RUN cd /tmp && \
- wget https://download.qemu.org/qemu-${QEMU_VERSION}.tar.xz && \
- tar xf qemu-${QEMU_VERSION}.tar.xz && \
- cd qemu-${QEMU_VERSION} && \
- ./configure --target-list=riscv64-softmmu,riscv64-linux-user && \
- make -j && \
- make install && \
- cd .. && \
- rm -rf qemu-${QEMU_VERSION} qemu-${QEMU_VERSION}.tar.xz
- ARG RUST_VERSION=nightly
- ENV RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
- ENV RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
- RUN mkdir -p ~/.cargo && \
- echo '[source.crates-io]' >> ~/.cargo/config && \
- echo 'replace-with = "aliyun"' >> ~/.cargo/config && \
- echo '[source.aliyun]' >> ~/.cargo/config && \
- echo 'registry = "sparse+https://mirrors.aliyun.com/crates.io-index/"' >> ~/.cargo/config && \
- echo '[source.ustc]' >> ~/.cargo/config && \
- echo 'registry = "https://mirrors.ustc.edu.cn/crates.io-index"' >> ~/.cargo/config && \
- echo '[source.sjtu]' >> ~/.cargo/config && \
- echo 'registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index/"' >> ~/.cargo/config && \
- echo '[source.tuna]' >> ~/.cargo/config && \
- echo 'registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"' >> ~/.cargo/config && \
- echo '[source.rustcc]' >> ~/.cargo/config && \
- echo 'registry = "https://code.aliyun.com/rustcc/crates.io-index.git"' >> ~/.cargo/config
- RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh &&\
- sh rustup.sh -y --profile minimal &&\
- PATH=$PATH:/root/.cargo/bin &&\
- rustup target add riscv32i-unknown-none-elf &&\
- rustup component add llvm-tools-preview
|