본문 바로가기

Programming

도커허브에서 centos 이미지 받고 실행하기

1. centos 이미지 받기

구글에서 dockerhub centos를 검색하거나 dockerhub를 들어가서 centos를 검색한다.

https://hub.docker.com/_/centos

 

Centos - Official Image | Docker Hub

Quick reference Supported tags and respective Dockerfile links Quick reference (cont.) CentOS CentOS Linux is a community-supported distribution derived from sources freely provided to the public by Red Hat for Red Hat Enterprise Linux (RHEL). As such, Cen

hub.docker.com

그러면 아래와 같이 도커 허브에서 centos 공식 이미지 페이지를 만날 수 있다. 

도커 허브 centos 검색 후 공식 이미지

 

위 이미지 하단의 Tags를 클릭하게 되면 태그 되어있는 centos의 여러 버전별 이미지를 정렬 또는 검색하여 확인할 수 있다.

도커 허브 centos tags

원하는 이미지가 있으면 위와 같이 도커 명령어를 복사하여 이미지를 당겨주면 된다.

docker pull centos

위와 같이 명령 프롬프트에서 pull 해준 뒤, docker images를 입력하여 pull 받은 이미지를 확인할 수 있다.

docker pull centos latest

2. 이미지 실행 및 버전 확인

아래의 명령어로 다운받은 centos 이미지를 실행시켜준다.

docker run -it centos:latest

이후 centos 설치 버전을 확인해본다.

 cat /etc/redhat-release

현재 최신 버전인 8.4.2105 버전으로 실행되었음을 확인할 수 있다.

centos 실행 후 버전 확인

반응형