Using the Skytap driver for Docker Machine
Docker Machine is a powerful tool that remotely provisions and manages Docker hosts. The Skytap driver for Docker Machine extends Docker Machine by providing native support for creating and managing Docker hosts running in Skytap.
In this guide, you’ll:
- Install Skytap driver for Docker Machine on a local machine.
- Use Skytap driver for Docker Machine to create Docker hosts from a VM template in Skytap.
- Use Skytap driver for Docker Machine to manage Docker hosts running in Skytap.
For more information about Docker Machine, visit https://docs.docker.com/machine/overview/.
Contents
Requirements
To use the Skytap driver for Docker Machine, you need:
- Docker Machine installed on a local computer. For instructions, see: https://docs.docker.com/machine/install-machine/.
-
Your Skytap Login name and API security token.
To find your Skytap Login name and API security token, see Finding your username and API security token.
-
A VPN in Skytap and its ID number. Skytap driver for Docker Machine uses a VPN connection to communicate between the local computer network and Skytap remote hosts running in Skytap. To locate your VPN ID, see To Find the ID for a Private Network.
If you do not have a VPN in Skytap, work with your administrator to create one.
Install the Skytap driver for Docker Machine
To install the driver
- Download the Skytap driver for Docker Machine here: https://github.com/skytap/docker-machine-driver-skytap/releases.
- Follow the installation instructions on that page for your operating system.
Use Skytap driver for Docker Machine to create Docker hosts
After you’ve installed the Skytap driver for Docker Machine, you can begin using the driver to create Docker hosts in Skytap.
In this example, we’ll create a new Docker host from a pre-configured VM in the Skytap public template library.
To create a new Docker host in Skytap
-
Run the command
docker-machine create -d skytap
and include the five variables listed below.--skytap-user-id
Your Skytap user ID.
--skytap-api-security-token
Your API security token.
--skytap-vm-id
ID of a VM in a Skytap template or environment. Docker Machine creates a copy of this VM and automatically connects to it.
Below are VM IDs for pre-configured VMs in the Skytap public library. To use one of these, enter the VM ID in the same region as the Skytap VPN.
Region VM ID APAC 9646824 AUS-Sydney 9646822 CAN-Toronto 9646818 EMEA 9646812 US-Central 9646782 US-East 9646778 US-East-2 33274434 US-West 9646772 --skytap-vpn-id
VPN ID to connect to the environment.
<docker-host-name>
Name for the new Docker host.
For example:
skytap-machine01
Example command using command line flags
docker-machine create -d skytap \
--skytap-api-security-token 73bc**************** \
--skytap-user-id jane***doe*** \
--skytap-vm-id 9646772 \
--skytap-vpn-id vpn-12345 \
skytap-machine01
These can also be entered in a single command line:
docker-machine create --driver skytap --skytap-user-id jane***doe*** --skytap-api-security-token 73bc**************** --skytap-vm-id 9646772 --skytap-vpn-id vpn-12345 skytap-machine01
To use environment variables instead, see Using environment variables instead of command line flags.
For information about additional command line flags you can include, see Docker create command line flags, environment variables, and default values.
Use Skytap driver for Docker Machine to manage Docker hosts running in Skytap
Once you’ve created Docker hosts in Skytap, you can manage them using Skytap driver for Docker Machine.
The Skytap driver for Docker Machine supports all Docker Machine commands.
For example, to see a list of all hosts (including Skytap-based hosts), enter:
docker-machine ls
Additional information
Docker create command line flags, environment variables, and default values
These flags are available only during the create
process.
Docker CLI flag
Environment variable
Description
--skytap-api-logging-level
-
The logging level to use when running API commands.
info | Default level provides basic information. |
debug | Provides detailed information on each REST API call. |
warn | Outputs warning messages. |
error | Outputs error messages. |
If left undefined, the default is info
.
--skytap-api-security-token
SKYTAP_API_SECURITY_TOKEN
Your API security token.
--skytap-container-host
SKYTAP_CONTAINER_HOST
Configures the VM as a container host.
--skytap-env-id
SKYTAP_ENV_ID
ID for the environment to add the VM to.
Leave blank to make a new environment.
--skytap-ssh-key
SKYTAP_SSH_KEY
The SSH private key path.
If left undefined, identities in ssh-agent are used.
--skytap-ssh-port
SKYTAP_SSH_PORT
The SSH port.
If left undefined, the default is 22
.
--skytap-ssh-user
The SSH user.
If left undefined, the default is docker
.
--skytap-user-id
SKYTAP_USER_ID
Your Skytap user ID.
--skytap-vm-cpus
SKYTAP_VM_CPUS
The number of CPUs for the VM. The default is what’s configured for the source VM.
For more information about CPUs and CPUs per socket, see Hardware Settings, CPU.
--skytap-vm-cpuspersocket
SKYTAP_VM_CPUSPERSOCKET
The number of CPU cores in each virtual socket. The default is what’s configured for the source VM.
If you specify the number of CPUs per socket you must also specify the number of CPUs. If you specify the number of CPUs but don’t specify the number of CPUs per socket, each CPU core is allocated to a single virtual socket. The number of CPU cores per socket must be uniformly distributed across the number of sockets (for example, if you have 12 CPUs, the cores per socket must be 1, 2, 3, 4, or 6).
--skytap-vm-id
SKYTAP_VM_ID
ID for the VM template to use.
--skytap-vm-ram
SKYTAP_VM_RAM
The amount of RAM in megabytes. The default is what’s configured for the source VM. For more information about virtual RAM, see CPUs and RAM.
--skytap-vpn-id
SKYTAP_VPN_ID
Private Network ID to connect to the environment.
Using environment variables instead of command line flags
If you prefer not to expose sensitive information, such as your API security token, in a plain text script or command line, you can create environment variables on your local machine.
$ export SKYTAP_USER_ID=jane***doe***
$ export SKYTAP_API_SECURITY_TOKEN=73bc****************
$ docker-machine create --driver skytap {other flags} skytap-machine01
Adjusting VM hardware settings
By default the new Docker host inherits the CPU and memory settings from the source VM. You can override these settings and configure them during the create
process. See Docker create command line flags, environment variables, and default values.
VM SSH User credentials
The Docker host templates in the Skytap public template library already contain SSH user credentials. The driver defaults to the SSH user name docker
. To use a different SSH user, in a command line, use --skytap-ssh-user <sshusername>
. The driver retrieves the password for the SSH user from the VM metadata.
Troubleshooting
You can add -D
to any of the Docker Machine commands to run the driver in debug mode and specify a logging level for the Skytap REST API calls, using --skytap=api-logging-level
during the create
process. See Docker create command line flags, environment variables, and default values.