How is a Docker Machine marked as active?

后端 未结 3 701
一生所求
一生所求 2021-02-01 05:20

I am working through the Docker Machine User Guide over at https://docs.docker.com/v1.5/machine/.

It says:

You can see the machine you have created by r         


        
3条回答
  •  逝去的感伤
    2021-02-01 05:56

    Use below command for Docker for Windows Container with Powershell to make machine active:

    #Powershell command
    PS: docker-machine env default
    #output might me like this
     $Env:DOCKER_TLS_VERIFY = "1"
     $Env:DOCKER_HOST = "tcp://172.16.104.171:2376"
     $Env:DOCKER_CERT_PATH = "C:\Users\username\.docker\machine\machines\default"
     $Env:DOCKER_MACHINE_NAME = "default"
    #DOCKER_HOST environmental variable should has same value as default machine
    PS:$Env:DOCKER_HOST = "tcp://172.16.104.171:2376" # should be same as default machine Env:DOCKER_HOST
    #Now list docker machines, default will be active.
    PS: docker-machine ls
    #default is not active and it look like this.
    NAME       ACTIVE   DRIVER   STATE     URL                         SWARM   DOCKER    ERRORS
    default    *        hyperv   Running   tcp://172.16.104.171:2376           v1.12.3
    manager1   -        hyperv   Running   tcp://172.16.104.168:2376           v1.12.3
    

    Dock

提交回复
热议问题