Skip to content

Commit

Permalink
Merge pull request #959 from SaschaSchwarze0/sascha-buildah-v1.23.1
Browse files Browse the repository at this point in the history
Update BuildAh to v1.23.1
  • Loading branch information
openshift-merge-robot authored Jan 20, 2022
2 parents 3f96fb2 + 446aa59 commit a962084
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 5 deletions.
41 changes: 38 additions & 3 deletions samples/buildstrategy/buildah/buildstrategy_buildah_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
spec:
buildSteps:
- name: build-and-push
image: quay.io/containers/buildah:v1.20.1
image: quay.io/containers/buildah:v1.23.1
workingDir: $(params.shp-source-root)
securityContext:
privileged: true
Expand All @@ -17,9 +17,34 @@ spec:
- |
set -euo pipefail
echo "Creating registries config file..."
format(){
array=(`echo $1 | tr ',' ' '`)
str=""
for m in "${array[@]}"; do
str=$str"'${m}', "
done
echo ${str%??}
}
cat <<EOF >/tmp/registries.conf
[registries.search]
registries = [$(format "$(params.registry-search)")]
[registries.insecure]
registries = [$(format "$(params.registry-insecure)")]
[registries.block]
registries = [$(format "$(params.registry-block)")]
EOF
# Building the image
echo '[INFO] Building image $(params.shp-output-image)'
buildah bud \
--registries-conf='/tmp/registries.conf' \
--tag='$(params.shp-output-image)' \
--file='$(build.dockerfile)' \
'$(params.shp-source-context)'
Expand All @@ -37,8 +62,18 @@ spec:
'$(params.shp-output-image)' | tr -d "\n" > '$(results.shp-image-digest.path)'
resources:
limits:
cpu: 500m
memory: 1Gi
cpu: "1"
memory: 2Gi
requests:
cpu: 250m
memory: 65Mi
parameters:
- description: The registries for searching short name images such as `golang:latest`, separated by commas.
name: registry-search
default: docker.io,quay.io
- description: The fully-qualified name of insecure registries. An insecure registry is one that does not have a valid SSL certificate or only does HTTP.
name: registry-insecure
default: ""
- description: The registries that need to block pull access.
name: registry-block
default: ""
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
- name: s2i
mountPath: /s2i
- name: buildah
image: quay.io/containers/buildah:v1.20.1
image: quay.io/containers/buildah:v1.23.1
workingDir: /s2i
securityContext:
privileged: true
Expand All @@ -29,9 +29,35 @@ spec:
- |
set -euo pipefail
echo "Creating registries config file..."
format(){
array=(`echo $1 | tr ',' ' '`)
str=""
for m in "${array[@]}"; do
str=$str"'${m}', "
done
echo ${str%??}
}
cat <<EOF >/tmp/registries.conf
[registries.search]
registries = [$(format "$(params.registry-search)")]
[registries.insecure]
registries = [$(format "$(params.registry-insecure)")]
[registries.block]
registries = [$(format "$(params.registry-block)")]
EOF
# Building the image
echo '[INFO] Building image $(params.shp-output-image)'
buildah bud --tag='$(params.shp-output-image)'
buildah bud \
--registries-conf='/tmp/registries.conf' \
--tag='$(params.shp-output-image)'
# Push the image
echo '[INFO] Pushing image $(params.shp-output-image)'
Expand All @@ -46,3 +72,13 @@ spec:
volumeMounts:
- name: s2i
mountPath: /s2i
parameters:
- description: The registries for searching short name images such as `golang:latest`, separated by commas.
name: registry-search
default: docker.io,quay.io
- description: The fully-qualified name of insecure registries. An insecure registry is one that does not have a valid SSL certificate or only does HTTP.
name: registry-insecure
default: ""
- description: The registries that need to block pull access.
name: registry-block
default: ""

0 comments on commit a962084

Please sign in to comment.