2017-08-07 08:02:38 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-09-18 09:46:40 +02:00
|
|
|
docker pull tomcat:latest
|
2017-08-07 08:02:38 +02:00
|
|
|
|
|
|
|
IP=`ip addr s eth0 |grep "inet "|awk '{print $2}' |awk -F "/" '{print $1}'`
|
2017-09-18 09:46:40 +02:00
|
|
|
PASSHRASE='Harbor12345'
|
|
|
|
|
|
|
|
echo $IP
|
|
|
|
|
2017-08-07 08:02:38 +02:00
|
|
|
export DOCKER_CONTENT_TRUST=1
|
|
|
|
export DOCKER_CONTENT_TRUST_SERVER=https://$IP:4443
|
|
|
|
|
2017-09-18 09:46:40 +02:00
|
|
|
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
|
2017-08-07 08:02:38 +02:00
|
|
|
|
2017-09-18 09:46:40 +02:00
|
|
|
docker login -u admin -p Harbor12345 $IP
|
2017-08-07 08:02:38 +02:00
|
|
|
docker tag tomcat $IP/library/tomcat:latest
|
2017-09-18 09:46:40 +02:00
|
|
|
docker push $IP/library/tomcat:latest
|
|
|
|
|