Unzips a file stored in GCS, via a Cloud Run Job.
652
Unzips a local ZIP file from a mounted path and uploads its contents to Google Cloud Storage under a specified object prefix. Performs safe path checks to avoid zip‑slip attacks and can optionally clean up the local directory after completion.
cmd/cloudRunUnzipInGcs/main.goMOUNT_PATH/IN_FILE as a ZIP archive and iterates entries.OUT_DIRECTORY/<zip relative path>.OUT_DIRECTORY in GCS.DELETE_ZIP_FILE=true, empties the local directory containing the ZIP (removes all entries).docker run --rm \
-e TASK_ID=task-123 \
-e DAG_ID=dag-abc \
-e MOUNT_PATH=/data \
-e IN_FILE=landing/archive.zip \
-e OUT_DIRECTORY=unzipped/2025-11-11 \
-e BUCKET=my-bucket \
-e DELETE_ZIP_FILE=true \
-v "$(pwd)/data:/data" \
-v "$GOOGLE_APPLICATION_CREDENTIALS:/var/secrets/google/key.json:ro" \
-e GOOGLE_APPLICATION_CREDENTIALS=/var/secrets/google/key.json \
sqlpipe/cloud-run-unzip-in-gcs:dev-<tag>
GOOGLE_APPLICATION_CREDENTIALS), or a workload identity in managed environments.OUT_DIRECTORY with each file’s relative path inside the ZIP, preserving the ZIP’s internal structure.Content type
Image
Digest
sha256:fe20203d1…
Size
9.9 MB
Last updated
11 months ago
docker pull sqlpipe/cloud-run-unzip-in-gcs:3