We use cookies to help us improve our webpage. Please read our Cookie Policy .

NAS 145

Introducing Portainer

Use Portainer to pull images and deploy containers in ASUSTOR NAS

2022-07-12

COURSE OBJECTIVES

Upon completion of this course you should be able to:

  1. Use Portainer to pull images in Docker.
  2. Use Portainer to deploy containers in Docker.

PREREQUISITES

Course Prerequisites:
N/A

Students are expected to have a working knowledge of:
Docker / Image / Container


OUTLINE





1. Introducing Portainer

Docker does not have a GUI. To use Docker, an understanding of Docker's commands or refer to documentation to download, install and deploy images. Portainer is a powerful Docker management tool. Throughout the web interface, Portainer makes management of Docker apps and images more convenient for those not familiar with Docker commands, making it easier to use. Thousands of images from developers in Docker Hub can be easily deployed through Portainer. Portainer has a user-friendly interface that does not require typing commands into a command line interface. Simply download and deploy. Since Portainer is easy to use, apps can be directly and easily updated to the latest version while retaining the same settings. Portainer ensures that the possibilities on your ASUSTOR NAS are virtually limitless.



1.1 Installing Portainer


STEP 1

  • Using a web browser, log in to ADM using an account with administrator rights.
  • Select [ASUSTOR Apps] within App Central.
  • Click [Portainer CE] and press Install.


System requirements: AS31, 32, 40, 50, 51, 52, 53, 61, 62, 63, 64, 70, Drivestor, Drivestor Pro, Lockerstor, Lockerstor Gen2 and Lockerstor Pro.


STEP 2

  • App Central will install Docker-ce first if not installed, and then install Portainer CE.
  • Locate Portainer CE on the desktop and click on it to open Portainer.
  • Please create a new administrator account in Portainer.




2. Managing a Local Docker environment

Set up a local Docker environment and initialize Portainer.

  • Select [Get Started].


  • Select Local in [Environments] settings of Portainer.
  • Within Environment details, key in the NAS IP as Public IP, click on [Update environment].




3. Pull Images of Docker

3.1 Search image path in dockerhub

Portainer will pull Docker images from dockerhub. Images with the same function or name may have different versions uploaded by different developers. To get the correct Docker image, please search the image name in dockerhub first.

  • For example, searching wordpress in dockerhub will bring up several results and the most popular version will be listed first. Click on the desired item to open the details page.


  • Find the image path on the Docker Pull Command field.



3.2 Pull Images


STEP 1

  • Log in to Portainer, select an Environment.


STEP 2

  • Click Images.


STEP 3

  • Set an image name in dockerhub from the pull image page, click pull the Image.
  • Portainer will download the image with latest tag. To download other tags of images, please follow the instructions in dockerhub.


  • The time required to pull an image will vary.


  • Completed downloads will be tagged as unused if image has not yet been deployed.




4. Deploying Containers

Containers can be deployed once an image has been downloaded. Once the container is successfully deployed, it can be used normally.


STEP 1

  • Click Containers.
  • Click Add container.


STEP 2

  • Set a name and an image of the Container.
  • [Publish all exposed network ports to random host ports] is recommended to be enabled.
  • Click Deploy the container.


STEP 3

  • Deployed containers will be automatically started. All deployed containers will be listed in the Container list and can be run.
  • The web UI can then be launched from deployed containers in a new browser tab.


Using Wordpress as an example, click on Published Ports in the list and Portainer will launch the Wordpress web UI in a new browser tab.
Note: Please refer to Managing a Local Docker Environment to setup Public IPs if IP is set to 0.





5. Remotely Access Deployed Containers

Ensure that that remote access is enabled before continuing. Please refer to NAS 221: Remote Access - Using EZ-Connect and NAS 224: Remote Access - Manual Connect.

Due to the web browser's improved security level, HTTPS remote connections are only allowed to web pages using DDNS URLs. The containers that do not support HTTPS connection and cannot import the ADM HTTPS certificate will not be supported for HTTPS remote connection to this container. Please refer to NAS 325: Introducing Reverse Proxies to try using ADM reverse proxy server for setting up the container remote HTTPS connection.

Portainer CE applied HTTPS connection by default after version 2.9.2, and it will automatically import the ADM certificate. After the ADM certificate is updated, if Portainer CE cannot be connected by the certificate is invalid or expired, please disable Portainer CE in App Central and re-enable it to import the updated ADM certificate.





6. Upgrade image and update Container

When the Docker image is updated to new version on Docker Hub, the latest version will also be updated. With the Container deployed by the latest version of the image, please refer to the followings steps to upgrade as the latest version of the image in Portainer.


STEP 1

  • Using Nextcloud as an example, select Nextcloud under Containers and stop it.


STEP 2

  • Click Nextcloud to update it.
  • Click on Recreate.


STEP 3

  • Enable [Pull latest image] and then click on Recreate.


  • The time required to recreate a container will vary.


STEP 4

  • The image used by Nextcloud is updated after recreate the container.
  • Click on Start to start the container.


STEP 5

  • The time required to complete the startup of the container will vary. Please wait for a while or click on Log to check if the container has been updated and successfully started.


STEP 6

  • Finally, remove from Images.

Note: If there is no image with tag [none] listed, indicating that this image file is the latest one and does not need to be updated.

Was this article helpful? Yes / No