16 lines
526 B
Plaintext
16 lines
526 B
Plaintext
|
#!/bin/bash
|
||
|
if [[ "$1" == "help" ]]; then
|
||
|
echo "Please format the command like this: container-upload <original docker image>"
|
||
|
exit
|
||
|
fi
|
||
|
|
||
|
tag=$(echo $1 | grep -o -P "(:(?P<tag>[\w.\-_]{1,127})|)$")
|
||
|
name=$(echo $1 | grep -o -P "(?<=\/)([a-z0-9._-]+)(?=(:([\w.\-_]{1,127})|)$)")
|
||
|
|
||
|
echo uploading $name...
|
||
|
sudo docker pull $1
|
||
|
sudo docker tag $1 gitea.henriserverack.com/archive-team/$name$tag
|
||
|
sudo docker push gitea.henriserverack.com/archive-team/$name$tag
|
||
|
|
||
|
echo uploaded $name to gitea.henriserverack.com/archive-team/$name$tag
|