-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
40 lines (26 loc) · 2.4 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# ██╗██╗███╗ ██╗██╗ ██╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
# ██║██║████╗ ██║██║ ██╔╝██╔═══██╗ ╚██╗██╔╝ ██╔══██╗██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
# ██║██║██╔██╗ ██║█████╔╝ ██║ ██║ ╚███╔╝ ██║ ██║██║ ██║██║ █████╔╝ █████╗ ██████╔╝
# ██ ██║██║██║╚██╗██║██╔═██╗ ██║ ██║ ██╔██╗ ██║ ██║██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
# ╚█████╔╝██║██║ ╚████║██║ ██╗╚██████╔╝ ██╔╝ ██╗ ██████╔╝╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
# ╚════╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
# Build the jinko interpreter
# ---------------------------
FROM rust:slim-bullseye as build
COPY . /jinko
WORKDIR /jinko
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --target=x86_64-unknown-linux-musl --no-default-features --features repl,std --release
RUN strip /jinko/target/x86_64-unknown-linux-musl/release/jinko
# Get the needed libs (not statically linked)
# -------------------------------------------
FROM alpine:3.15.0 as libs
RUN apk add --no-cache ncurses-libs
# Run the jinko interpreter in a fresh container
# ----------------------------------------------
FROM scratch
COPY --from=build /jinko/target/x86_64-unknown-linux-musl/release/jinko /jinko
COPY --from=build /jinko/stdlib /stdlib
COPY --from=libs /etc/terminfo/x/xterm /etc/terminfo/x/xterm
ENTRYPOINT ["/jinko"]
LABEL maintainer="Tanguy Segarra <[email protected]>"