serveur1, serveur2 (le serveur1 sert de serveur de bibliothèque privée et le serveur2 sert de client normal)
(Recommandations associées : Tutoriel docker)
1. Téléchargez le registre
docker pull registry:latest
2. Configurez /etc/default/docker car https nécessite un mot de passe de certificat, etc. est plus compliqué, directement Ajoutez simplement un registre non sécurisé
# Docker Upstart and SysVinit configuration file # Customize location of Docker binary (especially for development testing). #DOCKER="/usr/local/bin/docker" # Use DOCKER_OPTS to modify the daemon startup options. #DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" DOCKER_OPTS="--insecure-registry 127.0.0.1:5000" # If you need Docker to use an HTTP proxy, it can also be specified here. #export http_proxy="http://127.0.0.1:3128/" # This is also a handy place to tweak where Docker's temporary files go. #export TMPDIR="/mnt/bigdrive/docker-tmp"
3 Démarrez le registre
sudo docker run --name registry -d -p 5000:5000 -v /home/docker_registry:/var/lib/registry --restart=always registry:latest
4. Tag image
docker tag redis server1:5000/redis
5. . Poussez et enregistrez l'image privée
docker push server1:5000/redis
5.1 Afficher l'image poussée vers l'entrepôt privé
$ docker search 10.10.105.71:5000/tonybai/busybox/ Error response from daemon: Unexpected status code 404 但通过v2版本的API,我们可以实现相同目的: $curl http://10.10.105.71:5000/v2/_catalog {"repositories":["tonybai/busybox"]}
# Docker Upstart and SysVinit configuration file # Customize location of Docker binary (especially for development testing). #DOCKER="/usr/local/bin/docker" # Use DOCKER_OPTS to modify the daemon startup options. #DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" DOCKER_OPTS="--insecure-registry server1:5000" # If you need Docker to use an HTTP proxy, it can also be specified here. #export http_proxy="http://127.0.0.1:3128/" # This is also a handy place to tweak where Docker's temporary files go. #export TMPDIR="/mnt/bigdrive/docker-tmp"
docker pull server1:5000/redis
docker tag redis server1:5000/redis docker push server1:5000/redis
Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!