UNCLASSIFIED

prebuild.sh 860 Bytes
Newer Older
Humberto Ojeda's avatar
Humberto Ojeda committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/bin/bash

VERSION=8.0.1
IMAGE_NAME=opensource/keycloak
IMAGE_DIGEST=sha256:9a91f646de4becefbae9bd3e5e0cd8de21bf17a22055ccabff324798c2be68a0
IMAGE_ID=09676d6523523e6f37932a604a63d53b3e605459cbecc999b3e95d6770a3ccd6
NEXUS_REGISTRY=nexus-docker-secure.levelup-dev.io
NEXUS_TAG=${NEXUS_REGISTRY}/builder-${IMAGE_NAME}:${VERSION}

set -e

# pull builder image; no GPG/sha checks are necessary because an explicit content hash (i.e. image digest) is used
sudo podman pull docker.io/jboss/keycloak@${IMAGE_DIGEST}

# re-tag image for Nexus Registry
sudo podman tag ${IMAGE_ID} ${NEXUS_TAG}

# push newly tagged image
sudo podman push ${NEXUS_TAG}

# clean up, including all tags for image
sudo podman rmi --force ${IMAGE_ID}

# Image digest and ID can be retrieved by doing a `podman inspect` once you have pulled the Docker image by its tag on your local machine