Got it

Let’s run Containers on Huawei Cloud ECS – Step-by-Step procedure! Highlighted

Latest reply: Mar 2, 2022 19:30:27 1306 28 13 0 2

Dear Fellows,

 Do you know how to run Containers on ECS? and in how many ways? Don't worry! Today I am going to show how to run containers in different ways on the ECS (Elastic Cloud Server) of Huawei Cloud using Docker.  

Procedure

After deploying ECS on Huawei cloud the procedure is given in the link then we installed Docker and if want to know how Docker is installed, please refer my previous article (Docker on Huawei Cloud ECS for containerization - Huawei Enterprise Support Community)


01 – Pulling from Public Images

First way to run an app in container is to download image from public location (docker repository) and run container on ECS with downloaded images (premade one).

# docker run –d –p <port:destination por> name:version

# docker run -d -p 8080:80  httpd:v1.1

 

This binds port 8080 of the container to TCP port 80

032246p83k8qa8qa8lya29.png

After running container, lets check it by

# docker container ls

 

Also web page can be viewed on browser by putting ip and desired port

 

Output

032246abtdpxmwkyyzmsgv.png

After use resources should be deleted. Container is deleted using

# docker rm <CONTAINER ID> -f  -f for force if container is running

032247zne8id5fc73fc7s2.png


2 – Own Image downloading

Another way is to pull (download) image from your repository (or made by you), commands are same mostly.

1.       Pull image

2.       Run container with designated port so this app/web page should be separated


032248y43uaeu9afs29xbg.png


After running container, you may check it on console locally if it’s in working condition by

# curl 127.0.0.1:<port>


032249o2klnsf1qvjnlkr6.png

Output

Web page is visible at port 8500 on public IP

032250rl84qqy2iibjffln.png

 

03 – Building Locally

You can create app or webpage locally, then build its image and then run it in container as well (image can be pushed to remote repository , later can be downloaded and run as well)

Let’s start building

# mkdir dockerfile // make seprate directory

# cd dockerfile // go into specific directory

# touch dockerfile1 // Create file

# vim dockerfile1 // open & edit file


032251jjdrme2lih4vklp9.png


# cat dockerfile1 // View file after creating

Now build image locally first

# docker build –t <image:version> -f <filename>


032251svamd1ar3q1yyxfx.png

Run container using same command as described earlier

 

032252r1b7gr494jkbbbis.png

Ending Remark 

This is step by step tutorial was to demonstrate containerization of application on Huawei cloud using ECS but Huawei also have services named as Cloud Container Instance (CCI) is a serverless container engine that allows you to run containers without creating and managing servers or clusters.

CCI allows you to directly create and use containerized workloads using the console, kubectl, or Kubernetes APIs, and pay only for the resources consumed by these workloads.

The post is synchronized to: Author groupBAZ's Author Collection

  • x
  • convention:

BAZ
MVE Author Created Sep 3, 2021 19:38:09

The post is related to the webinar "Cloud-Native approach & Elastic Cloud Server - Huawei Cloud", You may Vote for the webinar https://forum.huawei.com/enterprise/en/webinar-on-cloud-native-approach-elastic-cloud-server-huawei-cloud-deep-dive-series-session-1-vote-now/thread/766765-100289


and if you want to Install & Run Docker on Huawei Cloud ECS for containerization
https://forum.huawei.com/enterprise/en/docker-on-huawei-cloud-ecs-for-containerization/thread/769809-893


View more
  • x
  • convention:

BAZ
MVE Author Created Sep 3, 2021 19:38:09

The post is related to the webinar "Cloud-Native approach & Elastic Cloud Server - Huawei Cloud", You may Vote for the webinar https://forum.huawei.com/enterprise/en/webinar-on-cloud-native-approach-elastic-cloud-server-huawei-cloud-deep-dive-series-session-1-vote-now/thread/766765-100289


and if you want to Install & Run Docker on Huawei Cloud ECS for containerization
https://forum.huawei.com/enterprise/en/docker-on-huawei-cloud-ecs-for-containerization/thread/769809-893


View more
  • x
  • convention:

faysalji
Author Created Sep 3, 2021 19:55:17

Thank You @BAZ for sharing the procedure with screenshots Let’s run Containers on Huawei Cloud ECS – Step-by-Step procedure!-4119001-1
View more
  • x
  • convention:

BAZ
BAZ Created Sep 3, 2021 20:59:58 (0) (0)
Glad to hear.
Visuals are good idea to show step by step demonstration  
andersoncf1
MVE Author Created Sep 3, 2021 19:57:34

Well done dear BAZ. Congrats!!!
View more
  • x
  • convention:

AliBinHussain
AliBinHussain Created Sep 22, 2021 18:26:19 (0) (0)
 
Saqib123
Created Sep 3, 2021 20:02:32

Let’s run Containers on Huawei Cloud ECS – Step-by-Step procedure!-4119007-1
View more
  • x
  • convention:

AliBinHussain
AliBinHussain Created Sep 22, 2021 18:26:25 (0) (0)
 
Unicef
MVE Created Sep 4, 2021 06:31:04

Good post
View more
  • x
  • convention:

MahMush
Author Created Sep 4, 2021 07:34:42

Containerization defined in best possible way, Thumbs up to author @BAZ
Recommending for HIGHLIGHT post @olive.zhao
View more
  • x
  • convention:

BAZ
BAZ Created Sep 4, 2021 08:35:07 (0) (0)
Really appreciate your support and encouragement  
Vlada85
MVE Author Created Sep 4, 2021 16:11:46

Thank you! Let’s run Containers on Huawei Cloud ECS – Step-by-Step procedure!-4119669-1
View more
  • x
  • convention:

BAZ
BAZ Created Sep 5, 2021 19:01:03 (0) (0)
Welcome friend  
GhaziAsad
Created Sep 4, 2021 16:24:54

Good
View more
  • x
  • convention:

GhaziAsad
Created Sep 4, 2021 16:25:03

Thanks for sharing
View more
  • x
  • convention:

BAZ
BAZ Created Sep 4, 2021 17:05:36 (0) (0)
Welcome.. Learning together  
12
Back to list

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.