Skip to content

Commit 59a2a05

Browse files
committed
Verify image
1 parent c1f5756 commit 59a2a05

1 file changed

Lines changed: 42 additions & 2 deletions

File tree

actions/ctf-build-image/action.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ runs:
189189
docker-registry-url: ${{ inputs.docker-registry-url }}
190190
docker-repository-name: ${{ inputs.docker-repository-name }}
191191
# only save on events which are expected to be from the default branch
192-
docker-save-cache:
193-
${{ github.event_name == 'schedule' || github.event_name == 'push' }}
192+
docker-save-cache: ${{ github.event_name == 'schedule' ||
193+
github.event_name == 'push' || github.event_name == 'pull_request' }} # DEBUG: Testing cache
194194
# dont use cache on events which are expected to be from the default branch
195195
# this is to create a fresh cache/snapshot unpolluted by previous cache entries
196196
docker-restore-cache:
@@ -208,3 +208,43 @@ runs:
208208
aws-region: ${{ inputs.aws-region }}
209209

210210
github-token: ${{ steps.github-token.outputs.access-token || '' }}
211+
212+
# DEBUG: Inspect built image
213+
- name: Inspect built image
214+
if: inputs.inspect-image == 'true'
215+
shell: bash
216+
env:
217+
IMAGE:
218+
"${{ inputs.docker-registry-url }}/${{ inputs.docker-repository-name
219+
}}:${{ inputs.image-tag }}"
220+
run: |
221+
echo "::group::Pull image"
222+
docker pull "$IMAGE"
223+
echo "::endgroup::"
224+
225+
echo "::group::Installed binaries"
226+
docker run --rm --user root --entrypoint ls "$IMAGE" -lahS /usr/local/bin/
227+
echo "::endgroup::"
228+
229+
echo "::group::Binary checksums (SHA256)"
230+
docker run --rm --user root --entrypoint sh "$IMAGE" \
231+
-c 'find /usr/local/bin -maxdepth 1 -type f | sort | xargs sha256sum'
232+
echo "::endgroup::"
233+
234+
echo "::group::Shared libraries"
235+
docker run --rm --user root --entrypoint sh "$IMAGE" \
236+
-c 'ls -la /usr/lib/lib* 2>/dev/null || echo "No shared libraries found"'
237+
echo "::endgroup::"
238+
239+
echo "::group::Chainlink version"
240+
docker run --rm "$IMAGE" --version || true
241+
echo "::endgroup::"
242+
243+
echo "::group::Environment variables"
244+
docker inspect "$IMAGE" --format '{{range .Config.Env}}{{println .}}{{end}}'
245+
echo "::endgroup::"
246+
247+
echo "::group::Image config"
248+
docker inspect "$IMAGE" --format '{{json .Config}}' | python3 -m json.tool 2>/dev/null \
249+
|| docker inspect "$IMAGE" --format '{{json .Config}}'
250+
echo "::endgroup::"

0 commit comments

Comments
 (0)