Skip to content

Instantly share code, notes, and snippets.

@glasnt
Last active November 21, 2023 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glasnt/125c86569fe67a14e02b16c531f89a3d to your computer and use it in GitHub Desktop.
Save glasnt/125c86569fe67a14e02b16c531f89a3d to your computer and use it in GitHub Desktop.
Cloud Buildpacks and Cloud Build
steps:
- id: build
name: gcr.io/k8s-skaffold/pack
args:
- build
- us-docker.pkg.dev/$PROJECT_ID/containers/myapp
- "--builder=gcr.io/buildpacks/builder:v1"
- "--network=cloudbuild"
- "--path=."
- "--workspace=/app"
images:
- us-docker.pkg.dev/$PROJECT_ID/containers/myapp
steps:
# Call the image directly
- id: default
name: us-docker.pkg.dev/$PROJECT_ID/containers/myapp
# Add additional args
- id: args
name: us-docker.pkg.dev/$PROJECT_ID/containers/myapp
args: ["extra", "arguments"]
# Customise the invocation within the image
- id: launcher
name: us-docker.pkg.dev/$PROJECT_ID/containers/myapp
entrypoint: launcher
args: ["python3", "main.py", "args"]
#!/usr/bin/env python
import sys
print(f"Hello I am a main.py, writing content to stdout. Invocation: {sys.argv}")
web: ./main.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment