-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
45 lines (37 loc) · 1.98 KB
/
Containerfile
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
FROM cgr.dev/chainguard/wolfi-base:latest
LABEL com.github.containers.toolbox="true" \
usage="This image is meant to be used with the Toolbox or Distrobox commands" \
summary="A new cloud-native terminal experience powered by Wolfi and Homebrew" \
maintainer="Mick Pollard <[email protected]>"
COPY ./files /
# Update image && Install some packages
RUN apk update && \
apk upgrade && \
grep -v '^#' /extra-packages | xargs apk add && \
rm /extra-packages && \
mv /home/linuxbrew /home/homebrew && \
echo "#!/bin/sh" >> /usr/bin/pinentry && \
echo "exit 0" >> /usr/bin/pinentry && \
chmod +x /usr/bin/pinentry
# Install custom CA cert
RUN cat /aussielunix_Root_CA_168848365996868199089383065266162030969.crt >> /etc/ssl/certs/ca-certificates.crt \
&& rm -f /aussielunix_Root_CA_168848365996868199089383065266162030969.crt
# Get Distrobox-host-exec and host-spawn
RUN git clone https://github.com/89luca89/distrobox.git --single-branch /tmp/distrobox && \
cp /tmp/distrobox/distrobox-host-exec /usr/bin/distrobox-host-exec && \
cp /tmp/distrobox/distrobox-export /usr/bin/distrobox-export && \
cp /tmp/distrobox/distrobox-init /usr/bin/entrypoint && \
wget https://github.com/1player/host-spawn/releases/download/$(cat /tmp/distrobox/distrobox-host-exec | grep host_spawn_version= | cut -d "\"" -f 2)/host-spawn-$(uname -m) -O /usr/bin/host-spawn && \
chmod +x /usr/bin/host-spawn && \
rm -drf /tmp/distrobox && \
ln -fs /bin/sh /usr/bin/sh
# Make some symlinks
RUN mkdir -p /usr/local/bin && \
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/docker && \
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/flatpak && \
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/podman && \
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/rpm-ostree
# Change root shell to BASH
RUN sed -i -e '/^root/s/\/bin\/ash/\/bin\/bash/' /etc/passwd
# Delete nonroot user
RUN userdel nonroot && rm -rf /home/nonroot /etc/profile.d/brew.sh