docker image - 도커 허브 저장소 이용

이상민·2023년 4월 17일
0

docker

목록 보기
7/19

docker login

$ docker login -u skybluelee
Password:
WARNING! Your password will be stored unencrypted in /home/ubuntu/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded


Repositories에서 새 레포지토리 생성

레포지토리에 업로드 할 수 있도록 tagging 작업

$ docker images
REPOSITORY      TAG       IMAGE ID       CREATED       SIZE
my-app          v1        4a021aa4a38d   2 hours ago   408MB
my-ubuntu       v1        7ebf1377db43   3 hours ago   72.8MB
nodejs-server   latest    1c6460fadeaa   4 hours ago   916MB
ubuntu          focal     1c5c8d0b973a   5 weeks ago   72.8MB

$ docker tag nodejs-server:latest skybluelee/my-nginx:v1.0.0

$ docker images
REPOSITORY            TAG       IMAGE ID       CREATED       SIZE
my-app                v1        4a021aa4a38d   2 hours ago   408MB
my-ubuntu             v1        7ebf1377db43   3 hours ago   72.8MB
nodejs-server         latest    1c6460fadeaa   4 hours ago   916MB
skybluelee/my-nginx   v1.0.0    1c6460fadeaa   4 hours ago   916MB
ubuntu                focal     1c5c8d0b973a   5 weeks ago   72.8MB

이미지에 skybluelee/my-nginx가 생성됨

push를 통한 업로드

$ docker push skybluelee/my-nginx:v1.0.0

The push refers to repository [docker.io/skybluelee/my-nginx]
e1c7c4902f57: Pushed
1fea31a8b3f7: Pushed
e61304b68310: Pushed
dd392f109cdd: Pushed
071b27720aa6: Mounted from library/node
2b322fb17205: Mounted from library/node
f395a74ec0fc: Mounted from library/node
cb81227abde5: Mounted from library/node
e01a454893a9: Mounted from library/node
c45660adde37: Mounted from library/node
fe0fb3ab4a0f: Mounted from library/node
f1186e5061f2: Mounted from library/node
b2dba7477754: Mounted from library/node
v1.0.0: digest: sha256:eba896582480af4e5b72e8820f5c5221c241c80f5d6990f11e7fe61ba40af759 size: 3047


tag에 v1.0.0.이 업로드 된 것 확인

이미지에서 기존 파일 삭제후 도커 허브에서 다운로드

$ docker rmi skybluelee/my-nginx:v1.0.0

$ docker images
REPOSITORY      TAG       IMAGE ID       CREATED       SIZE
my-app          v1        4a021aa4a38d   2 hours ago   408MB
my-ubuntu       v1        7ebf1377db43   4 hours ago   72.8MB
nodejs-server   latest    1c6460fadeaa   5 hours ago   916MB
ubuntu          focal     1c5c8d0b973a   5 weeks ago   72.8MB

$ docker pull skybluelee/my-nginx:v1.0.0
v1.0.0: Pulling from skybluelee/my-nginx
Digest: sha256:eba896582480af4e5b72e8820f5c5221c241c80f5d6990f11e7fe61ba40af759
Status: Downloaded newer image for skybluelee/my-nginx:v1.0.0
docker.io/skybluelee/my-nginx:v1.0.0

$ docker images
REPOSITORY            TAG       IMAGE ID       CREATED       SIZE
my-app                v1        4a021aa4a38d   2 hours ago   408MB
my-ubuntu             v1        7ebf1377db43   4 hours ago   72.8MB
nodejs-server         latest    1c6460fadeaa   5 hours ago   916MB
skybluelee/my-nginx   v1.0.0    1c6460fadeaa   5 hours ago   916MB
ubuntu                focal     1c5c8d0b973a   5 weeks ago   72.8MB

제대로 다운되어 있는 것 확인

0개의 댓글