Skip to content

Commit

Permalink
refactor: Simplified Dockerfile and Copa commands
Browse files Browse the repository at this point in the history
- Removed unnecessary packages (jq)
- Removed scanner flag from Copa command
- Optimized base configuration
  • Loading branch information
pradhans0906 committed Dec 7, 2024
1 parent 7684364 commit 45e69f1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,28 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
- name: Build and push standard version
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args: |
BUILD_ENV=ci
copa_version=0.9.0
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/dockerized-copa:latest
${{ secrets.DOCKERHUB_USERNAME }}/dockerized-copa:0.9.0
- name: Build and push distroless version
uses: docker/build-push-action@v5
with:
context: .
file: ./Distroless
build-args: |
BUILD_ENV=ci
copa_version=0.9.0
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/dockerized-copa:distroless
${{ secrets.DOCKERHUB_USERNAME }}/dockerized-copa:0.9.0-distroless
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM debian:12-slim

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Get copa_version arg
Expand All @@ -12,7 +11,6 @@ RUN apt-get update && \
ca-certificates \
curl \
gnupg \
jq \
lsb-release \
--no-install-recommends && \
# Set up Docker repository
Expand Down Expand Up @@ -42,7 +40,7 @@ RUN echo '#!/bin/bash' > /entrypoint.sh && \
echo ' echo "{\"credsStore\":\"\"}" > /root/.docker/config.json' >> /entrypoint.sh && \
echo 'fi' >> /entrypoint.sh && \
echo 'docker pull "$1"' >> /entrypoint.sh && \
echo 'copa patch --scanner docker-scout -i "$1" -t "${2:-patched}" --debug' >> /entrypoint.sh && \
echo 'copa patch -i "$1" -t "${2:-patched}" --debug' >> /entrypoint.sh && \
chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit 45e69f1

Please sign in to comment.