programing tip

Docker 오류 : 클라이언트와 서버의 버전이 동일하지 않습니다.

itbloger 2020. 9. 21. 07:25
반응형

Docker 오류 : 클라이언트와 서버의 버전이 동일하지 않습니다.


Docker를 1.1.0으로 업데이트했기 때문에 다음을 얻습니다.

데몬의 오류 응답 : 클라이언트와 서버의 버전이 동일하지 않습니다 (클라이언트 : 1.13, 서버 : 1.12).

이 문제를 해결하는 방법을 알고 있습니까?

1.0.1로 다시 전환했고 모든 것이 다시 작동합니다.


boot2docker를 설치 한 후 VM을 업그레이드해야하는 것 같습니다.

boot2docker 0.12 이상에서 업그레이드하는 경우 boot2docker stop && boot2docker download && boot2docker up을 사용하여 기존 가상 머신을 업데이트 할 수 있습니다 (설치 프로그램을 사용하여 업그레이드 한 후). 그러면 기존 데이터가 손실되지 않습니다.

( https://github.com/boot2docker/osx-installer/releases/tag/v1.1.0 )


Docker를 업데이트했지만 서비스가 다시 시작되지 않은 경우 발생할 수 있습니다. 그런 다음 업데이트 된 클라이언트를 사용하여 Docker 데몬에 연결을 시도하고 데몬 (업데이트 이전에 이미 실행 중이 었음)이 여전히 이전 버전을 실행하고 있습니다.

이 문제를 해결하려면 서비스를 다시 시작하십시오.

sysV 초기화 :

service docker restart

systemd :

systemctl daemon-reload

systemctl restart docker


docker-machine로컬 VirtualBox 기반 머신을 관리하는 데 사용 하는 경우 솔루션은 boot2docker만큼 간단합니다.

docker-machine upgrade MACHINE_NAME

docker-machine최신 버전을 다운로드 boot2docker.iso하여 업그레이드 된 VM에 새 루트 파일 시스템으로 배치 하도록 요청 합니다 .

그건 그렇고, VirtualBox 지원 도커 머신은 루트 파일 시스템을 읽기 전용으로 가지고 있습니다. 즉, 시스템 재부팅 후에도 수동 업데이트가 가능하지 않습니다. 그것은 저에게 놀라운 일이었습니다.


최신 버전의 boot2docker, docker 및 virtual box가 있었지만 여전히이 메시지를 받았습니다. 달리는 brew upgrade boot2docker것이 최선의 생각이 아닌 것 같습니다 . 를 실행할 때 boot2docker upgrade여러 환경 변수를 설정하라는 요청을 받았으며 저에게 효과적이었습니다.

Boot2docker는 다음과 같이 설정하도록 요청했습니다 (마지막 줄 참조).

$ boot2docker upgrade
Latest release for boot2docker/boot2docker is v1.3.0
Downloading boot2docker ISO image...
Success: downloaded https://github.com/boot2docker/boot2docker/releases/download/v1.3.0/boot2docker.iso
    to /Users/.../.boot2docker/boot2docker.iso
Waiting for VM and Docker daemon to start...
.........oooooooooooooo
Started.
Writing /Users/.../.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/.../.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/.../.boot2docker/certs/boot2docker-vm/key.pem

To connect the Docker client to the Docker daemon, please set:
    export DOCKER_HOST=tcp://192.168.59.103:2376
    export DOCKER_CERT_PATH=/Users/.../.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1

이 세 줄을 한 번에 잘라내어 터미널에 붙여 넣을 수 있습니다.

올바른지 확인하려면 :

$ env

최신 클라이언트로 Docker 서버를 쿼리하려고했습니다.

  • 서버 API 버전 : 1.21
  • 클라이언트 API 버전 1.22

저에게 해결책은 다음과 같습니다.

export DOCKER_API_VERSION=1.21

참조 : https://docs.docker.com/engine/reference/commandline/cli/


여기서 정답은 매우 오래되었습니다 (Docker는 boot2docker의 이름을 Docker Machine으로 바꾸고 더 많은 기능을 추가했습니다) .

Anyway I faced the same problem and took me about 3 days to fix :(

Here's the solution

1) find the location of the boot2docker.iso

sudo find ~/ -name 'boot2docker.iso'

2) delete the boot2docker.iso file, after taking a backup of it

/Users/{user}/.docker/machine/cache/boot2docker.iso

3) delete your docker vm

docker-machine rm {default}

this should delete that one as well:

/Users/{user}/.docker/machine/machines/default/boot2docker.iso

4) create new docker vm

docker-machine create --driver virtualbox default

this will download a new boot2docker.iso first and then use it to create your vm.

Now this should fix it :)

BUT

If you get any error here like:

Running pre-create checks...
(mega-docker) No default Boot2Docker ISO found locally, downloading the latest release...
Error with pre-create check: "Get https://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp: lookup api.github.com on 192.168.0.1:53: read udp 192.168.0.103:53947->192.168.0.1:53: i/o timeout"

try to download the boot2docker.iso file manually by going to https://api.github.com/repos/boot2docker/boot2docker/releases/latest then clicking on the html_url and finally choosing to download the file.

once you get the file go and place it manually in /Users/{user}/.docker/machine/cache/

finally re-run this command docker-machine create --driver virtualbox default


The only thing that worked for me was killing the process and starting it with "sudo service docker start".


The only thing the worked for me was removing the boot2docker image from VirtualBox then completely deleting ~/.boot2docker folder, and finally running boot2docker init again.


boot2docker delete

boot2docker init

worked for me. stop/start the deamon before and after that of course.


This worked for me: It just shuts the vm down, deletes & recreates it and starts it up again. It re-runs shellinit so your ENV variables get set with the correct IP address when it comes back up.

$ boot2docker poweroff && \
    boot2docker delete && \
    boot2docker init && \
    boot2docker up
$ eval `boot2docker shellinit`

I had the latest version of boot2docker(v1.7.1) and got the client server mismatch error. Then I just ran boot2docker upgrade and it solved the problem.


My solution was to do a Close > Power Off on the docker VM in VirtualBox, and then restart Kitematic. This fixed it for me.


I find the version in brew is outdated compared to the one on the docker.io website. Therefore I think the best way is go to the website and download the install file.


Ansible Answer:

If you came there by Ansible and not boot2docker, here is the solution: Use the docker_api_version: auto argument

- name: Mongo data container
  docker:
    docker_api_version: auto
    name: mongo-primary-dc
    image: debian:wheezy
    state: present
    volumes:
    - /data

I guess the reason is that the docker-py module used by Ansible is often not at the same version as the Ubuntu apt-get repository.

참고URL : https://stackoverflow.com/questions/24586573/docker-error-client-and-server-dont-have-same-version

반응형