Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: use alpine instead of debian #397

Merged
merged 7 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
target
27 changes: 23 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@

# ██╗██╗███╗ ██╗██╗ ██╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗██╗ ██╗███████╗██████╗
# ██║██║████╗ ██║██║ ██╔╝██╔═══██╗ ╚██╗██╔╝ ██╔══██╗██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
# ██║██║██╔██╗ ██║█████╔╝ ██║ ██║ ╚███╔╝ ██║ ██║██║ ██║██║ █████╔╝ █████╗ ██████╔╝
# ██ ██║██║██║╚██╗██║██╔═██╗ ██║ ██║ ██╔██╗ ██║ ██║██║ ██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗
# ╚█████╔╝██║██║ ╚████║██║ ██╗╚██████╔╝ ██╔╝ ██╗ ██████╔╝╚██████╔╝╚██████╗██║ ██╗███████╗██║ ██║
# ╚════╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝


# Build the jinko interpreter
# ---------------------------

FROM rust:slim-bullseye as build

COPY . /jinko
WORKDIR /jinko
RUN ./install.sh
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --target=x86_64-unknown-linux-musl --no-default-features --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

# ENTRYPOINT ["/root/.jinko/bin/jinko"]

# Run the jinko interpreter in a fresh container
# ----------------------------------------------

FROM debian:stable
FROM scratch

COPY --from=build /root/.jinko/bin/jinko /jinko
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"]

Expand Down