Skip to content

Commit 6d987f4

Browse files
committed
Add buildargs and import examples.
1 parent 4fac782 commit 6d987f4

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This example demonstrates how to use the buildargs field in the build step.
2+
# The buildargs field allows you to pass build-time variables to the Dockerfile.
3+
steps:
4+
buildargs-step:
5+
build:
6+
buildargs:
7+
MY_VERSION: 2.0
8+
dockerfile: |
9+
FROM alpine:latest
10+
ARG MY_VERSION
11+
LABEL version=$MY_VERSION
12+
13+
# To view the label in the built image do the following:
14+
# 1. Uncomment the following 'push:' line
15+
# 2. Run 'PYTHONPATH=. ./bin/buildrunner -f examples/build/buildargs/buildrunner.yaml'
16+
# 3. Run 'docker image inspect my-images/buildargs-image:latest' to see the label.
17+
#
18+
# push: my-images/buildargs-image:latest
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This example demonstrates how to import a tarball image in the build step.
2+
# This requires the tarball image to be present in the same directory where buildrunnner is executed.
3+
# Before running this example, make sure to create a tarball image using the following command:
4+
# docker save alpine:latest -o alpine.tar
5+
#
6+
# WARNING: Do not commit the tarball image to the repository.
7+
#
8+
steps:
9+
import-step:
10+
build:
11+
import: alpine.tar

run-buildrunner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# This script will run the local buildrunner code from the root of the project
44
# ./run-buildrunner.sh --help
55
# ./run-buildrunner.sh -f examples/build/basic/buildrunner.yaml
6-
PYTHONPATH=. ./bin/buildrunner "$@"
6+
PYTHONPATH=. ./bin/buildrunner --cleanup-images "$@"

0 commit comments

Comments
 (0)