refs #7442 Cache script

This commit is contained in:
Juan Ferrer 2024-07-15 07:50:11 +02:00
parent 94eb3d25ef
commit 03af1e775e
5 changed files with 36 additions and 18 deletions

18
image-cache.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -e
MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$MY_DIR/image.conf"
image=$1
if [[ -z "$image" ]]; then
echo "Usage: $0 <image>"
exit 1
fi
taggedImage="$registry/$image"
docker image pull "$image"
docker image tag "$image" "$taggedImage"
docker image push "$taggedImage"

View File

@ -2,7 +2,7 @@
set -e
MY_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$MY_DIR/push.conf"
source "$MY_DIR/image.conf"
# Prepare the environment
@ -20,7 +20,7 @@ if [ ! -z "$revision" ]; then
tag="$tag-$revisionPrefix$revision"
fi
fullImage="$registry/$image"
fullImage="$registry/$repository/$image"
latestImage="$fullImage:latest"
taggedImage="$fullImage:$tag"

3
image.conf Normal file
View File

@ -0,0 +1,3 @@
registry="registry.verdnatura.es"
repository="verdnatura"
revisionPrefix="vn"

View File

@ -1,2 +0,0 @@
registry="registry.verdnatura.es/verdnatura"
revisionPrefix="vn"

View File

@ -19,7 +19,6 @@ RUN pip install --upgrade pip \
# python3-pip \
# wget
#RUN pip3 install --upgrade pip \
# pip3 install --upgrade virtualenv \
# pip3 install pywinrm[kerberos] \