Docker desktop mac wont update docker compose - docker

I updated docker desktop for Mac (intel) this morning to Docker Desktop 4.9.1. My docker compose version won't seem to update. When I run docker-compose --version in my terminal it returns docker-compose version 1.25.5, build unknown. I tried installing docker-compose with brew and after some tinkering I got confirmation that it installed version 2.6.0, however after restarting docker desktop and my computer, I still get 1.25.5 when I run docker-compose --version.
How can I force docker to use a newer version of docker-compose?
NOTE: In my docker-compose.yml file I have version 2 running.

My docker compose also came via Docker Desktop on MacOS and it did not update/had the latest the latest version of docker-compose. I resolved this by installing docker-compose via brew:
https://formulae.brew.sh/formula/docker-compose
brew install docker-compose
Don't forget to follow the after-install instructions:
"Compose is now a Docker plugin. For Docker to find this plugin, symlink it:"
mkdir -p ~/.docker/cli-plugins
ln -sfn /opt/homebrew/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose

The only way I was able to solve this was to completely manually uninstall docker desktop and all docker related items from brew. I deleted every docker file I could find from my lib and then reinstalled.

Related

docker supposedly installed but not runnable

If I do a docker command like
docker -version
I get the error that docker is not installed and that I can do sudo apt-get install docker to install it. If I do this, it says that docker is the latest version. Do I need to set some kind of path to the binary to get it to run?
If I do which docker, there is no answer.
I have found the answer to the question.
Apparently there is a package called "docker" which has nothing to do with docker the container software which is actually docker-ce. The application I had installed was the fake docker, not the container-ware.
To install docker-ce there is a process given on Digital Ocean which can be used.
.

How to install docker version 17.04 on Amazon Linux?

I tried installing docker on Amazon Linux but found that currently sudo yum install docker installs version 1.12. However, I need docker version 17.04. How can I upgrade my docker version or install version 17.04 on Amazon Linux ?
Docker instillation comes with a predefined Cloud formation template this can be found in , the version is 17 here
https://editions-us-east-1.s3.amazonaws.com/aws/stable/Docker.tmpl
you can always run an upgrade command if you do not want to sue a cloud formation template
$ docker-machine upgrade default

docker-compose is not working

When I am trying to test a zookeeper cluster using docker-compose, the console shows nothing.
This is my command:
COMPOSE_PROJECT_NAME=zk_test docker-compose up
No response of docker-compose command
My questions are:
I only installed docker-machine and docker-compose. The command is there, but do I need to install docker-compose additionally?
Should docker-compose be installed inside docker machine or in host machin? If the latter, how does docker-compose manage Docker containers? Because they are running inside of the Docker machine.
What I think is weird, is that when I input 'docker-compose' in the host terminal, it can be recognized by the OS (screenshot).
My environment:
OS: Mac
Docker container: docker-machine (boot2docker)
Here is how I get all necessary packages on my Mac OS machine.
Install homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then brew cask install docker
brew cask install docker
Open Docker through Applications or:
open /Applications/Docker.app
You should now how docker-compose, docker and docker-engine.

Docker compose no response

After docker-compose down and docker-compose up several times, sometime docker-compose up will cause no response. Normally, docker will tell you what container is created. But, nothing is shown. I try to quit Docker App and restart it. Cannot fix it. After restart OS, then docker-compose works fine.
Anyone know this issue?
Update:
Docker version: 1.12.0, build 8eab29e
Docker Composer Version: 1.8.0, build f3628c7
Platform: MacOS 10.11.4
You might need to run docker-compose ps to see what is currently running. If I were you I would like to kill the ps by running docker-compose kill and docker-compose rm. Atm the docker compose will be clean and you could run docker-compose up again
Finally, i found the core issue. For my environment, i use Charles as proxy server. I enable the Mac OS proxy in Charles. Once, i disable it. Docker will work fine.
Follow documentation on link:
https://docs.docker.com/compose/install/
I used on Ubuntu 16.04 command:
curl -L https://github.com/docker/compose/releases/download/1.14.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
After that check if it works. Output should looks like:
$ docker-compose --version
docker-compose version 1.10.1, build b252738

Docker - Error response from daemon: client is newer than server

After creating a new machine with Docker Machine, I'm getting the following error:
$ docker ps
Error response from daemon: client is newer than server(client API version 1.21, server API version: 1.19)
How can I fix this?
docker-machine upgrade <your-machine>
will do the trick. This can happen - as it did for me - even if you're not using RCs and your machine was newly created. It would be due to an ISO cache issue. The error is commented in this thread.
If the docker client is 1.9.x and the server is running docker 1.8.x,
the error message is observed.
If someone happens to get this error, but is not using docker-machine, there is another way to resolve the issue by specifying an older API version in an environment variable on the client side:
export DOCKER_API_VERSION=<version>
for example:
export DOCKER_API_VERSION=1.19
and retrying the docker command.
Reference.
On ubuntu distrib it happens after an apt update, if docker run as a service.
The client is updated but the old version of the server is still running.
In this case just do a:
sudo service docker restart
If you upgrade your docker client you will not be able to use old docker-machine VMs. Actually you can force an upgrade with docker-machine upgrade vm-name, but if you are working with other distros (except boot2docker) as docker host like coreos, atomic, rancheros it may fail.
I am using Carina to manage more than one docker client version.
just install with $ curl -sL https://download.getcarina.com/dvm/latest/install.sh | sh
(linux and mac installation) and run dvm ls to list installed versions, dvm install 1.9.0 to install versions and dvm use 1.8.1 to change your client version.
Very easy and powerfull. =)
Atention, for your safety always take a look inside scripts downloaded from internet before running them.
Hope it helps
Apparently this error is due to docker-machine "falling asleep". Here is the magic command solving it for me:
$ docker-machine restart default
Or replace default by the name of your machine.
The result is:
$ docker-machine restart default
Restarting "default"...
Restarted machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
As suggested, you may need to:
$ docker-machine env default
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://....."
export DOCKER_CERT_PATH=".../.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval $(docker-machine env default)
And so you finally run that command:
$ eval $(docker-machine env default)
From now it should work.
I had the same issue with 1.10.0-rc4, and it turned out that boot2docker wasn't updated properly when installing a newer Docker Toolbox. I had to remove boot2docker manually:
sudo rm -rf /usr/local/share/boot2docker
You can also delete the rest of the toolbox:
sudo rm -rf /usr/local/bin/docker*
sudo rm -rf /Applications/Docker
And finally install Docker Toolbox of the desired version.
Please see official uninstall script for on GitHub for OS X here.

Resources