mirror of
https://github.com/Snigdha-OS/snigdhaos-docker.git
synced 2025-09-07 10:05:12 +02:00
⚡️ perf(_blank): used for cache optimization
This commit is contained in:
52
Dockerfile
52
Dockerfile
@@ -1,22 +1,44 @@
|
|||||||
|
# Stage 1: Build the root filesystem
|
||||||
FROM archlinux:base-devel AS rootfs
|
FROM archlinux:base-devel AS rootfs
|
||||||
|
|
||||||
RUN pacman -Syu --noconfirm && \
|
# Update system and install base packages
|
||||||
pacman -S --needed --noconfirm pacman-contrib git openssh sudo curl
|
RUN pacman -Syu --noconfirm && \
|
||||||
COPY pacman.conf /etc/pacman.conf
|
pacman -S --needed --noconfirm pacman-contrib git openssh sudo curl
|
||||||
RUN curl https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-pkgbuilds/refs/heads/master/snigdhaos-mirrorlist/snigdhaos-mirrorlist -o /etc/pacman.d/snigdhaos-mirrorlist
|
|
||||||
|
|
||||||
|
# Add custom pacman configuration
|
||||||
|
COPY pacman.conf /etc/pacman.conf
|
||||||
|
|
||||||
## include to pacman own keyring to install signed packages
|
# Download and configure the Snigdha OS mirrorlist
|
||||||
RUN pacman-key --init && \
|
RUN curl -fsSL https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-pkgbuilds/refs/heads/master/snigdhaos-mirrorlist/snigdhaos-mirrorlist \
|
||||||
pacman-key --recv-keys E1415F19F21171F2 --keyserver keyserver.ubuntu.com && \
|
-o /etc/pacman.d/snigdhaos-mirrorlist
|
||||||
pacman-key --lsign-key E1415F19F21171F2 && \
|
|
||||||
pacman -Sy && \
|
|
||||||
pacman -S --needed --noconfirm snigdhaos-keyring snigdhaos-mirrorlist && \
|
|
||||||
pacman -Syu --noconfirm && \
|
|
||||||
rm -rf /var/lib/pacman/sync/* && \
|
|
||||||
find /var/cache/pacman/ -type f -delete
|
|
||||||
|
|
||||||
|
# Initialize pacman keyring and trust Snigdha OS signing key
|
||||||
|
RUN pacman-key --init && \
|
||||||
|
pacman-key --recv-keys E1415F19F21171F2 --keyserver keyserver.ubuntu.com && \
|
||||||
|
pacman-key --lsign-key E1415F19F21171F2
|
||||||
|
|
||||||
|
# Install Snigdha OS-specific packages and keyring
|
||||||
|
RUN pacman -Sy && \
|
||||||
|
pacman -S --needed --noconfirm snigdhaos-keyring snigdhaos-mirrorlist && \
|
||||||
|
pacman -Syu --noconfirm
|
||||||
|
|
||||||
|
# Clean up cache and temporary files to reduce image size
|
||||||
|
RUN rm -rf /var/lib/pacman/sync/* && \
|
||||||
|
find /var/cache/pacman/ -type f -delete && \
|
||||||
|
pacman -Sc --noconfirm
|
||||||
|
|
||||||
|
# Stage 2: Create the final minimal container
|
||||||
FROM scratch
|
FROM scratch
|
||||||
LABEL org.opencontainers.image.description="Snigdha OS - Arch based Linux Distribution for Penetration Testing and Ethical Hacking"
|
|
||||||
|
# Metadata about the container
|
||||||
|
LABEL org.opencontainers.image.title="Snigdha OS Container" \
|
||||||
|
org.opencontainers.image.description="Snigdha OS - Arch-based Linux distribution for Penetration Testing and Ethical Hacking" \
|
||||||
|
org.opencontainers.image.version="1.0" \
|
||||||
|
org.opencontainers.image.authors="Snigdha OS Team" \
|
||||||
|
org.opencontainers.image.licenses="MIT"
|
||||||
|
|
||||||
|
# Copy the prepared root filesystem
|
||||||
COPY --from=rootfs / /
|
COPY --from=rootfs / /
|
||||||
CMD ["/usr/bin/bash"]
|
|
||||||
|
# Default command
|
||||||
|
CMD ["/usr/bin/bash"]
|
||||||
|
Reference in New Issue
Block a user