def networks():
    import os
    import p_docker_menu
    x = 0
    while x != 7:
        os.system("clear")
        os.system("tput setaf 1")
        os.system("tput bold")
        print('''
\t######     ########  ########  ##   ##  ########  ########
\t##   ###   ##    ##  ##        ##  ##   ##        ##    ##
\t##    ###  ##    ##  ##        ## ##    ##        ##    ##
\t##    ###  ##    ##  ##        ####     #####     ########
\t##    ###  ##    ##  ##        ## ##    ##        ##  ##  
\t##   ###   ##    ##  ##        ##  ##   ##        ##   ## 
\t######     ########  ########  ##   ##  ########  ##    ##
\t___________________________________________________________
\t___________________________________________________________
\t\*\                                                     /*/
\t \*\       _____________________________________       /*/
\t  \*\     /*/                                 \*\     /*/
\t   \*\    \*\      WELCOME TO DOCKER TUI      /*/    /*/
\t    \*\    -------------------------------------    /*/
\t     \*\###########################################/*/
\n\n''')
        os.system("tput setaf 1")
        os.system("tput rmul")
        print('''
Press 1 : To create a Network
Press 2 : To show the list of all Network
Press 3 : To inspect a Network
Press 4 : To remove a Network
Press 5 : To show IP routing table
Press 6 : To GO BACK to Main Menu
Press 7 : To EXIT\n''')
        os.system("tput setaf 1")
        x = int(input("Enter your choices : "))
        os.system("tput setaf 15")
        if (x == 1):
            name = input("Enter the name of Network : ")
            os.system("docker network create {}".format(name))
            print("Network created successfully")
        elif (x == 2):
            print("List of docker Networks..... \n")
            os.system("docker network ls")
        elif (x == 3):
            name = input("Enter the name of Network : ")
            os.system("docker network inspect {}".format(name))
        elif (x == 4):
            name = input("Enter the name of Network : ")
            os.system("docker network rm -f {}".format(name))
            print("Network removed successfully")
        elif (x == 5):
            os.system("route -n")
        elif (x == 6):
            p_docker_menu.docker()
        elif (x == 7):
            exit()
def volumes():
    import os
    import p_docker_menu
    x = 0
    while x != 6 :
        os.system("clear")
        os.system("tput setaf 1")
        os.system("tput bold")
        print('''
\t######     ########  ########  ##   ##  ########  ########
\t##   ###   ##    ##  ##        ##  ##   ##        ##    ##
\t##    ###  ##    ##  ##        ## ##    ##        ##    ##
\t##    ###  ##    ##  ##        ####     #####     ########
\t##    ###  ##    ##  ##        ## ##    ##        ##  ##  
\t##   ###   ##    ##  ##        ##  ##   ##        ##   ## 
\t######     ########  ########  ##   ##  ########  ##    ##
\t___________________________________________________________
\t___________________________________________________________
\t\*\                                                     /*/
\t \*\       _____________________________________       /*/
\t  \*\     /*/                                 \*\     /*/
\t   \*\    \*\  WELCOME TO DOCKER VOLUMES TUI  /*/    /*/
\t    \*\    -------------------------------------    /*/
\t     \*\###########################################/*/
\n\n''')
        os.system("tput setaf 1")
        os.system("tput rmul")
        print('''
Press 1 : To create a Volume
Press 2 : To show the list of all Volume
Press 3 : To inspect a Volume
Press 4 : To remove a Volume
Press 5 : To GO BACK to Main Menu
Press 6 : To EXIT\n''')
        os.system("tput setaf 1")
        x = int(input("Enter your choices : "))
        os.system("tput setaf 15")

        if ( x == 1 ):
            name=input("Enter the name of Volume : ")
            os.system("docker volume create {}".format(name))
            print("Volume created successfully")
        elif ( x == 2 ):
            print("List of docker Volumes..... \n")
            os.system("docker volume ls")
        elif ( x == 3 ):
            name=input("Enter the name of Volume : ")
            os.system("docker volume inspect {}".format(name))
        elif ( x == 4 ):
            name=input("enter the name of Volume : ")
            os.system("docker volume rm {}".format(name))
        elif ( x == 5 ):
            p_docker_menu.docker()
        elif ( x == 6 ):
            exit()
        os.system("tput setaf 3")
Beispiel #3
0
def compose():
    import os
    import p_docker_menu
    x = 0
    while x != 6:
        os.system("clear")
        os.system("tput setaf 1")
        os.system("tput bold")
        print('''
\t######     ########  ########  ##   ##  ########  ########
\t##   ###   ##    ##  ##        ##  ##   ##        ##    ##
\t##    ###  ##    ##  ##        ## ##    ##        ##    ##
\t##    ###  ##    ##  ##        ####     #####     ########
\t##    ###  ##    ##  ##        ## ##    ##        ##  ##  
\t##   ###   ##    ##  ##        ##  ##   ##        ##   ## 
\t######     ########  ########  ##   ##  ########  ##    ##
\t___________________________________________________________
\t___________________________________________________________
\t\*\                                                     /*/
\t \*\       _____________________________________       /*/
\t  \*\     /*/                                 \*\     /*/
\t   \*\    \*\  WELCOME TO DOCKER COMPOSE TUI  /*/    /*/
\t    \*\    -------------------------------------    /*/
\t     \*\###########################################/*/
\n\n''')
        os.system("tput setaf 1")
        os.system("tput rmul")
        print('''
Press 1 : To open the compose file
Press 2 : To show the content of compose file
Press 3 : To run docker compose to start
Press 4 : To run docker compose to stop 
Press 5 : To GO BACK to Main Menu
Press 6 : To EXIT\n''')
        os.system("tput setaf 1")
        x = int(input("Enter your choices : "))
        os.system("tput setaf 15")

        if (x == 1):
            os.system("vim docker-compose.yml")
        elif (x == 2):
            os.system("cat docker-compose.yml")
        elif (x == 3):
            os.system("docker-compose up -d")
        elif (x == 4):
            os.system("docker-compose stop")
        elif (x == 5):
            p_docker_menu.docker()
        elif (x == 6):
            exit()
        os.system("tput setaf 3")
Beispiel #4
0
def tui():
    import os
    x = 0
    while (x != 3):
        os.system("clear")
        os.system("tput setaf 1")
        os.system("tput bold")
        print('''
\t\t ########  ##     ##  ####
\t\t    ##     ##     ##   ##
\t\t    ##     ##     ##   ##
\t\t    ##     ##     ##   ##
\t\t    ##     ##     ##   ##
\t\t    ##     ##     ##   ##
\t\t    ##      ##   ##    ##
\t\t    ##       #####    ####
\t\t _________________________
\t\t  SERVICES AVAILABLE FOR 
\t\t _________________________
\t\t \  #  \  ________________
\t\t  \  #  \ #              #                 
\t\t   \  #  \#  DOCKER TUI  #  
\t\t    \  #  ----------------
\t\t     \  ##################
\t\t      \  _________________
\t\t       \ #               #
\t\t        \#   LINUX TUI   #  
\t\t         -----------------   
\n''')
        os.system("tput rmul")
        os.system("tput setaf 1")
        print('''
Press 1 : TO SWITCH INTO DOCKER TUI
Press 2 : TO SWITCH INTO LINUX TUI
press 3 : TO EXIT \n''')
        os.system("tput setaf 1")
        x = int(input("Enter your choices : "))
        os.system("tput setaf 15")
        if (x == 1):
            import p_docker_menu
            p_docker_menu.docker()
        elif (x == 2):
            import Linux
            Linux.linux()
        elif (x == 3):
            exit()
    else:
        print("invalid option plz press either 1 or 2")
Beispiel #5
0
def containers():
    import os
    
    x = 0
    while x != 10 :
        os.system("clear")
        os.system("tput setaf 1")
        os.system("tput bold")
        print('''
\t######     ########  ########  ##   ##  ########  ########
\t##   ###   ##    ##  ##        ##  ##   ##        ##    ##
\t##    ###  ##    ##  ##        ## ##    ##        ##    ##
\t##    ###  ##    ##  ##        ####     #####     ########
\t##    ###  ##    ##  ##        ## ##    ##        ##  ##  
\t##   ###   ##    ##  ##        ##  ##   ##        ##   ## 
\t######     ########  ########  ##   ##  ########  ##    ##
\t___________________________________________________________
\t___________________________________________________________
\t\*\                                                     /*/
\t \*\      _______________________________________      /*/
\t  \*\    /*/                                   \*\    /*/
\t   \*\   \*\  WELCOME TO DOCKER CONTAINER TUI  /*/   /*/
\t    \*\   ---------------------------------------   /*/
\t     \*\###########################################/*/
\n\n''')
        os.system("tput setaf 1")
        os.system("tput rmul")
        print('''
Press 1 : To create a container
Press 2 : To show the list of all containers
Press 3 : To show the list of active containers
Press 4 : To start a container
Press 5 : To run a container
Press 6 : To stop a container
Press 7 : To execute a command in a container
Press 8 : To remove a container
Press 9 : To GO BACK to Main Menu
Press 10 : To EXIT\n''')
        os.system("tput setaf 1")
        x = int(input("Enter your choices : "))
        os.system("tput setaf 15")

        if ( x == 1 ):
            import os
            name=input("enter the name of image : ")
            os.system("docker run -itd {}".format(name))
            print("Container created successfully")
        elif ( x == 2 ):
            print("List of docker containers..... \n")
            os.system("docker ps -a")
        elif ( x == 3 ):
            print("List of active docker containers..... \n")
            os.system("docker ps")
        elif ( x == 4 ):
            name=input("enter the name of container : ")
            os.system("docker start {}".format(name))
            print("Container started successfully")
        elif ( x == 5 ):
            name=input("enter the name of container : ")
            os.system("docker attach {}".format(name))
        elif ( x == 6 ):
            name=input("enter the name of container : ")
            os.system("docker stop {}".format(name))
            print("Container stopped successfully")
        elif ( x == 7 ):
            name=input("enter the name of container : ")
            cmd=input("enter the command : ")
            os.system("docker exec -it {} {}".format(name,cmd))
        elif ( x == 8 ):
            name=input("enter the name of container : ")
            os.system("docker rm -f {}".format(name))
            print("Container removed successfully")
        elif ( x == 9 ):
            import p_docker_menu
            p_docker_menu.docker()
        elif ( x == 10 ):
            exit()
        os.system("tput setaf 1")
Beispiel #6
0
def images():
    import os
    import p_docker_menu
    x = 0
    while x != 9 :
        os.system("clear")
        os.system("tput setaf 1")
        os.system("tput bold")
        print('''
\t######     ########  ########  ##   ##  ########  ########
\t##   ###   ##    ##  ##        ##  ##   ##        ##    ##
\t##    ###  ##    ##  ##        ## ##    ##        ##    ##
\t##    ###  ##    ##  ##        ####     #####     ########
\t##    ###  ##    ##  ##        ## ##    ##        ##  ##  
\t##   ###   ##    ##  ##        ##  ##   ##        ##   ## 
\t######     ########  ########  ##   ##  ########  ##    ##
\t___________________________________________________________
\t___________________________________________________________
\t\*\                                                     /*/
\t \*\       _____________________________________       /*/
\t  \*\     /*/                                 \*\     /*/
\t   \*\    \*\  WELCOME TO DOCKER IMAGES TUI   /*/    /*/
\t    \*\    -------------------------------------    /*/
\t     \*\###########################################/*/
\n\n''')
        os.system("tput setaf 1")
        os.system("tput rmul")
        print('''
Press 1 : To install a new Image
Press 2 : To upload a image
Press 3 : To show the list of all Images
Press 4 : To delete a Image
Press 5 : To rename a Image
Press 6 : To commit a Image from Container
Press 7 : To inspect a Image
Press 8 : To GO BACK to Main Menu
Press 9 : To EXIT\n''')
        os.system("tput setaf 1")
        x = int(input("Enter your choices : "))
        os.system("tput setaf 15")

        if ( x == 1 ):
            name=input("enter the name of image : ")
            os.system("docker pull {}".format(name))
            print("image installed successfully")
        elif ( x == 3 ):
            print("\nDocker images..... \n")
            os.system("docker images")
        elif ( x == 2 ):
            name=input("enter the name of image : ")
            os.system("docker push {}".format(name))
        elif ( x == 4 ):
            name=input("enter the name of image : ")
            os.system("docker rmi {}".format(name))
            print("image removed successfully")
        elif ( x == 5 ):
            name=input("enter the name of image : ")
            namei=input("enter the new name of image : ")
            os.system("docker tag {} {}".format(name,namei))
            print("image renamed successfully")
        elif ( x == 6 ):
            name=input("enter the name of container : ")
            namei=input("enter the name of image : ")
            os.system("docker commit {} {}".format(name,namei))
            print("image created successfully")
        elif ( x == 7 ):
            name=input("enter the name of image : ")
            os.system("docker image inspect {}".format(name))
        elif ( x == 8 ):
            p_docker_menu.docker()
        elif ( x == 9 ):
            exit()
        os.system("tput setaf 1")
Beispiel #7
0
def services():
    import os
    import p_docker_menu
    x = 0
    while x != 10:
        os.system("clear")
        os.system("tput setaf 1")
        os.system("tput bold")
        print('''
\t######     ########  ########  ##   ##  ########  ########
\t##   ###   ##    ##  ##        ##  ##   ##        ##    ##
\t##    ###  ##    ##  ##        ## ##    ##        ##    ##
\t##    ###  ##    ##  ##        ####     #####     ########
\t##    ###  ##    ##  ##        ## ##    ##        ##  ##  
\t##   ###   ##    ##  ##        ##  ##   ##        ##   ## 
\t######     ########  ########  ##   ##  ########  ##    ##
\t___________________________________________________________
\t___________________________________________________________
\t\*\                                                     /*/
\t \*\       _____________________________________       /*/
\t  \*\     /*/                                 \*\     /*/
\t   \*\    \*\ WELCOME TO DOCKER SERVICES TUI  /*/    /*/
\t    \*\    -------------------------------------    /*/
\t     \*\###########################################/*/
\n\n''')
        os.system("tput setaf 1")
        os.system("tput rmul")
        print('''
Press 1 : For Docker Installation
Press 2 : To start Docker services
Press 3 : To stop Docker services
Press 4 : To restart Docker services
Press 5 : To show Docker version
Press 6 : To show Docker information
Press 7 : To show Docker status
Press 8 : To Login in docker hub
Press 9 : To GO BACK to Main Menu
Press 10 : To EXIT \n''')
        os.system("tput setaf 1")
        x = int(input("Enter your choices : "))
        os.system("tput setaf 15")

        if (x == 1):
            os.system("yum install docker-ce")
            os.system("tput setaf 1")
        elif (x == 2):
            os.system("systemctl start docker")
            os.system("tput setaf 1")
        elif (x == 3):
            os.system("systemctl stop docker")
            os.system("tput setaf 1")
        elif (x == 4):
            os.system("systemctl restart docker")
            os.system("tput setaf 1")
        elif (x == 5):
            os.system("docker version")
            os.system("tput setaf 1")
        elif (x == 6):
            os.system("docker info")
            os.system("tput setaf 1")
        elif (x == 7):
            os.system("systemctl status docker")
            os.system("tput setaf 1")
        elif (x == 8):
            os.system("docker login")
            os.system("tput setaf 1")
        elif (x == 9):
            p_docker_menu.docker()
            os.system("tput setaf 1")
        elif (x == 10):
            exit()