| accounts |
|---|
| GitHub Free |
| GitHub Pro |
| GitHub Free for organizations |
| GitHub Team |
| GitHub Enterprise Cloud |
| GitHub Enterprise Server 2.22 |
| GitHub One. |
| accounts |
|---|
| private repositories of Github with legacy per-repository plan |
| accounts using legacy per-repository plan |
| Permission role | Access description |
|---|---|
| Read | Can download package. Can read package metadata. |
| Write | Can upload and download this package. Can read and write package metadata. |
| Admin | Can upload, download, delete, and manage this package. Can read and write package metadata. Can grant package permissions. |
GitHub Container Registry 활성화Feature preview 클릭Improved container support 활성화GitHub Container Registry 활성화GitHub Container Registry 핵심 개념GitHub Container RegistryOCI(Open Container Initiative) Image Specification이 되었다Your profile 클릭Packages 탭 클릭GitHub Container Registry에 인증PAT와 권한GitHub Actions에서 인증하려면 반드시 Personal Access Token(PAT)를 써야 한다. 현재 GITHUB_TOKEN는 권한이 없다.PAT를 GitHub Actions에서 사용하려면, PAT에 대한 보안 베스트 프랙티스를 따른다PAT 생성. 조직에서 SSO를 요구하면, 토큰에 대하여 반드시 SSO 활성화. PAT의 생성 방법WARNING >
write package를 선택하면,PAT생성 시repo권한을 선택 해제한다PAT에repo권한을 추가하면, 저장소 내의 모든 협력자(collaborator)들에게 접근할 수 있다
| scopes | 목적 |
|---|---|
read package |
컨테이너 이미지 다운로드 및 메타데이터 읽기 |
write package |
컨테이너 이미지 다운로드/업로드 및 메타데이터 읽기/쓰기 |
delete package |
컨테이너 이미지 삭제 |
PAT를 환경 변수로 저장하는 것을 추천$ export CR_PAT=YOUR_TOKEN
ghcr.io의 GitHub Container Registry 서비스이 sign in$ echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
> Login Succeeded
# ~/.bashrc 에 export CR_PAT=<PAT> 저장 후, source ~/.bashrc
$ echo $CR_PAT | docker login ghcr.io -u aimpugn --password-stdin
WARNING! Your password will be stored unencrypted in {$HOME}/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
$ docker push ghcr.io/{OWNER}/{IMAGE-NAME}:latest
$ docker push ghcr.io/{OWNER}/{IMAGE-NAME}:2.5
하지만 push 테스트 결과 아래와 같은 에러 발생
$ docker push ghcr.io/aimpugn/pgsb:1.1.0
The push refers to repository [ghcr.io/aimpugn/pgsb]
An image does not exist locally with the tag: ghcr.io/aimpugn/pgsb
images 목록을 보면 “ghcr.io/aimpugn/pgsb”라고 태그 되어 있는 이미지가 없다. 그럼 모두 이렇게 태그 해야 하는가?
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
pgsb 1.1.0 9dab490fcaf8 2 days ago 324MB
golang 1.15.5-alpine3.12 1de1afaeaa9a 2 weeks ago 299MB
<none> <none> 1f1bfd282304 5 months ago 40.6MB
jaegertracing/all-in-one latest 515cf0d4394e 5 months ago 48.3MB
hello-world latest bf756fb1ae65 11 months ago 13.3kB
jaegertracing/all-in-one 1.6 200b59542ab6 2 years ago 40.6MB
qnib/httpcheck latest 3df1ccc70b53 4 years ago 286MB
stackoverflow 검색해보면, 기본 레지스트리(docker hub)가 아닌 곳에 push 할 경우
regitry name과 port를 포함해야 한다
Successfully built 4634d3bc9e76
Successfully tagged ghcr.io/aimpugn/pgsb:1.1.0
이를 push하면 다음과 같이 push가 된다
$ docker push ghcr.io/aimpugn/pgsb:1.1.0
The push refers to repository [ghcr.io/aimpugn/pgsb]
c536b765fbc6: Pushed
aa32009142e4: Pushed
d7e330f94ce7: Pushed
72f3b72640b9: Pushed
27fc4e020136: Pushed
c07f8a820edc: Pushed
ace0eda3e3be: Pushed
size: 1787