Skip to content

Commit 4bb3ae8

Browse files
committed
chore: bump to 0.1.1, switch Docker to Go binary (ossguard-go)
- Version 0.1.1 - Dockerfile: replace Python image with Go multi-stage build (~15MB vs ~200MB) - docker.yml: pass version build-arg to clone correct ossguard-go tag
1 parent 4cb970a commit 4bb3ae8

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

.github/workflows/docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,7 @@ jobs:
4747
push: ${{ github.event_name != 'pull_request' }}
4848
tags: ${{ steps.meta.outputs.tags }}
4949
labels: ${{ steps.meta.outputs.labels }}
50+
build-args: |
51+
OSSGUARD_VERSION=${{ github.ref_name }}
5052
cache-from: type=gha
5153
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
FROM python:3.12-slim@sha256:46cb7cc2877e60fbd5e21a9ae6115c30ace7a077b9f8772da879e4590c18c2e3 AS builder
1+
FROM golang:1.22-alpine AS builder
22

3-
WORKDIR /app
4-
COPY pyproject.toml README.md LICENSE ./
5-
COPY src/ src/
3+
WORKDIR /build
64

7-
RUN pip install --no-cache-dir build==1.2.2.post1 && \
8-
python -m build --wheel && \
9-
pip install --no-cache-dir dist/*.whl
5+
# Clone ossguard-go and build static binary
6+
ARG OSSGUARD_VERSION=main
7+
RUN apk add --no-cache git && \
8+
git clone --depth 1 --branch ${OSSGUARD_VERSION} \
9+
https://github.com/kirankotari/ossguard-go.git . && \
10+
CGO_ENABLED=0 go build -ldflags="-s -w" -o ossguard ./cmd/ossguard
1011

11-
FROM python:3.12-slim@sha256:46cb7cc2877e60fbd5e21a9ae6115c30ace7a077b9f8772da879e4590c18c2e3
12+
FROM alpine:3.20
1213

1314
LABEL org.opencontainers.image.source="https://github.com/kirankotari/ossguard"
1415
LABEL org.opencontainers.image.description="One CLI to guard any OSS project with OpenSSF security best practices"
1516
LABEL org.opencontainers.image.licenses="Apache-2.0"
1617

17-
RUN apt-get update && \
18-
apt-get install -y --no-install-recommends git && \
19-
rm -rf /var/lib/apt/lists/*
18+
RUN apk add --no-cache git && \
19+
adduser -D -h /home/ossguard ossguard
2020

21-
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
22-
COPY --from=builder /usr/local/bin/ossguard /usr/local/bin/ossguard
21+
COPY --from=builder /build/ossguard /usr/local/bin/ossguard
2322

24-
RUN useradd --create-home ossguard
2523
USER ossguard
2624
WORKDIR /project
2725

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ossguard"
7-
version = "0.1.0"
7+
version = "0.1.1"
88
description = "One-command CLI to guard any OSS project with OpenSSF security best practices — bootstrap, scan, and monitor."
99
readme = "README.md"
1010
license = {text = "Apache-2.0"}

0 commit comments

Comments
 (0)