Docker tools
Docker client applications, including the Docker CLI, can connect to the Triton remote API endpoint to launch and control Docker containers on bare metal across an entire Triton data center. Each data center is a single Triton Elastic Docker Host endpoint.
Quick start
There are just three steps to using Docker on Triton:
Quick start video
Watch a video to learn more about the Triton Docker Elastic Host and how to get started with the Triton Docker CLI tool.
Install Triton CLI
In order to interact with Docker and other containers on Triton, you must install the Triton CLI tool and set up Triton CLI profiles.
You can use Triton CLI profiles for different data centers and different users. You can switch between profiles by specifying the profile name, as in: triton env <profile name>
1.
If your Triton profile was created before Triton CLI version 4.9, you'll have to update it for Docker:
triton profile docker-setup <profile name>
Please see contact support if you encounter any difficulty.
Install Triton Docker CLI
Configuring Docker for Triton requires the Triton Docker CLI, which installs known good versions of the Docker and Docker Compose CLI tools for use with Triton. This script will automatically configure those tools for use with Triton when you use them, making it easy to switch between Docker on your laptop and Docker on Triton.
In a terminal window, run the following command:
sudo bash -c 'curl -o /usr/local/bin/triton-docker https://raw.githubusercontent.com/joyent/triton-docker-cli/master/triton-docker && chmod +x /usr/local/bin/triton-docker && ln -Fs /usr/local/bin/triton-docker /usr/local/bin/triton-compose && ln -Fs /usr/local/bin/triton-docker /usr/local/bin/triton-docker-install'
That command will copy the triton-docker
shell script from this repo, and link it as triton-compose
and triton-docker-install
.
To complete the installation, run:
sudo triton-docker-install
This will install the platform-specific versions of the Docker and Docker Compose CLI tools. These versions will not replace any existing Docker or Docker Compose versions you may have installed.
To test Docker, you can run triton-docker info
and see your account name in the output. We can see jill
, our example user, in SDCAccount: jill
here:
$ triton-docker info
Executing in 'us-sw-1' (via env var; use `eval "$(triton env <profile name>)"` to change) at 03:30:45 PM
Containers: 0
Images: 0
Storage Driver: sdc
SDCAccount: jill
Execution Driver: sdc-0.3.0
Logging Driver: json-file
Kernel Version: 3.12.0-1-amd64
Operating System: SmartDataCenter
CPUs: 0
Total Memory: 0 B
Name: us-sw-1
ID: 65698e31-2754-4e86-9d05-bfc881037812
You will need to install Docker to build and deploy images from your local environment. This should not be done on Triton or with triton-docker
.
Install Docker to build locally
The Docker application should be installed to build and deploy images from your local environment.
Work with Docker containers
Once triton-docker
has been installed, you'll be able to run containers on Triton. Get started:
Learn more ways to work with Docker containers on Triton.
CLI
It is possible to work directly with the docker
CLI tool on Triton. If you choose not to install triton-docker
, you can use docker
commands almost exactly as you would on your local machine (with a some exceptions).
However, some docker
commands will emit errors and certain newer features are not yet available on Triton. We advise you to use triton-docker
, which installs Docker version 1.12.6 and
Docker Compose 1.9.0, which have been tested with Triton.
Docker is an open source project and therefore can be released with bugs which will cause problems on Triton.
What next?
Please check out the Docker user guide and our blog posts to learn more about building infrastructure with Docker on Triton.
- How to Dockerize a simple application
- How to Dockerize an application with microservices
- Dynamic Nginx backends in Docker
- Running ASP.NET apps in Docker
- Deploy database clusters in Docker
- Comparing Triton containers to VMs and bare metal servers
-
If you have not installed
triton-docker
, then you should useeval "$(triton env <profile name>)"
to switch between Triton profiles. ↩