Skip to content

Commit 15aafbe

Browse files
authored
Merge pull request #16 from ruivieira/fix-build
fix: Pull only base images
2 parents 05c4c0c + 1bd687a commit 15aafbe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/build-and-push.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,13 @@ jobs:
7979
# Run docker commands
8080
- name: Pull prerequisite images
8181
run: |
82-
docker pull $(cat Dockerfile | grep -o -P '(?<=FROM ).*(?= AS build)')
83-
docker pull $(cat Dockerfile | grep -o -P '(?<=FROM ).*(?= AS runtime)')
82+
BASE_IMAGES=$(grep -o -P '(?<=FROM ).*' Dockerfile | cut -d ' ' -f1)
83+
84+
if [ -n "$BASE_IMAGES" ]; then
85+
for img in $BASE_IMAGES; do
86+
docker pull "$img"
87+
done
88+
fi
8489
- name: Put expiry date on CI-tagged image
8590
if: env.BUILD_CONTEXT == 'ci'
8691
run: sed -i 's#summary="odh-trustyai-service-python\"#summary="odh-trustyai-service-python" \\ \n quay.expires-after=7d#' Dockerfile

0 commit comments

Comments
 (0)