UNCLASSIFIED

prebuild.sh 860 Bytes
Newer Older
1 2 3 4
#!/bin/bash

VERSION=6.0.1
IMAGE_NAME=opensource/keycloak
5
IMAGE_DIGEST=sha256:7caca7d35749ebeade412cdbca5a899e9a9d9a59a872f5d1185c59d993004694
6
IMAGE_ID=3a6718ca4ee02c3a9e9f4a4982d40f04f3bbc2f4ee9b936459519ea125ab87a9
7
NEXUS_REGISTRY=nexus-docker-secure.levelup-dev.io
8 9 10 11 12
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
13
sudo podman pull docker.io/jboss/keycloak@${IMAGE_DIGEST}
14 15 16 17 18 19 20 21 22 23 24

# 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