Exemplo n.º 1
0
 def createContainer(self, id, image):
     command = "docker run -d -ti --name %s %s" % ("%s_%s" % (image, id), "webservercloud")
     ssh = SshOps()
     res = ssh.runCommand(command)
     if res["status"] == 1:
         print res["message"]
     else:
         command = "docker exec %s bash /opt/4linux/makeclass.sh %s" % (id, image)
         res = ssh.runCommand(command)
Exemplo n.º 2
0
 def createContainer(self, id, image):
     command = "docker run -d -ti --name %s %s" % ("%s_%s" % (image, id),
                                                   'webservercloud')
     ssh = SshOps()
     res = ssh.runCommand(command)
     if res['status'] == 1:
         print res['message']
     else:
         command = "docker exec %s bash /opt/4linux/makeclass.sh %s" % (
             id, image)
         res = ssh.runCommand(command)
Exemplo n.º 3
0
    def removeContainer(self, id, image):
        command = "docker stop %s" % ("%s_%s" % (image, id))
        ssh = SshOps()
        res = ssh.runCommand(command)
        if res["status"] == 1:
            print res["message"]

        command = "docker rm %s" % ("%s_%s" % (image, id))
        res = ssh.runCommand(command)
        if res["status"] == 1:
            print res["message"]
        else:
            print res["message"]
Exemplo n.º 4
0
    def removeContainer(self, id, image):
        command = "docker stop %s" % ("%s_%s" % (image, id))
        ssh = SshOps()
        res = ssh.runCommand(command)
        if res['status'] == 1:
            print res['message']

        command = "docker rm %s" % ("%s_%s" % (image, id))
        res = ssh.runCommand(command)
        if res['status'] == 1:
            print res['message']
        else:
            print res['message']