- docker 설치
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io -y
systemctl start docker
systemctl enable docker
systemctl status docker
docker ps
- docker root 접속
docker exec -itu 0 [컨테이너 ID] /bin/bash
- docker 컨테이너 삭제
docker stop [컨테이너 ID]
docker rm [컨테이너 ID]
- Docker 종료 없이 나가기
Ctrl + p + q
- Docker image pull
docker pull centos:7
- Docker image 만들기
docker commit [원본] [이미지이름]
- Docker image 확인
docker images
- Docker 컨테이너 생성
docker create -i -t --name test1 --restart=always centos7:latest /bin/bash
docker run -it -p 8080:8080 --name test4 --restart=always centos7:latest /bin/bash
docker run -it -p 5000-6000:5000-6000 --name test5 --restart=always centos7:latest /bin/bash
- 서버포트:컨테이너포트
docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
- docker container에서 GUI 환경 사용
docker run -p 1714-1715 --name test3 -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY --restart=always centos_gui:latest /bin/bash |
- Docker 로컬->컨테이너
docker cp ./[원본_위치]/ [docker_name]:/
- Docker 컨테이너 이름 바꾸기
docker rename [old name] [new name]
'IT > LINUX' 카테고리의 다른 글
tcpdump 사용법 (0) | 2023.02.09 |
---|---|
Docker 웹 GUI 관리 툴 (0) | 2022.11.18 |
Centos8 Network Device Name 변경 (6) | 2020.12.04 |
Ubuntu 16.04 software RAID 구성 (9) | 2020.11.28 |
Linux buff/cache 정리 하기 (0) | 2020.11.13 |