跳至主要内容

Deploy Your First Application

Deploy an application to the edge device you connected in Onboard Your Device. This walkthrough uses a small nginx web server, saved as Stack nginx, on ARK-2252-cc827fdd1713. The screenshots show its initial revision progressing from Deploying to Running.

Before you begin, check the following:

  • Device: The device from Onboard Your Device is Activated and Connected.
  • WEDA Node: WEDA Node is running on that device.
  • Organization: Use the same organization for the device, stack and deployment.

Download the sample Compose file, create a Stack, deploy it and verify the result:

The device pulls application images from the container registry. WEDA Cloud coordinates deployment and receives the device's reported status.

Prepare Your Container and Compose File​

Open the sample docker-compose.yml, or download docker-compose.yml for upload to WEDA Console. The complete file is:

services:
web:
image: nginx:1.27-alpine
ports:
- "8080:80"
restart: unless-stopped

This sample runs one web service and publishes the device's port 8080 to the container's port 80. It does not require Stack environment variables, a separate .env file, host configuration files or models. Confirm that port 8080 is available and that the device can reach Docker Hub to pull the image.

For a different application, choose an image that supports your device's CPU architecture, hardware and runtime requirements. A Ready-to-use application from Advantech Container Catalog (ACC) may provide a Compose file through its Advantech Container Github Repository link. Follow that application's preparation instructions, including any required environment values, host files or hardware access. You can also publish your own image to a registry reachable by the device and prepare its Compose file.

Note: Ready-to-develop projects

A Ready-to-develop project from ACC must be built before deployment. Complete its development and build instructions to produce the application image you intend to run.

Before continuing, have these items ready:

  • Application image: The image name and tag for the application you will run.
  • Compose file: The service definitions and settings required by the application.
  • Registry information: For images in a private registry, the registry URL and type, plus the credentials required to pull its images.
  • Application settings: Values for required environment variables and any ports, files or hardware access described by the application's instructions.

Add a Container Registry​

Note: Check access for every application image

If all images in your Compose file permit anonymous pulls, continue to Create a Container Stack. If any image requires authentication, configure its registry access using the optional steps below.

Configure access for images that require registry authentication

A registry configuration provides the registry address and credentials needed to pull private images. If a suitable configuration already exists in this organization, check its registry address and access details before reusing it. To create a configuration, follow these steps:

  1. In WEDA Console, select the organization containing your target device and open Registries.

  2. Select Add.

  3. In Basic information, enter:

    • Registry Name: Up to 32 characters, unique within the organization.
    • Registry URL
    • Registry Type
  4. Fill in the Credentials required by that registry type:

    • Docker Hub: Username and access token.
    • Azure ACR: Username and password.
    • AWS ECR: Provide the region, access key and secret key together for authentication, or leave all three empty for anonymous access.
    • Custom registry: Username and password together, only if the registry requires authentication.
  5. Select Submit, then Add in the confirmation dialog.

Check the result: The registry configuration appears in the selected organization's list.

Create a Container Stack​

A container stack has two related concepts:

  • Stack Configuration: A named application definition based on a Docker Compose file.
  • Stack Revision: A particular version of that definition.

Creating a stack establishes its initial revision, which provides the application definition for your first deployment.

  1. Open Container Stacks in the left navigation and select Add.
Container Stacks list in TestOrg with an Add entry before the first Stack is created.
Select Add to create the Stack for your application.
  1. Enter Stack name nginx, or another name that is not already used by an existing Stack. A duplicate name is rejected. To publish a new version of an existing Stack, edit that Stack instead. Follow these naming rules:

    • Use lowercase letters, digits and hyphens only.
    • Use no more than 63 characters.
    • Do not start or end with a hyphen, or use consecutive hyphens.
  2. Select Compose as the type. For this example, enter description nginx-example.

  3. Upload the downloaded docker-compose.yml.

Add Container Stack with name nginx, Compose type, description nginx-example and uploaded docker-compose.yml.
The nginx example is ready to submit. No Environment variables are needed for this file.
  1. Leave Environment variables empty for this sample. For another Compose file that references ${VARIABLE_NAME}, supply the required values here.
  2. Select Submit, then Add in the confirmation dialog.
Add Stack confirmation dialog with Cancel and Add buttons.
Select Add to save the Stack definition.

Check the result: The stack appears as nginx (v1) in the list. Saving this definition is separate from deploying it to a device.

Deploy the Stack to Your Device​

  1. In Container Stacks, find nginx (v1) and select its Deploy action.
  2. In the Device list, select your target WEDA Node. The screenshot selects ARK-2252-cc827fdd1713, which is Activated and Connected. Confirm that the page heading identifies nginx(v1).
Deploy nginx v1 to devices with ARK-2252-cc827fdd1713 selected, Activated and Connected.
The Stack revision is already selected. Choose the device that should run it.
  1. Select Submit, then Deploy in the confirmation dialog.
Deploy to selected devices confirmation dialog with Cancel and Deploy buttons.
Select Deploy to submit the selected revision to the device.
Expanded nginx v1 Stack showing ARK-2252-cc827fdd1713 as Deploying, with Deploying count one and Running count zero.
Deploying indicates work in progress. It does not confirm that the application is running.

Check the result: Track the deployment status reported for the selected device. Keep the device connected while deployment proceeds.

Verify Deployment and Runtime Status​

Check the device's deployment result and its container runtime states after submission.

Expanded nginx v1 Stack showing ARK-2252-cc827fdd1713 as Running, with Running count one and Deploying count zero.
The nginx deployment now reports Running on the selected device.
  1. Confirm that you are viewing the intended stack and target device in WEDA Console.

  2. Inspect the reported deployment status and any error information.

  3. Confirm that the application's required containers reach their intended runtime state:

    • Long-running service: Check that its required containers are running.
    • One-shot task: Inspect its completion result.
  4. Open http://DEVICE_IP:8080 in a browser, replacing DEVICE_IP with your WEDA Node's reachable IP address. The nginx sample should display its default welcome page. The Console screenshot confirms Running; this browser check verifies that the web service is reachable.

Default nginx web page displaying Welcome to nginx and confirming that the web server is installed and working.
The example web server returns the default Welcome to nginx page. Verify this application response as well as the Running status in Console.

Check the result: Complete this walkthrough only after the expected services are running, or the intended task has completed, and you have checked the application's result.

Note: Verify the application result

A running container confirms that its process is up. Use the application's output or interface to check that it is working as intended.

If deployment or startup fails, begin with the reported error:

Expanded smartintersectionanalytics Stack showing an Error result for ARK-2252-cc827fdd1713, with the Error count at one.
Separate failure example: Smart Intersection Analytics reports Error. This is not the nginx deployment shown above. Inspect the deployment reason and logs rather than diagnosing from the badge alone.
SymptomWhat to check
Images cannot be pulledImage names and tags, registry address, credentials, and network access from the device.
Deployment fails during startupCompose settings, image compatibility with the device, port conflicts, and required files or hardware.
Containers exit or keep restartingThe reported container error and the application's own configuration and logs.
The application cannot be reachedIts documented endpoint, published ports, network access and application readiness.

Continue with Feature Guides: Container Management for ongoing updates and container operations.