This repository was archived by the owner on Sep 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ /target
Original file line number Diff line number Diff line change
1
+ # rust:1.56.1
2
+ from rust@sha256:dd7167fc31b49284971b42f9b227bcac2fe3b8c2709259ec64dab7a05b5b07b0 as build-image
3
+
4
+ # create a dummy project
5
+ RUN apt-get update && \
6
+ apt-get install --yes musl-tools curl llvm clang && \
7
+ rustup target add x86_64-unknown-linux-musl && \
8
+ USER=root cargo new --bin rust-implementation
9
+ WORKDIR /rust-implementation
10
+
11
+ # copy over manifests
12
+ COPY ./Cargo.lock ./Cargo.lock
13
+ COPY ./Cargo.toml ./Cargo.toml
14
+
15
+ # cache build dependencies
16
+ RUN cargo build --release --target x86_64-unknown-linux-musl && \
17
+ rm -r src/
18
+
19
+ # copy over project source
20
+ COPY ./src ./src
21
+
22
+ # build for release
23
+ RUN rm -f ./target/x86_64-unknown-linux-musl/release/deps/rust_typescript_tools* && \
24
+ cargo build --release --target x86_64-unknown-linux-musl
25
+
26
+ FROM scratch
27
+ COPY --from=build-image /rust-implementation/target/x86_64-unknown-linux-musl/release/rust_typescript_tools /usr/bin/typescript-tools
28
+ WORKDIR /workdir
29
+ ENTRYPOINT ["/usr/bin/typescript-tools" ]
30
+ CMD ["" ]
You can’t perform that action at this time.
0 commit comments