Skip to content

Instantly share code, notes, and snippets.

@sh41
sh41 / get-docker-image-tag-by-sha.sh
Created March 4, 2024 10:00 — forked from achetronic/get-docker-image-tag-by-sha.sh
Find the tag of a Docker image having only the SHA256
#!/bin/bash
SHA256_HASH="df41d97cb66f3407c9b728b4d553e3bc6f7a2ffa7b47633aa6e2422d612a5461"
for i in {1..1000}
do
echo "Looking into page: $i"
curl "https://registry.hub.docker.com/v2/repositories/nginxproxy/docker-gen/tags/?page=$i" \
| jq '.results[] | select(.["images"][]["digest"] == "sha256:'${SHA256_HASH}'")'
@sh41
sh41 / 01 Create a debug version of the docker image.sh
Last active April 16, 2024 10:08
Debugging segmentation faults in PHP in a docker container.
git clone git@github.com:docker-library/php.git docker-library-php
## Go to the specific version you're interested in
cd docker-library-php/7.1/fpm/alpine
## Edit the .Dockerfile.
## Change
## ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data
## to
## ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-debug
## Comment out or delete: