Skip to content

Commit 880d51b

Browse files
authored
Merge pull request #3 from devsapp/fix-rust
fix rust in custom runtime
2 parents acc8af4 + dd12925 commit 880d51b

File tree

7 files changed

+1189
-45
lines changed

7 files changed

+1189
-45
lines changed

custom-function/rust/fc-custom-rust-event/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Type: Application
22
Name: fc-custom-rust-event
33
Provider:
44
- 阿里云
5-
Version: 1.1.3
5+
Version: 1.1.4
66
Description: 快速部署一个基于custom runtime 的 RUST Event 类型的 Hello World 到阿里云函数计算
77
HomePage: https://github.com/devsapp/start-fc
88
Tags:

custom-function/rust/fc-custom-rust-event/src/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ bootstrap/target/
205205

206206
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
207207
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
208-
Cargo.lock
208+
# Cargo.lock
209209

210210
# These are backup files generated by rustfmt
211211
**/*.rs.bk
Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,4 @@
1-
FROM aliyunfc/runtime-custom:build
2-
3-
ENV RUSTUP_HOME=/usr/local/rustup \
4-
CARGO_HOME=/usr/local/cargo \
5-
PATH=/usr/local/cargo/bin:$PATH \
6-
RUST_VERSION=1.45.2
7-
8-
RUN set -eux; \
9-
echo 'deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib' > /etc/apt/sources.list ; \
10-
echo 'deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib' >> /etc/apt/sources.list ; \
11-
echo 'deb http://mirrors.aliyun.com/debian-security stretch/updates main' >> /etc/apt/sources.list ; \
12-
echo 'deb-src http://mirrors.aliyun.com/debian-security stretch/updates main' >> /etc/apt/sources.list ; \
13-
echo 'deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib' >> /etc/apt/sources.list ; \
14-
echo 'deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib' >> /etc/apt/sources.list ; \
15-
echo 'deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib' >> /etc/apt/sources.list ; \
16-
echo 'deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib' >> /etc/apt/sources.list ; \
17-
apt-get update; \
18-
apt-get install -y --no-install-recommends \
19-
ca-certificates \
20-
gcc \
21-
libc6-dev \
22-
wget \
23-
; \
24-
curl https://cdn.jsdelivr.net/gh/rust-lang-nursery/rustup.rs/rustup-init.sh > rustup-init ; \
25-
chmod +x rustup-init ; \
26-
RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION; \
27-
rm rustup-init; \
28-
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
29-
rustup --version; \
30-
cargo --version; \
31-
rustc --version; \
32-
apt-get remove -y --auto-remove \
33-
wget \
34-
; \
35-
rm -rf /var/lib/apt/lists/*; \
36-
1+
FROM python:3.7.4-stretch
2+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
3+
RUN echo 'export PATH=$HOME/.cargo/bin:$PATH' >> $HOME/.bashrc
4+
CMD ["bash"]

custom-function/rust/fc-custom-rust-event/src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ build-img:
22
docker build -t fc-rust-env -f Dockerfile.build .
33

44
build: build-img
5-
docker run --rm -it -v $$(pwd):/opt/rust-demo fc-rust-env bash -c "cd /opt/rust-demo/bootstrap && cargo build"
5+
docker run --rm -it -v $$(pwd):/opt/rust-demo fc-rust-env bash -c "cd /opt/rust-demo/bootstrap && /root/.cargo/bin/cargo build"
66
mkdir -p pkg
77
cp bootstrap/target/debug/bootstrap pkg/
88

custom-function/rust/fc-custom-rust-event/src/bootstrap/.cargo/config.toml

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)