Use images for more than their default program: read files, test a config and run a backup job with different arguments.
Print the Alpine release with a one-off container:
Keep the next one, so its output stays in its logs:
sh
docker run --name osinfo alpine:3.20 cat /etc/os-release
docker logs osinfopier/web:1.0 does not start. Test its nginx configuration instead of starting the server:
pier/backup:1.0 has an entrypoint. Read how it is built:
sh
docker image inspect --format 'ENTRYPOINT={{json .Config.Entrypoint}} CMD={{json .Config.Cmd}}' pier/backup:1.0Create backup-users, which backs up users instead of all:
sh
docker run --name backup-users pier/backup:1.0 usersFinally, read the script itself. Passing cat after the image only hands it to backup.sh; replace the entrypoint:
sh
docker run --rm --entrypoint cat pier/backup:1.0 /usr/local/bin/backup.sh