mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-19 00:36:02 +01:00
470000a9ec
Signed-off-by: wang yan <wangyan@vmware.com>
25 lines
739 B
Bash
Executable File
25 lines
739 B
Bash
Executable File
#!/bin/bash
|
|
|
|
docker pull tomcat:latest
|
|
|
|
IP=$1
|
|
notaryServerEndpoint=$2
|
|
PASSHRASE='Harbor12345'
|
|
|
|
echo $IP
|
|
echo "Notary server endpoint: $notaryServerEndpoint"
|
|
|
|
export DOCKER_CONTENT_TRUST=1
|
|
export DOCKER_CONTENT_TRUST_SERVER=https://$notaryServerEndpoint
|
|
|
|
export NOTARY_ROOT_PASSPHRASE=$PASSHRASE
|
|
export NOTARY_TARGETS_PASSPHRASE=$PASSHRASE
|
|
export NOTARY_SNAPSHOT_PASSPHRASE=$PASSHRASE
|
|
export DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE=$PASSHRASE
|
|
export DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=$PASSHRASE
|
|
export DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE=$PASSHRASE
|
|
export DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE=$PASSHRASE
|
|
|
|
docker login -u admin -p Harbor12345 $IP
|
|
docker tag tomcat $IP/library/tomcat:latest
|
|
docker push $IP/library/tomcat:latest |