Deploying Container Images
This page describes how to deploy container images to a new Cloud Hosting service or a new version of an existing Cloud Hosting service.
Supported Container Image Registries
You can directly use images stored in the following container image registries:
Tencent Cloud Container Registry (Tencent Cloud Container Registry, TCR)
- Provide stable and efficient image hosting services.
- Support private and public image registries.
- Access address: Tencent Cloud Container Registry.
Docker Hub
- The world's largest public container image registry.
- Provide rich open source image resources.
- Access address: Docker Hub.
You can also use container image registry services provided by other vendors. We recommend prioritizing Tencent Cloud Container Registry for better localized support. (Note: Currently only public cloud images are supported. Image registry login and registration features are under active development and will be available soon.)
Creating an Image Registry
Go to Tencent Cloud Container Registry. If you are using it for the first time, you can create a personal instance which is free of charge.
Navigate to the Namespace page and create a new namespace, for example, my-project
.
Go to the Image Registry page, create a new image repository, enter the service name (e.g., gintest
), select Public
as the type, choose the previously created my-project
namespace, and click Create to complete.
Click the image name you just created, then click Quick Command in the Operation
column, and follow the instructions to complete the image upload.
Get the Image Download Address
Get the Image Address from Tencent Cloud Container Registry (TCR)
- Log in to the Tencent Cloud console
- Access Tencent Cloud Container Registry and log in to your account.
- Go to the Target Image Repository
- In the console, select the target image repository and click to enter its details page.
- Find the Image
- In the image list, locate the desired image and its version tag.
- Copy the Pull Command
- Click the image name to enter the details page, then copy the displayed pull command (e.g.,
docker pull ccr.ccs.tencentyun.com/namespace/repository:tag
).
- Click the image name to enter the details page, then copy the displayed pull command (e.g.,
Get the Image Address from Docker Hub
- Access Docker Hub
- Open Docker Hub and search for the desired image.
- Select the Image Version
- In the image details page, switch to the
Tags
tab and select the desired version tag.
- In the image details page, switch to the
- Copy the Pull Command
- The page will display the pull command (e.g.,
docker pull repository:tag
); simply copy it.
- The page will display the pull command (e.g.,
Example: Get the nginx image
Get the nginx image from Tencent Cloud Container Registry (TCR)
- Log in to the Tencent Cloud console
- Access Tencent Cloud Container Registry and log in to your account.
- Search for the nginx image
- In the image repository, search for
nginx
and select the official or custom nginx image.
- In the image repository, search for
- Copy the Pull Command
- Click the image name to enter the details page, then copy the displayed pull command (e.g.,
docker pull ccr.ccs.tencentyun.com/namespace/nginx:latest
).
- Click the image name to enter the details page, then copy the displayed pull command (e.g.,
- Pull the Image
- Run the copied command in your local terminal to complete the image pull.
Get the nginx image from Docker Hub
- Access Docker Hub
- Open Docker Hub and search for
nginx
.
- Open Docker Hub and search for
- Select the Official Image
- In the search results, select the
nginx
official image.
- In the search results, select the
- Copy the Pull Command
- The page will display the pull command (e.g.,
docker pull nginx:latest
), which can be directly copied.
- The page will display the pull command (e.g.,
- Pull the Image
- Run the copied command in your local terminal to complete the image pull.
Deploy New Service
Preparation:
- Container image download address: The segment after
docker pull
in the image download address obtained in the previous step is the download address, i.e., (ccr.ccs.tencentyun.com/namespace/repository:tag
, therepository:tag
part).
The first revision is created when you first deploy to the service. Note that revisions are immutable.
To deploy the container, perform the following operations:
- In the image address field, enter the specified
container image download address
, and provide the service name and port.
- In the image address field, enter the specified
- Click Create and wait for the deployment to complete.
- After deployment is complete, obtain the default access domain on the overview page to perform access testing.