docekr create a mirror and remote push
This article is the first time I was first learning docker, in learning to be pushed to the remote mirroring, find many problems encountered, be it card me a little time, so here record it, and then check back after easy.
Followed by a description of some of the terminology:
- container: container
- images: Mirror
The difference is, you can refer to the following blog:
The relationship between container and mirrored reference blog
In simple terms the relationship between the two is mirrored must run in a container.
log in
First, delete something, if you do not perform this step, you may encounter the following error message:
denied: requested access to the resource is denied
Of course, there are some precautions, but this is the first step:
vim ~/.docker/config.json
will
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "这里的内容进行删除"
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.5 (linux)"
}
}
Log in again
docker login
Enter your account number and password, and account registration address: https://hub.docker.com/
Create a container
View existing containers
docker ps -l
If you need to have a container on it, if not, you can create a container:
docker run --name $containerName $imageName
Which $containerName
is the name of the container you want to create, and $imageName
what you want to use a mirror.
such as:
docker run local_containerName ubuntu
View all local mirroring can be used
docker images
Creating a local mirror
docker commit $containerName $loginUserName/$imagesName
Here $containerName
is the container you want to submit, with emphasis on image name, be sure to add prefix, which is the user name when you register, again is split number: /
the last is just for you is the image name it: $imagesName
.
such as:
docker commit lcoal_containerName middleSunshine/commit_test
Pushed to the remote
docker push $loginUserName/$imagesName
This, you can create a remote mirror.
such as
docker push middleSunshine/commit_test
You can try to use
docekr search $loginUserName/$imagesName
Search for something you pushed to the remote mirroring.