-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
111 lines (93 loc) · 4.21 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
FROM golang:bookworm as base
LABEL org.opencontainers.image.source https://github.com/carapace-sh/carapace
USER root
FROM base as bat
ARG version=0.24.0
RUN curl -L https://github.com/sharkdp/bat/releases/download/v${version}/bat-v${version}-x86_64-unknown-linux-gnu.tar.gz \
| tar -C /usr/local/bin/ --strip-components=1 -xvz bat-v${version}-x86_64-unknown-linux-gnu/bat \
&& chmod +x /usr/local/bin/bat
FROM base as ble
RUN git clone --recursive https://github.com/akinomyoga/ble.sh.git \
&& apt-get update && apt-get install -y gawk \
&& make -C ble.sh
FROM base as elvish
ARG version=0.20.1
RUN curl https://dl.elv.sh/linux-amd64/elvish-v${version}.tar.gz | tar -xvz \
&& mv elvish-* /usr/local/bin/elvish
FROM base as goreleaser
ARG version=1.24.0
RUN curl -L https://github.com/goreleaser/goreleaser/releases/download/v${version}/goreleaser_Linux_x86_64.tar.gz | tar -xvz goreleaser \
&& mv goreleaser /usr/local/bin/goreleaser
FROM rsteube/ion-poc as ion-poc
#FROM rust as ion
#ARG version=master
#RUN git clone --single-branch --branch "${version}" --depth 1 https://gitlab.redox-os.org/redox-os/ion/ \
# && cd ion \
# && RUSTUP=0 make # By default RUSTUP equals 1, which is for developmental purposes \
# && sudo make install prefix=/usr \
# && sudo make update-shells prefix=/usr
FROM base as nushell
ARG version=0.91.0
RUN curl -L https://github.com/nushell/nushell/releases/download/${version}/nu-${version}-x86_64-unknown-linux-gnu.tar.gz | tar -xvz \
&& mv nu-${version}-x86_64-unknown-linux-gnu/nu* /usr/local/bin
FROM base as oil
ARG version=0.20.0
RUN apt-get update && apt-get install -y libreadline-dev
RUN curl https://www.oilshell.org/download/oil-${version}.tar.gz | tar -xvz \
&& cd oil-*/ \
&& ./configure \
&& make \
&& ./install
FROM base as starship
ARG version=1.17.1
RUN wget -qO- "https://github.com/starship/starship/releases/download/v${version}/starship-x86_64-unknown-linux-gnu.tar.gz" | tar -xvz starship \
&& mv starship /usr/local/bin/
FROM base as vivid
ARG version=0.9.0
RUN wget -qO- "https://github.com/sharkdp/vivid/releases/download/v${version}/vivid-v${version}-x86_64-unknown-linux-gnu.tar.gz" | tar -xvz vivid-v${version}-x86_64-unknown-linux-gnu/vivid \
&& mv vivid-v${version}-x86_64-unknown-linux-gnu/vivid /usr/local/bin/
FROM base as mdbook
ARG version=0.4.37
RUN apt-get update && apt-get install -y unzip \
&& curl -L "https://github.com/rust-lang/mdBook/releases/download/v${version}/mdbook-v${version}-x86_64-unknown-linux-gnu.tar.gz" | tar -xvz mdbook \
&& wget -q "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.7.7/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip" \
&& unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip mdbook-linkcheck \
&& chmod +x mdbook-linkcheck \
&& mv mdbook mdbook-linkcheck /usr/local/bin/
FROM base
RUN apt-get update && apt-get install -y libicu72
RUN wget -q https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb\
&& dpkg -i powershell_7.4.1-1.deb_amd64.deb \
&& rm powershell_7.4.1-1.deb_amd64.deb
RUN apt-get update \
&& apt-get install -y fish \
elvish \
expect \
shellcheck \
sudo \
tcsh \
xonsh \
zsh
RUN pwsh -Command "Install-Module PSScriptAnalyzer -Scope AllUsers -Force"
RUN git config --system safe.directory '*'
COPY --from=bat /usr/local/bin/* /usr/local/bin/
COPY --from=ble /go/ble.sh /opt/ble.sh
COPY --from=elvish /usr/local/bin/* /usr/local/bin/
COPY --from=goreleaser /usr/local/bin/* /usr/local/bin/
#COPY --from=ion /ion/target/release/ion /usr/local/bin/
COPY --from=ion-poc /usr/local/bin/ion /usr/local/bin/
COPY --from=nushell /usr/local/bin/* /usr/local/bin/
COPY --from=mdbook /usr/local/bin/* /usr/local/bin/
COPY --from=oil /usr/local/bin/* /usr/local/bin/
COPY --from=starship /usr/local/bin/* /usr/local/bin/
COPY --from=vivid /usr/local/bin/* /usr/local/bin/
RUN groupadd --gid 1000 carapace \
&& useradd --uid 1000 --gid 1000 --create-home carapace \
&& mkdir /.cache \
&& chmod -R a+rwx /.cache /go /opt \
&& echo " carapace ALL = NOPASSWD: ALL" >> /etc/sudoers
COPY .dockerfile/home /root/
COPY --chown=1000:1000 .dockerfile/home /home/carapace/
COPY .dockerfile/usr/local/bin/* /usr/local/bin/
ENV TERM xterm
ENTRYPOINT [ "entrypoint.sh" ]