-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
42 lines (34 loc) · 1.38 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
41
42
# docker run -it $(docker build . | tail -n 1 | cut -c20-35) /bin/sh
# proxy-delete rust-space; proxy-create rust-space $(docker build . | tail -n 1 | cut -c20-35)
FROM rust:alpine AS bootstrapper
RUN apk --update add git musl-dev ncurses-terminfo-base && \
rm -rf /var/lib/apt/lists/* && \
rm /var/cache/apk/*
RUN git clone https://github.com/uutils/coreutils
RUN cargo install --path=coreutils --root=/prefix/ --debug
RUN git clone https://github.com/hiking90/rushell
RUN cargo install --path=rushell --root=/prefix/ --debug
# Deno
RUN git clone --recurse-submodules https://github.com/denoland/deno
ENV V8_FROM_SOURCE=1
ENV CLANG_BASE_PATH /usr
RUN apk add --update --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ gn
RUN apk add --update clang glib-dev
RUN cd deno/cli && cargo fetch
RUN cd deno/cli && cargo build
FROM scratch
# shell
COPY profile /etc/profile
COPY --from=bootstrapper /etc/terminfo /etc/terminfo
COPY --from=bootstrapper /prefix/bin/rushell /bin/sh
# coreutils
COPY --from=bootstrapper /prefix/bin/coreutils /bin/coreutils
RUN /bin/coreutils ln -s /bin/coreutils /bin/ln
RUN ln -s / /usr
RUN ln -s /bin/coreutils /bin/env
RUN ln -s /bin/coreutils /bin/ls
# libc
COPY --from=bootstrapper /lib/ld-musl-x86_64.so.1 /lib/ld-musl-x86_64.so.1
RUN ln -s /lib/ld-musl-x86_64.so.1 /lib/libc.musl-x86_64.so.1
RUN ln -s /lib/ld-musl-x86_64.so.1 /bin/ldd
CMD ["/bin/sh"]