-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
draft: building inside the container
- Loading branch information
dcdgo
committed
Mar 5, 2021
1 parent
f82073e
commit 66d8a69
Showing
5 changed files
with
56 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/Rust_part/target/ | ||
/Rust_part/tests/ | ||
/Rust_part/libvec.a | ||
/RUst_part/Cargo.lock | ||
C_part/.xmake/ | ||
C_part/build/ | ||
C_part/test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# designed for linux build | ||
FROM rust:1.50 | ||
|
||
#install tools | ||
RUN apt-get update && \ | ||
apt-get dist-upgrade -y && \ | ||
apt-get install -y musl-tools && \ | ||
rustup target add x86_64-unknown-linux-musl | ||
|
||
RUN apt-get install software-properties-common -y | ||
RUN apt-get install python3 -y | ||
RUN apt-get install python-pip -y | ||
RUN pip install --upgrade pip | ||
RUN pip install conan | ||
|
||
#install xmake | ||
WORKDIR /usr/ | ||
RUN add-apt-repository ppa:xmake-io/xmake | ||
RUN apt update | ||
RUN apt install xmake | ||
|
||
# set environment variables | ||
ENV conanpath /usr/.conan/data/ | ||
ENV releasebuild true | ||
|
||
# copy C source and Rust source | ||
COPY ./Rust_part/ /usr/vectorizer/Rust_part/ | ||
COPY ./C_part/ /usr/vectorizer/C_part/ | ||
|
||
# initialize conan | ||
WORKDIR /usr/vectorizer/C_part/build/ | ||
RUN conan install .. | ||
|
||
#initialize xmake and build | ||
WORKDIR /usr/vectorizer/C_part/ | ||
RUN xmake f -m release && \ | ||
xmake | ||
|
||
#build Rust code | ||
WORKDIR /usr/vectorizer/Rust_part/ | ||
RUN cargo build --release | ||
|
||
#create entrypoint of container | ||
CMD ["./target/release/trampoline"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.