-
Notifications
You must be signed in to change notification settings - Fork 1
/
Distroless
31 lines (25 loc) · 925 Bytes
/
Distroless
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
# Build stage
FROM debian:12-slim AS builder
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Get copa_version arg
ARG copa_version=0.9.0
# Install required packages for downloading and extracting Copa
RUN apt-get update && \
apt-get install -y \
curl \
tar \
ca-certificates \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# Download and extract Copa
RUN curl --retry 5 -fsSL -o copa.tar.gz https://github.com/project-copacetic/copacetic/releases/download/v${copa_version}/copa_${copa_version}_linux_amd64.tar.gz && \
tar -zxvf copa.tar.gz && \
chmod +x copa
# Final stage
FROM gcr.io/distroless/static
# Copy required components
COPY --from=builder /copa /usr/local/bin/copa
COPY --from=docker:24.0-cli /usr/local/bin/docker /usr/local/bin/docker
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/usr/local/bin/copa", "patch"]
CMD ["--help"]