tencent cloud

Tencent Kubernetes Engine

Release Notes and Announcements
Release Notes
Announcements
Release Notes
Product Introduction
Overview
Strengths
Architecture
Scenarios
Features
Concepts
Native Kubernetes Terms
Common High-Risk Operations
Regions and Availability Zones
Service Regions and Service Providers
Open Source Components
Purchase Guide
Purchase Instructions
Purchase a TKE General Cluster
Purchasing Native Nodes
Purchasing a Super Node
Getting Started
Beginner’s Guide
Quickly Creating a Standard Cluster
Examples
Container Application Deployment Check List
Cluster Configuration
General Cluster Overview
Cluster Management
Network Management
Storage Management
Node Management
GPU Resource Management
Remote Terminals
Application Configuration
Workload Management
Service and Configuration Management
Component and Application Management
Auto Scaling
Container Login Methods
Observability Configuration
Ops Observability
Cost Insights and Optimization
Scheduler Configuration
Scheduling Component Overview
Resource Utilization Optimization Scheduling
Business Priority Assurance Scheduling
QoS Awareness Scheduling
Security and Stability
TKE Security Group Settings
Identity Authentication and Authorization
Application Security
Multi-cluster Management
Planned Upgrade
Backup Center
Cloud Native Service Guide
Cloud Service for etcd
TMP
TKE Serverless Cluster Guide
TKE Registered Cluster Guide
Use Cases
Cluster
Serverless Cluster
Scheduling
Security
Service Deployment
Network
Release
Logs
Monitoring
OPS
Terraform
DevOps
Auto Scaling
Containerization
Microservice
Cost Management
Hybrid Cloud
AI
Troubleshooting
Disk Full
High Workload
Memory Fragmentation
Cluster DNS Troubleshooting
Cluster kube-proxy Troubleshooting
Cluster API Server Inaccessibility Troubleshooting
Service and Ingress Inaccessibility Troubleshooting
Common Service & Ingress Errors and Solutions
Engel Ingres appears in Connechtin Reverside
CLB Ingress Creation Error
Troubleshooting for Pod Network Inaccessibility
Pod Status Exception and Handling
Authorizing Tencent Cloud OPS Team for Troubleshooting
CLB Loopback
API Documentation
History
Introduction
API Category
Making API Requests
Elastic Cluster APIs
Resource Reserved Coupon APIs
Cluster APIs
Third-party Node APIs
Relevant APIs for Addon
Network APIs
Node APIs
Node Pool APIs
TKE Edge Cluster APIs
Cloud Native Monitoring APIs
Scaling group APIs
Super Node APIs
Other APIs
Data Types
Error Codes
TKE API 2022-05-01
FAQs
TKE General Cluster
TKE Serverless Cluster
About OPS
Hidden Danger Handling
About Services
Image Repositories
About Remote Terminals
Event FAQs
Resource Management
Service Agreement
TKE Service Level Agreement
TKE Serverless Service Level Agreement
Contact Us
Glossary

Parameter Adaptation for docker run

PDF
フォーカスモード
フォントサイズ
最終更新日: 2025-09-25 18:54:49
This document describes how to match parameters of docker run and the TKE console when you try to migrate a container that has been debugged in the local Docker to the TKE platform. The following section uses the creation of a simple GitLab service as an example.

Parameters of a GitLab Container

You can create a simple GitLab container by running the following docker run command:
docker run \\
-d \\
-p 20180:80 \\
-p 20122:22 \\
--restart always \\
-v /data/gitlab/config:/etc/gitlab \\
-v /data/var/log/gitlab:/var/log/gitlab \\
-v /data/gitlab/data:/var/opt/gitlab \\
--name gitlab \\
gitlab/gitlab-ce:8.16.7-ce.0
-d: indicates that the container runs at the backend. You do not need to specify this parameter in the TKE console because containers always run at the backend on the TKE platform.
-p: specifies port mapping. Two ports are mapped here, that is, container ports 80 and 22, which are mapped to open ports 20180 and 20122 respectively. To take these mappings into effect, you need to add two port mapping rules in the console and specify the corresponding container ports and service ports. As GitLab needs to allow access from the public network, select Via Internet as the access method.
--restart: specifies whether to restart the container when it exits. You do not need to specify this parameter in the TKE console because all containers created on the TKE platform will restart upon exit.
-v: specifies container volumes. In the preceding command, three volumes are specified. Accordingly, you need to add three data volumes in the TKE console and mount them to the container in Containers in the pod.To do this, create three volumes first, as shown in the following figure.

Mount the three volumes to the container in "Containers in the pod", as shown in the following figure.


Note that Use node path is selected as the data volume type. In this case, data generated during the running process of the container will be stored to the node where the container is located. If the container is scheduled to another node, the data will be lost. Alternatively, you can select Use Tencent Cloud CBS. In this case, the container data will be stored to the CBS instance and will not be lost even if the container is scheduled to other nodes.
--name: specifies the container name. This parameter corresponds to the service name in the TKE console. The container name and service name can be the same.

Other Parameters

The following describes other common parameters for executing the docker run command:
-i: specifies the interactive container execution mode. This parameter is not supported because the TKE console only allows containers to run at the backend.
-t: assigns virtual terminals. This parameter is not supported.
-e: specifies environment variables for container running. For example, you can run the following docker run command:
docker run -e FOO='foo' -e BAR='bar' --name=container_name container_image
Running this command adds two environment variables for the container. You can add environment variables for a container in advanced settings when creating a service in the TKE console. The names and values of the variables are as follows:
Variable: FOO, value: foo.
Variable: BAR, value: bar.

Command and Arguments

You can specify the command name and arguments of a container process in docker run. For example:
docker run --name=kubedns gcr.io/google_containers/kubedns-amd64:1.7 /kube-dns --domain=cluster.local. --dns-port=10053 -v 2
In this case, the command name of the container process is /kube-dns, and the arguments are --domain=cluster.local., --dns-port=10053, and -v 2. The following figure shows how to set these arguments in the TKE console.



ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック