본문 바로가기

도커4

[Docker][Error] bash: ifconfig: command not found docker 네트워크 관련하여 공부하는 중, $ docker pull centos $ docker run --gpus all --name centos_gpu centos $ ifconfig bash: ifconfig: command not found 가 발생하였다. ifconfig는 CentOS 6까지는 디폴트로 가능한 명령어였지만, CentOS 7부터는 디폴트가 아니라 설치해야 한다고 한다. 따라서, ifconfig 명령어가 포함된 net-tools package를 설치해야 한다. 그래서 yum install net-tools를 실행하였으나, 이것도 오류가 발생 $ yum install net-tools Failed to set locale, defaulting to C.UTF-8 CentOS Linu.. 2022. 12. 22.
[Docker] Docker Container 외부 노출하기 (PORT 바인딩) Docker Container 외부 노출하기 (HOST PORT 바인딩) 컨테이너는 가상머신과 마찬가지로 가상 IP주소를 할당 받는데, 기본적으로 도커는 컨테이너에 172.17.0.x의 IP를 순차적으로 할당합니다. 이는 컨테이너를 실행해서 ifconfig 명령어로 확인할 수 있습니다. 만일 아무런 설정을 하지 않았다면, 이 컨테이너는 외부에서 접근할 수 없으며 도커가 설치된 호스트에서만 접근할 수 있습니다. 따라서, 외부에 컨테이너를 노출하고 싶다면, IP와 포트를 호스트의 IP와 포트에 바인딩해야합니다. IP/PORT 연결 ✔ type#1 PORT만 바인딩 -p 옵션으로 호스트 80포트와 컨테이너 80포트를 연결 $ docker run -it --name mywebserver -p 80:80 cent.. 2022. 12. 21.
[Docker] 리눅스 도커 엔진 설치 - CentOS 7 리눅스 도커 엔진 설치 ✔ 설치 전 확인해야할 사항 호스트 운영체제 버전 : 최소 3.10 버전 이상 uname -r로 확인! 오래된 리눅스 배포판은 업데이트 지원 불가 : 지원 가능 배포판 (Ubuntu 14.04, 16.04, 18.04, CentOS7) 64비트 리눅스 인지 확인 root 계정 또는 sudo 명령어를 통해 설치 ✔ CentOS 도커 엔진 설치 $ yum install -y yum-utils $ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo $ yum install -y docker-ce $ systemctl start docker *docker-ce란? 도커엔진은 도커 EE(D.. 2022. 12. 21.
[Docker][Error] Using default tag: latest Cannot connect to the Docker daemon at ~/Is the docker daemon running? 리눅스에서 Docker을 시작하고자 하는데 아래 메세지가 난다면, # Error message Using default tag: latest Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?1. Docker 상태 확인 systemctl status docker 2. Docker 시작 systemctl start docker3. Docker 활성화 systemctl enable docker> 이후 status가 바뀜 확인 2022. 12. 13.