Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include '../php/database.php';
- $duser = 'username';
- $dpass = 'password';
- $dmail = 'email';
- $tag = 'from system';
- function tagImage($tag) {
- $getImageID = "SELECT `imageID` FROM `docker_images` WHERE `tag` = :tag ";
- $params = array(':tag' => $tag);
- $results = dataQuery($getImageID, $params);
- if(!empty($results)) {
- $image = $results[0]['imageID'];
- global $repo = $results[0]['repo']; // I know this is a bad idea, will change it when all else is working
- $last = system("sudo docker tag -f $image $repo 2>&1", $retval);
- }
- return $retval;
- }
- $tagStatus = tagImage($tag);
- if(0 == $tagStatus) {
- echo '<pre>';
- $login = system("sudo docker login --username=$duser", $retval);
- var_dump($login);
- var_dump($retval);
- // push it real good
- $last = system("sudo docker push $repo 2>&1", $retval1);
- var_dump($last);
- var_dump($retval1);
- }
- ?>
- string(0) ""
- int(1)
- The push refers to a repository [fciloars/oars-gateway] (len: 1)
- 21d623eb89a9: Image push failed
- Please login prior to push:
- Username: EOF
- string(13) "Username: EOF"
- int(1)
Add Comment
Please, Sign In to add comment