-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (30 loc) · 1.75 KB
/
Dockerfile
File metadata and controls
33 lines (30 loc) · 1.75 KB
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
FROM debian:bookworm-slim@sha256:4b44499bc2a6c78d726f3b281e6798009c0ae1f034b0bfaf6a227147dcff928b
COPY pinned-packages.txt /tmp/
# Use a specific Debian snapshot for reproducible builds
RUN set -e; \
# Create a sources.list file pointing to a specific snapshot
echo 'deb [check-valid-until=no] https://snapshot.debian.org/archive/debian/20250411T024939Z bookworm main' > /etc/apt/sources.list && \
echo 'deb [check-valid-until=no] https://snapshot.debian.org/archive/debian-security/20250411T024939Z bookworm-security main' >> /etc/apt/sources.list && \
echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/10no-check-valid-until && \
# Create preferences file to pin all packages
mkdir -p /etc/apt/preferences.d && \
cat /tmp/pinned-packages.txt | while read line; do \
pkg=$(echo $line | cut -d= -f1); \
ver=$(echo $line | cut -d= -f2); \
if [ ! -z "$pkg" ] && [ ! -z "$ver" ]; then \
echo "Package: $pkg\nPin: version $ver\nPin-Priority: 1001\n" >> /etc/apt/preferences.d/pinned-packages; \
fi; \
done && \
# Install packages with exact versions for reproducibility
apt-get update && \
apt-get install -y --no-install-recommends curl ca-certificates && \
curl -L "https://github.com/docker/compose/releases/download/v2.24.6/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose && \
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/log/* /var/cache/ldconfig/aux-cache /tmp/pinned-packages.txt
COPY entrypoint.sh get-latest.sh /scripts/
RUN chmod +x /scripts/*.sh
ENV PATH="/scripts:${PATH}"
RUN mkdir -p /app-data
CMD ["/scripts/entrypoint.sh"]