Giter VIP home page Giter VIP logo

docker_registery_cache_private's Introduction

Docker-Registry by using letsencrypt CA as private & cache registry

Server side Config :

1- 
sudo apt-get update
sudo apt-get install certbot
sudo apt-get install apache2-utils
2-
sudo certbot certonly --standalone -d <your domain address>
3- 
ls  /etc/letsencrypt/live/
ls /etc/letsencrypt/archive/

4-
cd Docker-Registery
5-
mkdir certs
6-
#cp fullchain1.pem  privkey1.pem in certs directory and be careful check the excat pem and priatekey files
7-
htpasswd -Bbn <Your UserName> > < Your Password> htpasswd # encrypt your password via bcrypt algorithm 

#If you no need to authentication you can comment these lines in docker-compose:
      - ./htpasswd:/auth/htpasswd
      REGISTRY_AUTH: htpasswd
      REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
      REGISTRY_AUTH_HTPASSWD_REALM: Registry Real

8-
 docker-compose up -d

Client side config :

To use the cache_registry for pulling images


1- 
touch  /etc/docker/daemon.json
2-
 vim  /etc/docker/daemon.json

{
    "registry-mirrors": ["https://<your repository URL>"],
    "log-opts": {
        "max-size": "100m"
    }
}

2-
sudo systemctl daemon-reload
sudo systemctl restart docker.service

To use the private_registry to push and pull your images

3-
docker login -u <"your username"> -p <"your password"> <your repository URL>:7000

#You will probably get something like this :

WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /home/mohammad/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

4- cat  $HOME/.docker/config.json

5-
docker tag <your image:tag> <your repository URL>:7000/<your image>:tag
#Example: docker tag m3tr-jenkins:latest registry.a.com:7000/m3tr-jenkins:latest

6-
docker push <your repository URL>:7000/m3tr-jenkins:latest
#Example: docker push registry.a.com:7000/m3tr-jenkins:latest

7-
docker pull <your repository URL>:7000/m3tr-jenkins:latest
#Example: docker pull registry.a.com:7000/m3tr-jenkins:latest

docker_registery_cache_private's People

Contributors

mohammad3tr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.