完全支持werf中流行的Docker Registry实现

图片


Docker Registry HTTP API . , , — CI/CD, — . GitOps- werf, , .


Docker Registry, werf.



Docker-, , (registry). , registry — (AWS ECR, Azure CR, Docker Hub ). , .


werf / Kubernetes --images-repo --images-repo-mode, , ( *) registry.


* « monorepo multirepo werf Docker Registry».


--images-repo registry, repository. , , (, , ).


--images-repo-mode , , :


  • IMAGES_REPO:IMAGE_NAME-TAGmonorepo;
  • IMAGES_REPO/IMAGE_NAME:TAGmultirepo.

: (image: ~) --images-repo-mode , .. --images-repo (IMAGES_REPO:TAG).


registry, monorepo registry . (image: ~) registry, --images-repo-mode.



, 3 . Docker Registry :


registry + multireporepository + monoreporepository + multirepo
AWS ECR*+++
Azure CR+++
Default (DTR)+++
Docker Hub++-
GCR+++
GitHub Packages++-
GitLab Registry+++
Harbor+++
Quay++-

* AWS ECR . ( UI API) .


, Docker Hub, GitHub Packages Quay: (REGISTRY/REPO/SUBREPO).


, --images-repo-mode, . , , multirepo — . --images-repo.


, , --implementation. , , hosts GitLab Registry werf ( pipeline ci-env ).



, .


werf.yaml:


project: flant
configVersion: 1
---
image: backend
dockerfile: Dockerfile
target: backend
---
image: frontend
dockerfile: Dockerfile
target: frontend

… Docker Hub flant.


--images-repo=flant :


  • flant/frontend:tag
  • flant/backend:tag

werf build-and-publish -s=:local -i=flant --tag-custom=tag

--images-repo=flant/project :


  • flant/project:frontend-tag
  • flant/project:backend-tag

werf build-and-publish -s=:local -i=flant/project --tag-custom=tag

werf build-and-publish


, werf.yaml, . :


  • -s--stages-storage, ( — . );
  • -i--images-repo;
  • --tag-custom — ( — ).


, , — . , API :


API
AWS ECRAmazon ECR API
Azure CRAzure CR API
Default (DTR)Docker Registry API
Docker HubDocker Hub API
GCRDocker Registry API
GitHub PackagesGitHub GraphQL API ( git-)
GitLab RegistryDocker Registry API
HarborDocker Registry API
QuayDocker Registry API

, Docker Registry API, docker login , . : AWS ECR, Azure CR, Docker Hub GitHub Packages — Docker Registry API, API . .



werf?


  • Azure CLI (az) : Owner, Contributor AcrDelete. : Azure CR roles and permissions.
  • AWS ECR AWS SDK. AWS CLI (aws configure) AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY .
  • Docker Hub werf Docker Hub API token. * (--images-repo-docker-hub-token) (--images-repo-docker-hub-username + --images-repo-docker-hub-password).

, Docker Hub personal access token, .. .


* , token :


HUB_USERNAME=USERNAME
HUB_PASSWORD=PASSWORD
HUB_TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${HUB_USERNAME}'", "password": "'${HUB_PASSWORD}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)

  • package GitHub GraphQL. token (--images-repo-github-token) scopes: read:packages, write:packages, delete:packages repo.


Docker Registry werf:


  • AWS ECR;
  • Azure CR;
  • Docker Hub;
  • Default (DTR);
  • GCR;
  • GitHub Packages;
  • GitLab Registry;
  • Harbor;
  • Quay.

.


werf v1.1.9+fix2.


, Docker Registry, .


P.S.


:



All Articles