Building and Uploading an Image

This section describes how to build an entire application into a Docker image. After building an image, you can use the image to deploy and upgrade the application. This reduces manual configuration and improves efficiency.

When building an image, ensure that files used to build the image are stored in the same directory.

Required Cloud Services

SoftWare Repository for Container (SWR) provides easy, secure, and reliable management over container images throughout their lifecycle, facilitating the deployment of containerized services.

Basic Concepts

Procedure

  1. Log in as the root user to the device running Docker.
  2. Enter the apptest directory.

    cd apptest

    ll

    Ensure that files used to build the image are stored in the same directory.

  3. Build an image.

    docker build -t apptest .

  4. Upload the image to SWR. For details, see Uploading an Image Through the Client.