mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-08-28 20:06:02 +00:00
fix appview minimal docker file. use pure go dns resolver
This commit is contained in:
+1
-18
@@ -12,32 +12,15 @@ RUN go mod download
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=1 go build \
|
||||
-ldflags="-s -w" \
|
||||
-ldflags="-s -w -linkmode external -extldflags '-static'" \
|
||||
-tags sqlite_omit_load_extension \
|
||||
-trimpath \
|
||||
-o atcr-appview ./cmd/appview
|
||||
|
||||
# Collect minimal runtime dependencies
|
||||
RUN mkdir -p /runtime-deps/lib64 /runtime-deps/lib/x86_64-linux-gnu && \
|
||||
# Core glibc libraries (from ldd output)
|
||||
cp /lib/x86_64-linux-gnu/libc.so.6 /runtime-deps/lib64/ && \
|
||||
cp /lib/x86_64-linux-gnu/libresolv.so.2 /runtime-deps/lib64/ && \
|
||||
cp /lib64/ld-linux-x86-64.so.2 /runtime-deps/lib64/ && \
|
||||
# NSS (Name Service Switch) modules for DNS resolution
|
||||
cp /lib/x86_64-linux-gnu/libnss_dns.so.2 /runtime-deps/lib/x86_64-linux-gnu/ && \
|
||||
cp /lib/x86_64-linux-gnu/libnss_files.so.2 /runtime-deps/lib/x86_64-linux-gnu/ && \
|
||||
# Create NSS config (tells glibc to check /etc/hosts then DNS)
|
||||
echo "hosts: files dns" > /tmp/nsswitch.conf
|
||||
|
||||
# ==========================================
|
||||
# Stage 2: Minimal FROM scratch runtime
|
||||
# ==========================================
|
||||
FROM scratch
|
||||
|
||||
# Copy minimal glibc runtime dependencies
|
||||
COPY --from=builder /runtime-deps /
|
||||
# Copy NSS configuration for DNS resolution
|
||||
COPY --from=builder /tmp/nsswitch.conf /etc/nsswitch.conf
|
||||
# Copy CA certificates for HTTPS (PDS, Jetstream, relay connections)
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
# Copy timezone data for timestamp formatting
|
||||
|
||||
Reference in New Issue
Block a user