-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added distroless support and updated README
- Added distroless dockerfile for minimal image - Updated README with distroless build and usage instructions
- Loading branch information
1 parent
2d868f6
commit 7684364
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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"] |