본문 바로가기
devops/Docker 강좌📌인프런

생활코딩 도커강좌 #3 - 이미지 공유

by IMSfromSeoul 2022. 2. 28.

📌 Dockerhub을 통한 이미지 공유

  • Repositories 클릭
    • Create Repository
      • 이름 python3-test

▸ 로컬에서 이미지 생성

📚 컨테이너 생성 & 파이썬 설치

  • docker run -it --name my-python ubuntu 
    • ubuntu 이미지를 통해 my-python이라는 컨테이너를 생성하고
      • -it 옵션을 통해 해당 터미널로 접속
  • apt update && apt install -y python3
    • python 설치

 

📚 생성된 컨테이너로 이미지 만들기

  • docker commit [컨테이너 이름] [생성할 이미지 이름]
    • docker commit my-python gudwnsrh/python3:1.0
  • docker images
    • 생성된 이미지들을 확인할 수 있다.

 

📚 생성된 image push 하기

  • docker push gudwnsrh/python3:1.0

  • docker rmi gudwnsrh/python3:1.0
    • 로컬에 있는 이미지 삭제
  • docker pull gudwnsrh/python3:1.0
    • hub에 있는 이미지 다운로드

 

 

 

 


Dockerhub에 이미지 공유
- ( https://www.youtube.com/watch?v=_38dU6GExDo )

댓글