How to Build, Tag, and Push Docker Images to Alibaba Cloud Registry
This guide walks through building a Docker image, logging into Docker Hub or Alibaba Cloud Registry, tagging the image, pushing it to the remote repository, pulling it back, and also covers basic BusyBox usage, USTC mirror setup for Docker, and fast installation of Docker‑Compose.
Docker Official Registry
Follow these steps to create and manage an image on Docker Hub.
Build the image:
docker build --rm --no-cache -t tinywan/dnmp:php7.2-v1 .Log in to the registry:
docker login --username=tinywan --password=tinywan123List local images to verify the build:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tinywan/dnmp php7.2-v3 3fd6c1dc1321 2 minutes ago 837MBTag the image for the remote repository: docker tag 3fd6c1dc1321 tinywan/dnmp:php7.2-v3 Push the image: docker push tinywan/dnmp:php7.2-v3 Pull the image from the registry:
docker pull tinywan/dnmp:php7.2-v3Alibaba Cloud Registry (Recommended)
Log in to Alibaba Cloud Docker Registry:
sudo docker login [email protected] registry.cn-beijing.aliyuncs.comTag the local image for the Alibaba Cloud repository:
docker tag ef20a9366f62 registry.cn-beijing.aliyuncs.com/tinywan/dnmp:php7.2-v3Push the image:
docker push registry.cn-beijing.aliyuncs.com/tinywan/dnmp:php7.2-v3Pull the image back:
docker pull registry.cn-beijing.aliyuncs.com/tinywan/dnmp:php7.2-v3public repository setting is required; otherwise you must log in before pulling.
Base Images
BusyBox Image
Ideal for experimental environments.
Provides a compact set of over a hundred common Linux commands in a single executable.
Runs on many POSIX‑compatible systems such as Linux (including Android), Hurd, FreeBSD, etc.
Combines simple tools (cat, echo) with more complex ones (grep, find, mount, telnet) – often called the "Swiss army knife" of Linux.
Example usage:
docker exec -it box001 bashInstalling Docker with USTC Mirror
Replace the default apt source with the USTC mirror and update the package list:
vim /etc/apt/sources.list
deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu bionic stable
sudo apt-get updateInstalling Docker‑Compose in China
Docker‑Compose binaries are hosted on GitHub and can be unstable; the following command downloads a fast mirror from DaoCloud:
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-composeOpen Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
