본문 바로가기

Engineering/도커(Docker)11

[Docker][NVIDIA] Failed to initialize NVML: Driver/library version mismatch 해결 서버 재부팅 하지않고, nvidia 프로시저 재시작으로 해결하는 방법 nvidia-smi docker에서 컨테이너를 --gpus all 옵션으로 실행하고자 하는데 아래 에러 발생 docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'legacy' nvidia-container.. 2023. 4. 19.
[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] Docker Container 실행 명령어 정리 Docker Container 관련 명령어 정리 ✔ Container 밖으로 나가기 $ exit 컨테이너를 나오면서 정지시킴 Ctrl+D Ctrl+P,Q 컨테이너를 나오면서 정지시키지 않음 ✔ Container 생성하기 $ docker create -it --name mycentos centos:7 컨테이너 생성하지만 내부로 들어가지는 않음 $ docker run-it --name mycentos centos:7 컨테이너 생성하며 내부로 들어감 ✔ Container 내부로 들어가기 $ docker run-it --name mycentos centos:7 컨테이너 생성하며 내부로 들어감 $ docker start mycentos $ docker attach mycentos ❓ docker "run" vs .. 2022. 12. 21.
[Docker][Error] CentOS 7 - File "/usr/bin/yum-config-manager", line 135 except yum.Errors.RepoError, e: 2022.12.21 - [Engineering/도커(Docker)] - [Docker] 리눅스 도커 엔진 설치 - CentOS 7 [Docker] 리눅스 도커 엔진 설치 - CentOS 7 리눅스 도커 엔진 설치 ✔ 설치 전 확인해야할 사항 호스트 운영체제 버전 : 최소 3.10 버전 이상 uname -r로 확인! 오래된 리눅스 배포판은 업데이트 지원 불가 : 지원 가능 배포판 (Ubuntu 14.04, 16.04, 1 hyen4110.tistory.com [리눅스 도커 엔진 설치 에러] CentOS 7 - File "/usr/bin/yum-config-manager", line 135 except yum.Errors.RepoError, e: CentOS 7 에서 아래 글과 같이 docker engine.. 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] plugin "nvidia-docker" not found. docker 컨테이너를 gpu로 실행하는데 아래 에러가 발생 Status: Image is up to date for pytorch/pytorch:latest docker: Error response from daemon: create nvidia_driver_440.118.02 : error looking up volume plugin nvidia-docker: plugin "nvidia-docker" not found. 아래 링크 참고하여 해결 sudo service nvidia-docker start (아래로 해결되었다고 하는 사람도 있음) sudo nvidia-docker-plugin 참고 글 https://github.com/NVIDIA/nvidia-docker/issues/437 Error l.. 2022. 12. 20.
[Docker][jupyternotebook] 도커로 tensorflow 주피터노트북 연결하기 `. 아래를 실행하여 tensorflow 주피터노트북 이미지를 pull 한다. docker pull tensorflow/tensorflow:nightly-jupyter 2. 포트를 연결하여 실행한다. docker run -it --gpus all -p 8888:8888 tensorflow/tensorflow:nightly-jupyter 둘중 하나를 복사해서 PC에서 이동하면 아래와 같음 2022. 12. 15.
[Docker] the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty' Git-Bash에서 docker run을 했을 때, 아래 메세지가 발생하였다. the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty' 구글링을 해보니 (https://stackoverflow.com/questions/48623005/docker-error-on-windows-the-input-device-is-not-a-tty-if-you-are-using-mintty) Git-Bash에서는 디폴트로 설치되는 'winpty'로 실행을 해야 docker 작업을 할수 있다. 실제로, 명령어 앞에 winpty를 넣어서 하니 정상적으로 작동한다. 하지만 일일히 winpty를 입력하는 것이 싫다면 .. 2022. 12. 15.
[Docker] Docker Container에서 git 사용하기 - Bash git command not found docker 도커 컨테이너에서 git clone을 하고 싶지만 아래와 같은 에러가 뜬다. bash: git command not found docker 새롭게 만든 container 이기 때문에 git을 설치해줘야함 apt update apt install -y git git --version git clone [git주소] 정상적으로 git clone 됨 확인하였다! 2022. 12. 15.
[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.