Skip to content

Commit

Permalink
Merge pull request #397 from jinko-core/bring-the-docker-support-to-t…
Browse files Browse the repository at this point in the history
…he-next-level

docker: use alpine instead of debian
  • Loading branch information
CohenArthur authored Dec 2, 2021
2 parents 3a95daf + 230e47c commit 54ff0c3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
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

0 comments on commit 54ff0c3

Please sign in to comment.