-
(ubuntu) Docker 환경 설정Docker & Kubernetes 2024. 5. 13. 16:44
1. 레포지토리 구성하기
$ sudo apt-get update
$ sudo apt-get install ca-certificates
$ sudo apt-get install curl
$ sudo apt-get install gnupg
$ sudo apt-get install lsb-release$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null2. 도커 설치
$ sudo apt-get update
$ sudo apt-get install docker-ce
$ sudo apt-get install docker-ce-cli
$ sudo apt-get install containerd.io
3. 도커 테스트 이미지 실행$ sudo docker run hello-world
123456789101112131415161718192021Hello from Docker!This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:1. The Docker client contacted the Docker daemon.2. The Docker daemon pulled the "hello-world" image from the Docker Hub.(amd64)3. The Docker daemon created a new container from that image which runs theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID:https://hub.docker.com/For more examples and ideas, visit:https://docs.docker.com/get-started/cs 4. 도커 실행여부 확인
$ ls -lh /usr/lib/systemd/system | grep docker
{
docker.service
docker.socket
}
$ service docker status
'Docker & Kubernetes' 카테고리의 다른 글
(Redhat) Docker 환경 세팅 (0) 2024.05.08