본문 바로가기

Docker/Docker (도커)

docker image를 docker hub에 push하기

728x90
반응형

# docker image를 docker hub에 push하기

- 실행중인 docker를 정지

:~/docker-amazoncorrecto$ sudo docker stop a96d19bd868a

- 정지한 docker를 커밋

:~/docker-amazoncorrecto$ docker commit a96d19bd868a correcto-test
sha256:fab389fb6faa884f4080765e2b4e92a3b823693518c6b6bb63ea0727c1f58b80

- 커밋된 docker 확인하기

:~/docker-amazoncorrecto$ sudo docker images
REPOSITORY                   TAG                    IMAGE ID       CREATED         SIZE
correcto-test                latest                 fab389fb6faa   6 seconds ago   1.01GB

- docker hub 로그인하기

:~/docker-amazoncorrecto$ docker login
Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /home/seungkim/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded

- commit한  docker 를 태킹

:~/docker-amazoncorrecto$ docker tag fab389fb6faa may9noy/correcto-test:latest

- docker hub에 push 하기

:~/docker-amazoncorrecto$ docker push may9noy/correcto-test:latest
The push refers to repository [docker.io/may9noy/correcto-test]
f55063ade48a: Pushed
865a57f5f2ab: Mounted from library/amazoncorretto
70ed997db762: Mounted from library/amazoncorretto
latest: digest: sha256:0f0fc27037fc2e6a2efc1303e0320bbd27929e273312ce07084ac68597693846 size: 954

- docker hub에 가서 확인하면 정상적으로 업로드 된것을 확인

- 추후에 이미지 주소만 활용하여 사용

 

- 끝 -

728x90
반응형