How to start a Docker Image Container on Kyup
How to start a Docker Image Container on Kyup
The Kyup hosting infrastructure allows you to deploy Linux containers from Docker images. In this tutorial we’ll provide instructions on how to launch a Kyup Linux container using Docker images either from the official Docker hub or from your own Docker repository.
Start a New Container
Once you access your account, click on the LAUNCH CONTAINER button on the left menu in your Kyup dashboard.
A new page will be loaded and it will allow you to take advantage of our Docker integration. However, before you select the exact Docker image you would like to use you have to select a name for the container and also set a root password for it.
Enter Container Name and Password
First, you need to choose a name for your new Docker container, password and data center. Select a descriptive Name for your container so you can distinguish it from the others you may create later. The Country drop-down, allows you to select a data center for your new server. Finally, type in or auto-generate a strong root Password that will be used to access your new container.
Once you type a name for your container and you set a root password you can add the resources you need (CPU, RAM, storage) to your container. The next step is to find your Docker image and start the container.
Use the Official Docker Hub Registry
As we mentioned the Kyup hosting infrastructure allows you to use the official Docker Hub to pull images and start containers using them. Follow the steps below in order to access the Docker hub and search for a container.
Access the Official Docker Hub Registry
Click on Applications and choose the DOCKER option:
The official Docker hub registry is selected by default. This allows you to directly search the available images.
Search For a Specific Image
Once you click on the DOCKER option you’ll see the following interface:
The “Search term” field allows you to search all available Docker images and select one of them to start a new server. Let’s say that we would like to start a new Docker MySQL container. Then we can search for “mysql” and the interface will display a list of all the images that match our criteria. The list will be similar to this one:
As you can see the official image is always listed on top of the list.
Pull an Image, Select a Tag and Set Environment Variables
To use a certain image just click on the “PULL” button. The system will need some time to pull the image and then you will see the following information on your end.
The “Select Tag” drop-down menu allows you to select a certain version of the image you would like to use. For example, if it is the MySQL image then you can select version 5.5, 5.6 of 5.7 of MySQL. Once you do this you can set additional environment variables in order to start a custom MySQL server. To check the variables available for a certain image click on the “Docker Hub” link. You will see the following page on your end:
To check the details for the official MySQL image click on the “Details” button. Some of the environment variables for the Docker MySQL image are:
MYSQL_ROOT_PASSWORD - This variable is mandatory and specifies the password that will be set for the MySQL root superuser account.
MYSQL_DATABASE - This variable is optional and allows you to specify the name of a database to be created on image startup.
Once you decide which variables you would like to set you can do this from the Kyup interface. Just add the variable name to the list of variables as set a value:
Once you are ready adding variables just click the “Launch Container” button and your Linux container will be deployed on our hosting infrastructure. The Docker image will be downloaded in the background and configured on the container. Usually, this process takes up to several minutes. After that you can simply access the container via SSH.
Use a Private Docker Registry
The Kyup Docker integration also allows you to pull images from a private Docker registry. Please note that at this point our Docker integration supports only version 1 of the Docker Registry API.
Follow the steps below in order to access your private registry and pull your images.
Set the Connection Details for Your Private Docker Registry
In order to connect to your private Docker registry you need to select the “Private repository” radio button.
Once you do this you have to fill in the following information:
The URL to your Docker repo could be an IP address or a domain name. The interface also accepts a port numbers to be specified in the URL. If your Docker registry doesn’t require authentication then simply leave the username and password fields empty.
Pull an Image From Your Private Docker Registry
Once you type the details for your private docker registry simply search for your image. A list of results taken from your private registry will be displayed in the interface.
To launch a new container using your custom images just pull the image the same way we pulled the image from the official Docker Hub. Then set the environment variables that are needed and click the “Launch Container” button. The container will be launched and a background process on the container will download the image and run it. Usually an image is extracted and configured for a couple of minutes.