Using the Linode Docker Machine Driver
Installing the tools and plugin
The Linode Docker Machine driver creates a Linode instance as the target environment for Docker container management.
Docker will need to be installed. Docker for Mac, Docker for Windows, Docker Toolbox, or Docker CE can be used.
If your Docker installation doesn't include the
docker-machine command, you'll need to upgrade or install it from:
docker-machine in place, install the
docker-machine-driver-linode binary into your PATH from the binaries offered at:
Be sure to grab the appropriate binaries for your operating system. OSX and Linux builds are available.
Using the Linode Driver
With the binary in your path, the
docker-machine command will handle Linode provisioning:
docker-machine create -d linode --help
The only arguments that are required for provisioning are the Linode APIv4 Token and a label. In practice, you will want to avoid the defaults and choose the Linode Instance type, base image, and region that best suits your needs.
Provisioning a Linode
You will need to provide a Personal Access Token for Linode APIv4 (referred to below as
$ docker-machine create -d linode --linode-token $LINODE_TOKEN dockode Running pre-create checks... Creating machine... (dockode) Creating Linode machine instance... (dockode) Creating linode instance (dockode) Waiting for Machine Running... Waiting for machine to be running, this may take a few minutes... Detecting operating system of created instance... Waiting for SSH to be available... Detecting the provisioner... Provisioning with ubuntu(systemd)... Installing Docker... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Checking connection to Docker... Docker is up and running! To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env dockode
Interacting with the Docker Machine
The metadata being managed can be viewed with:
docker-machine inspect dockode
Take a look at
docker-machine -h for more examples of what can be done through this management interface.
Now that we have a Linode running Docker-CE managed by
docker-machine, we can target all of our
docker commands to run in that environment.
eval $(docker-machine env dockode)
The eval command ran the output of the
docker-machine env command, adding the following variables to the environment:
export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://18.104.22.168:2376" export DOCKER_CERT_PATH="/Users/username/.docker/machine/machines/dockode" export DOCKER_MACHINE_NAME="dockode"
With these variables in place, Docker will execute commands against Docker running from the Linode instance.
$ docker run -it alpine /bin/sh -c 'echo hello world' Unable to find image 'alpine:latest' locally latest: Pulling from library/alpine 6c40cc604d8e: Pull complete Digest: sha256:b3dbf31b77fd99d9c08f780ce6f5282aba076d70a513a8be859d8d3a4d0c92b8 Status: Downloaded newer image for alpine:latest hello world
See the official Docker Machine Getting Started guide for more information.
I followed your instructions and it built a new linode for the docker machine. How would I build a docker machine on an existing linode?
I tried to follow the download and make install the docker-machine-driver-linode on Ubuntu 20.04 server. But it is failed.
go get -d ./
go: downloading github.com/docker/machine v0.16.1
go: downloading golang.org/x/oauth2 v0.0.0-20190115181402-5dab4167f31c
go: downloading github.com/linode/linodego v0.9.0
go: downloading gopkg.in/resty.v1 v1.11.0
go: downloading golang.org/x/crypto v0.0.0-20190103213133-ff983b9c42bc
go: downloading github.com/docker/docker v1.13.1
go: downloading google.golang.org/appengine v1.4.0
go: downloading golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e
go: downloading github.com/golang/protobuf v1.2.0
go: downloading golang.org/x/sys v0.0.0-20190116161447-11f53e031339
go: finding module for package github.com/Azure/go-ansiterm/winterm
go: finding module for package github.com/Sirupsen/logrus
go: finding module for package github.com/Azure/go-ansiterm
go: downloading github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
go: downloading github.com/Sirupsen/logrus v1.7.0
go: found github.com/Azure/go-ansiterm/winterm in github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
go: found github.com/Azure/go-ansiterm in github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78
go: found github.com/Sirupsen/logrus in github.com/Sirupsen/logrus v1.7.0
go: github.com/linode/docker-machine-driver-linode imports
github.com/Sirupsen/logrus: github.com/Sirupsenemail@example.com: parsing go.mod:
module declares its path as: github.com/sirupsen/logrus
but was required as: github.com/Sirupsen/logrus
make: *** [Makefile:20: dep] Error 1
I have also download the binary of the docker-machine-driver-linode for MacBook Air. How can I install the plugin binary into my MacBook Air?