หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Running Docker Commands to Operate Images

Updated on 2025-01-03 GMT+08:00

Build on GUI

Add Run Docker Commands, when configuring build actions. Set the parameters according to Table 1.

Table 1 Parameters for running docker commands

Parameter

Description

Action Name

Assign a custom name to the build action. The name can contain:

  • Letters, digits, hyphens (-), underscores (_), commas (,), semicolons (;), colons (:), periods (.), slashes (/), and parentheses.
  • 1 to 128 characters.

Tool Version

Select a tool version that matches your current development environment.

For tool versions supported by CodeArts Build, see build tools and versions. If the current tools and versions do not meet your requirements, you can customize a build environment.

Commands

Click Add to add a command, and configure it as required. For details about the Docker commands supported by CodeArts Build, see Docker Commands Supported by CodeArts Build.

You can drag and drop the commands into the desired execution sequence.

Continue After Failure

Specify whether to proceed after the current action fails by setting the parameter to either Yes or No.

Build with Code

Modify the code in the BUILD block in Creating a YAML File for Your Code-based Build by referring to the following sample code:

1
2
3
4
5
6
7
8
version: 2.0 # The value must be 2.0.
steps:
  BUILD:
    - docker:
          inputs:
            command: |
              docker pull swr.xx-xxxxx-x.myxxcloud.com/codeci/dockerindocker:dockerindocker18.09-1.3.2
            ignore_fail: true
Table 2 Parameters in the sample code

Parameter

Type

Description

command

String

Each command takes up one line. For details about the supported Docker commands, see Docker Commands Supported by CodeArts Build.

ignore_fail

string

Whether to proceed after the current action fails.
  • true: Yes
  • Empty: No

Docker Commands Supported by CodeArts Build

  • docker login: Log in to the Docker repository.

    Usage: docker login [options] [server]

    The following table describes how to set options. server indicates the Docker repository address.

    Option

    Short Form

    Description

    --password

    -p

    Password for logging in to the repository.

    --username

    -u

    Username for logging in to the repository.

    --password

    -stdin

    Password obtained from stdin

    Example: docker login -u jack -p 12345 mydocker-registry.com

    In this example, user jack remotely logs in to the mydocker-registry.com repository using password 12345.

    Advanced Usage

    To read a password from the file, run cat ~/my_password.txt | docker login --username jack --password-stdin.

  • docker build: Build an image from a Dockerfile or context. The context can be a local path (Path) where the build is executed, a remote URL (such as a Git repository, tarball, or text file), or a hyphen (-).

    Usage: docker build [options] Path | URL | -

    The following table describes how to set options. Path/URL/- indicates the context source.

    Option

    Short Form

    Description

    --file

    -f

    Dockerfile path. The default value is ./Dockerfile.

    --tag

    -t

    In the format of "Image name:Tag"

    Example: docker build -t mydocker-registry.com/org/alpine:1.0 -f ./Dockerfile .

    In this example, this command uses the Dockerfile with the tag mydocker-registry.com/org/alpine:1.0 in the current directory to create an image.

  • docker push: Push an image to a specified registry.

    Usage: docker push [options] name[:tag]

    Example: docker push mydocker-registry.com/org/alpine:1.0

    In this example, this command pushes tag 1.0 of the mydocker-registry.com/org/alpine image to the remote repository.

  • docker pull: Pull an image from a registry.

    Usage: docker pull [options] name[:tag|@digest]

    The following table describes how to set options.

    Option

    Short Form

    Description

    --all-tags

    -a

    Download all tagged images.

    Example: docker pull mydocker-registry.com/org/alpine:1.0

    In this example, this command pulls the mydocker-registry.com/org/alpine image whose tag is 1.0 from the remote repository.

  • docker tag: Modify the tag of the image.

    Usage: docker tag source_image[:tag] target_image[:tag]

    source_image[:tag] indicates the image whose tag needs to be modified, and target_image[:tag] indicates the target image with a new tag.

    Example: docker tag mydocker-registry.com/org/alpine:1.0 mydocker-registry/neworg/alpine:2.0

    In this example, this command changes the tag of the mydocker-registry.com/org/alpine image from 1.0 to 2.0.

  • docker save: Save one or more images to a .tar file (streamed to the standard output by default).

    Usage: docker save [options] image [image...]

    The following table describes how to set options.

    Option

    Short Form

    Description

    --output

    -o

    Write to a file instead of using standard output.

    Example: docker save -o alpine.tar mydocker-registry.com/org/alpine:1.0 mydocker-registry.com/org/alpine:2.0

    In this example, this command packages the mydocker-registry.com/org/alpine:1.0 and mydocker-registry.com/org/alpine:2.0 images into alpine.tar.

  • docker logout: Log out of a Docker repository.

    Usage: docker logout [server]

    Example: docker logout mydocker-registry.com

    This example indicates that the image repository whose address is mydocker-registry.com is logged out.

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback