-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.debug
More file actions
32 lines (30 loc) · 1.58 KB
/
Dockerfile.debug
File metadata and controls
32 lines (30 loc) · 1.58 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
# syntax=docker/dockerfile:1
FROM debian:11 as builder
RUN apt update && apt -y install wget gnupg binutils && \
wget "https://nginx.org/keys/nginx_signing.key" && \
apt-key add nginx_signing.key && \
echo "deb https://nginx.org/packages/mainline/debian/ bullseye nginx" >/etc/apt/sources.list.d/nginx.list && \
echo "deb-src https://nginx.org/packages/mainline/debian/ bullseye nginx" >>/etc/apt/sources.list.d/nginx.list && \
apt update && \
apt install -y nginx && \
apt install --download-only --reinstall nginx lsb-base libgcc-s1 libc6 libcrypt1 libpcre2-8-0 libssl1.1 zlib1g && \
apt install --download-only --reinstall libidn2-0 libnss-nis libnss-nisplus debconf gcc-10-base && \
for f in /var/cache/apt/archives/*.deb; do dpkg-deb -xv $f /packages; done && \
rm -rf /packages/usr/share/bash-completion \
/packages/usr/share/debconf \
/packages/usr/share/doc \
/packages/usr/share/lintian \
/packages/usr/share/locale \
/packages/usr/share/man \
/packages/usr/share/perl5 \
/packages/usr/share/pixmaps \
/packages/usr/bin \
/packages/usr/bin/dpkg* \
/packages/usr/bin/nginx-debug
FROM gcr.io/distroless/static-debian11:debug
COPY --from=builder /packages /
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
RUN --mount=type=bind,from=builder,target=/mount ["/mount/bin/ln", "-sf", "/dev/stdout", "/var/log/nginx/access.log" ]
RUN --mount=type=bind,from=builder,target=/mount ["/mount/bin/ln", "-sf", "/dev/stderr", "/var/log/nginx/error.log" ]
EXPOSE 80