Original article, welcome to reprint. Reprint please specify: reprint from IT people story, thank you! Using docker-machine on Aliyun under Linux/MAC

In section 10, it was mentioned that the virtual machine was created locally by docker-machine, and the Docker we used was installed in the virtual machine. Virtual machines can also be created on the cloud using Docker-machine.

Check out the official website

  • Website directly recommended docs.docker.com/machine/get…






  • domestic












Github.com/AliyunConta…




The preparatory work

  • Download docker-machine-drivers.oss-cn-beijing.aliyuncs.com/docker-mach…



  • For details, see my “Install Docker on centos (9)”, remember to install docker-machine oh. Also how to install docker-machine to everyone say next
base=https://github.com/docker/machine/releases/download/v0.14.0 && curl - L$base/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine &&
  sudo install /tmp/docker-machine /usr/local/bin/docker-machine
Copy the code



  • Docker-machine after installation
docker-machine version
Copy the code



Install ali’s docker-machine third party

  • Installation steps
mkdir docker-machine
# Download and unzip Aliyun ECS driver
curl -L https://docker-machine-drivers.oss-cn-beijing.aliyuncs.com/docker-machine-driver-aliyunecs_linux-amd64.tgz > driver-aliyunecs.tgz && tar xzvf driver-aliyunecs.tgz -C docker-machine && rm driver-aliyunecs.tgz

mv docker-machine/bin/* /usr/local/bin

mv /usr/local/bin/docker-machine-driver-aliyunecs.linux-amd64 /usr/local/bin/docker-machine-driver-aliyunecs && chmod +x /usr/local/bin/docker-machine-driver-aliyunecs
Copy the code



  • Check whether the installation is successful
docker-machine create -d aliyunecs --help
Copy the code



Start the installation

Ali cloud account login console home.console.aliyun.com/new#/

  • Enabling Access Control












  • A new user















  • Be sure to delegate



  • The most important step is to ensure that your account has more than 100 money, this is very important ah, or Ali will not let you create docker-machine. Remember you’re only 110 bucks ahead of everyone else? 110 is peanuts in the face of opportunity.






  • The installation
docker-machine create -d aliyunecs --aliyunecs-io-optimized=optimized
 --aliyunecs-instance-type=ecs.c5.large
 --aliyunecs-access-key-id=XXXX
 --aliyunecs-access-key-secret=XXXX
 --aliyunecs-region=cn-qingdao
  liming
Copy the code
  • Install the results
docker-machine ls
Copy the code









docker-machine ssh liming
Copy the code



docker version
Copy the code



  • The local Docker Server was not started, so we directly connected to the Aliyun Docker Server



docker-machine env liming
eval $(docker-machine env liming)
Copy the code



  • If you do not want to connect to a remote Docker Server
docker-machine env --unset
eval $(docker-machine env --unset)
Copy the code



Money is not wind, remember to delete after understanding

docker-machine rm liming
Copy the code









Remember that there is an error in the process of installation error content input to: error-center.aliyun.com/status/sear… You can see the hint!




PS: This chapter mainly introduces the ecS of creating docker-machine on Ali Cloud, the advantage is that the machine is directly installed with docker tools, easy to use! Docker-version can be directly beautiful!

Past wonderful
  1. Docker Guide (1)
  2. Technical Overview of Containers (II)
  3. Docker’s charm first experience -5 minutes to install wordpress without taking a detour (3)
  4. Docker official website Introduction (4)
  5. How to install Docker on MAC
  6. How to install Docker on Windows
  7. How to Install a VIRTUAL Machine on a MAC through Vagrant (7)
  8. How to install a VIRTUAL machine from Vagrant on Windows
  9. Docker-machine local use (9)
  10. Docker-machine native Use (10)