Installing the Docker Application
To install the Docker app, visit the TOS App Center, locate the Docker app, and then click “Install”.
How to Create a Container
At the outset, you’ll need to double-click the Docker app to open it. Then, click the “Registry” option. To make it easier for you to find an image, TerraMaster integrates Docker Hub with Docker. Docker Hub is the largest repository of Docker image files, and image files in Docker Hub are customized and uploaded by other developers.
To continue creating your container, follow the steps listed below:
1. Use the search bar to enter the image file keyword you want to find, and then click “Search”.
4. Select the downloaded image file in the “Image” option, and then click “Launch”.
5. Use the pop-up menu to name the container, and then complete the settings in the “Settings” menu. Please note that container names must be unique (i.e., don’t use the same name for two containers). When the setup is completed, click “Apply”.
6. After successful launch, containers will appear in the “Container” option.
7. Click "Details" in the "Container" option, and on the “Details” page, you can view information such as the container's health, ports, volumes, networks, and more. You may need this information when you are using containers.
- Before you create a container, it is always recommended that you read the information page for the image file. This is because when creating the container, you are likely to need some of this information.
EXAMPLE: How to Build an Apache HTTP Web Server
1. Click the "Registry" option, and then enter the keyword "apache" into the search bar. Click "Search."
Here, we’ll provide an outline of Docker’s setup items and their features.
From the overview menu, you can view the CPU and memory usage of the containers running in Docker. You can also view the health status of the running containers.
The registry provides a large number of image file libraries -- Docker Hub, where you can find the image files you need and download them.
To Download Image Files:
1. Enter the name or keyword of the image file in the search bar, and then click "Search";
2. In the search results, select the image file name you want, and then click "Download";
3. If you need to view information about the image file provided by the developer, click the arrow icon located at the right side of the image file name.
The image options show the downloaded image files and the image file size. You can manage your image files here.
To Launch an Image File:
1. Select the image file you want to launch;
2. Click “Launch”;
3. Set up the container and click "Apply".
How Do I Set Up a Container?
In the general settings, you can set the following:
- Container Name: You can customize the name of the container. Please note that container names must be unique (i.e., don’t use the same name for two containers).
- Resource Limit: Enable this option if you need to limit container possession of CPU and memory resources.
- Automatic Restart: Enable this option if you want the container to restart automatically when an exception occurs.
In the volume options, you can make the following settings:
- Add or remove files or folders: Files or folders, located in the TNAS storage space, are used to store container data;
- Configure the loading path of the container for the file or folder;
- Select whether you want to assign read-only permissions to certain files or folders.
This option is used to configure the network of containers. The Docker app provides containers with two network configuration options by default: Bridge and Host. Containers on the same network can communicate with each other.
Bridge: Bridging network, independent network segment;
Host: The same network segment as the Docker’s host.
You can add or remove network ports for containers.
You can create links between different containers, and also add or remove links for containers.
You can add or remove environment variables for a container.
To Import an Image File:
1. Click “Import”;
2. Select the image file from the storage directory in the pop-up menu, and then click "Apply".
To Export an Image File:
1. Select the image file you want to export from the “Image” menu, and then click "Export";
2.Select the storage directory for the image file in the pop-up menu, and then click "Apply".
To Delete an Image File:
1. Select the image file you want to delete from the “Image” menu;
2. Click “Delete”.
You can use the container options to view the operation of the containers and manage them.
To find out about the details associated with a certain container, select the container and click “Details”. Using the menu, you can access the following information:
1. Overview: Displays the health of the container, CPU and memory usage, and the container configuration;
2. Process: Displays the task process for the container;
3. Log: Displays the logs run by the container.
If you want to edit a container, select the name of the container, and then click “Edit”. Please note that before editing the container, you need to stop it from running.
The Following Operations Can Also Be Performed:
- Start a container;
- Stop a running container;
- Restart a container;
- Delete a container.