docker-machine is a utility that can automate the installation of Docker on a remote host. You can use docker-machine to easily deploy Docker to a virtual machine in the Rapid Access Cloud.
Setting up Machine on Your Workstation
- Download and Install a compatible version of docker from https://www.docker.com/
- Install the OpenStack command-line tools.
- Download an openrc file.
- Set the OS_TENANT_ID and OS_TENANT_NAME to the same values as OS_PROJECT_ID and OS_PROJECT_NAME
- Add export OS_DOMAIN_ID=default
Create a Security Group
Log in to the RAC Dashboard. Then, either create a new security group or add new values to the default security group to allow port 80 and port 2376:
Port 80 used by HTTP for our app
Port 2376 is used by docker application
Determine the favor and image you want to use
In a terminal, use the below commands to see the available flavors and images in RAC.
For the purpose of this tutorial, we will use an
m1.small flavor and the
Ubuntu 18.04 image.
Provisioning Docker host
Run the following command:
Once the machine is successfully created run below command to see if Instance is running.
And you should see output similar to the following:
After the host is provisioned , check the server environment with the following command:
Configuring and building the application image.
Run the below commands to create an application folder:
Create a file named
Copy below script into your
In the same application folder, create a file called
Verify the image exists:
Deploying containers to Docker host remotely
To deploy the application image to your Docker host, run:
Verify the container is running with the following command:
Type in the IP address of your instance (either a Floating IP address or your IPv6 address) in your web browser to see your container running:
You can also log in to your docker host directly by running: