-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdockerfile
executable file
·39 lines (28 loc) · 1.25 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
#!/usr/bin/env -S docker build --compress -t pvtmert/scratch -f
FROM debian AS deb
############################################################
FROM busybox AS box
ENV ARCH x86_64
ENV REPO http://landley.net/toybox/bin/toybox
ENV FILE toybox
ADD $REPO-$ARCH $FILE
RUN chmod +x $FILE
############################################################
FROM scratch
COPY --from=box toybox ./
COPY --from=box ./bin/busybox ./
RUN [ "./toybox", "mkdir", "-p", "./bin", "./sbin", "./usr/bin", "./usr/sbin" ]
RUN [ "./busybox", "ln", "-s", "../busybox", "./bin/sh" ]
#RUN [ "./toybox", "ln", "-s", "../toybox", "./bin/sh" ]
#RUN [ "./toybox", "ln", "-s", "../toybox", "./bin/ln" ]
#RUN [ "./toybox", "ln", "-s", "../toybox", "./bin/ls" ]
#RUN [ "./toybox", "ln", "-s", "../toybox", "./bin/chmod" ]
#RUN [ "./toybox", "ln", "-s", "../toybox", "./bin/chown" ]
#RUN [ "./toybox", "ln", "-s", "../toybox", "./bin/chgrp" ]
#RUN for i in $(./toybox --long); do ./busybox ln -sf ./toybox $i; done
#RUN for i in $(./busybox --list-full); do ./busybox ln -sf ../../busybox $i; done
#RUN [ "./toybox", "ln", "-sf", "../toybox", "./bin/sh" ]
#RUN [ "./toybox", "rm", "-f", "./busybox" ]
#RUN [ "./busybox", "--install", "-s", "./usr/bin" ]
RUN ./busybox --install -s #./usr/bin
CMD [ "sh" ]