I just erased the docker for mac program because it was very bloated, and I installed with brew docker and docker-compose. I followed this blog post.
docker works fine, but docker-compose is extremely slow.
I know that there is a fix of setting localunixsocket.local in the /etc/hosts file, but that doesnt work for me. I tried every combination, but nothing works.
These are the versions I'm using on el capitan:
docker
Docker version 17.11.0-ce, build 1caf76c
docker-compose
docker-compose version 1.17.1, build unknown
Tnx,
Tom
Try to put these aliases in your /env/hosts file, so your 127.0.0.1 line looks like this:
127.0.0.1 localhost localunixsocket localunixsocket.local localunixsocket.lan localunixsocket.localdomain
Related
I installed docker with the instructions here, downloading from docker-hub
https://docs.docker.com/docker-for-mac/install/
But when I run docker-compose I get this error
pyenv: docker-compose: command not found
The `docker-compose' command exists in these Python versions:
3.6.5/envs/myenv
Also, docker-compose is available under /Users
which docker-compose
/Users/<username>/.pyenv/shims/docker-compose
In this link says, docker-compose for mac need not be installed explicitly as it is part of docker for desktop mac.
https://docs.docker.com/compose/install/
Is something wrong with my installation?
I ran into the same issue on macOS today. Turned out that you need to run the installed app once, it does some additional downloading and setup. That setup includes setting up your path variables.
docker-compose is a utility that is now a parameter in mac docker
so instead of docker-compose up, its now docker compose up
if you install docker from official website then docker-compose will come along with that for mac so need to either upgrade and documentation is present there.
OK so here is what I have done so far. I installed docker for mac, and that worked fine. From there I tried to get a project up and running using docker-compose and I got the following error:
Could not read CA certificate "/Users/<useraccountfolder>/.boot2docker/certs/boot2docker-vm/ca.pem": open /Users/<useraccountfolder>/.boot2docker/certs/boot2docker-vm/ca.pem: no such file or directory
So I tried to fix it by trying this accepted answer. This is when I got another error, Host does not exist: “default”. This is when I trie this accepted answer, but when I tried to run docker-machine create default, I got this error: Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path". I am just lost at this point. Any help?
To use docker machine you need the latest version of VirtualBox, from the docker docs:
IF YOU ARE USING DOCKER FOR MAC
Docker for Mac uses HyperKit, a lightweight macOS virtualization solution built on top of the Hypervisor.framework in macOS 10.10 Yosemite and higher.
Currently, there is no docker-machine create driver for HyperKit, so you will use virtualbox driver to create local machines. (See the Docker Machine driver for Oracle VirtualBox.) Note that you can run both HyperKit and Oracle VirtualBox on the same system. To learn more, see Docker for Mac vs. Docker Toolbox.
Make sure you have the latest VirtualBox correctly installed on your system (either as part of an earlier Toolbox install, or manual install).
Source: https://docs.docker.com/machine/get-started/#prerequisite-information
OK so I found a solution which is probably not fixing the root issue, but it does work. To unset previous variables I ran this command unset ${!DOCKER*}. This worked, but then I had to run it every time I started a new terminal session, so I added it to my .bash_profile and now I am good.
Having some odd issues getting docker to behave on a windows host, but on a linux host its fine. Its just a simple node container that can run gulp (and will eventually be attached to other LAMP like containers).
my docker-compose.yml
version: '2'
services:
node:
build: ./node
container_name: cont_node
ports:
- "35733:35733"
volumes:
- ~/docker/project/www:/var/www/html/
command: "sh -c 'npm install && bower install && gulp'"
my Dockerfile
FROM node:4-onbuild
RUN npm config set registry http://registry.npmjs.org/
# Define working directory.
WORKDIR /var/www/html/
COPY ./package.json /var/www/html/
RUN npm install -g gulp-cli
CMD ["bash"]
so when I run
docker-compose up node
it returns
Container command 'sh' not found or does not exist.
Being that I understood the command command ran on the container (not the host), this should be fine? I have tried it with /bin/sh too and having the same problem. /bin/sh does exist, seems to be a sym link to dash if thats relevant? Looks identical to my linux host where this works fine.
Any ideas what is going wrong?
On a side note, anytime I use docker from a linux host it works like a dream, but windows I always lose hours wrestling with windows specific issues, npm installs dont seem to work properly or hang or take ages, issues with volumes not in my documents, etc. Is docker on windows / boot2docker fubar'ed or just me?
Runs fine for me on Windows 10 and Docker for Windows beta. I'd say either a outdated Docker setup or something is borked on your machine. If you are still running boot2docker try switching to Docker for Windows.
On a side note, anytime I use docker from a linux host it works like a dream, but windows I always lose hours wrestling with windows specific issues, npm installs dont seem to work properly or hang or take ages, issues with volumes not in my documents, etc. Is docker on windows / boot2docker fubar'ed or just me?
Well Windows always adds a bit of pain to almost anything :p, and in the early boot2docker days Windows support was quite buggy/incomplete, but with the latest Docker for Windows releases things are running pretty smooth now.
(posting this as answer since I don't have enough rep. to comment)
For some reason Docker attempts to run the command in the host instead of the guest. Since it says "container command" you may actually want to prepend it with "run", as in the online reference.
I'm using docker Version 1.11.1-beta11 (build: 6974) on OS X (which is native). It has a fancy migration tool to help you to move images from docker-machine to native docker (or something like that). Everything was working perfect, I even was able to start containers through docker-compose but then I rebooted my laptop and now docker-compose is not recognizing new docker engine I guess because I'm getting:
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
So I believe docker-compose still thinks I'm using or depending on docker-machine to start containers.
Any idea about how to workaround this issue?
Update:
Docker env variables:
DOCKER_TLS_VERIFY=1
DOCKER_HOST=tcp://192.168.99.100:2376
DOCKER_CERT_PATH=/Users/myuser/.docker/machine/machines/default
DOCKER_MACHINE_NAME=default
I removed the docker env variables from my rc script (~/.zshrc) and upgraded docker-compose version to 1.7.1. Also made sure sure docker-machine was down
Hey I tried running the command
sudo docker run -d -P training/webapp python app.py"
from the tutorial but I keep getting the error
FATA[0000] Error response from daemon: Cannot start container.
I downloaded the image fine but the trouble occurs whenever I try to run it. I checked the port sudo docker port (name) and nothing shows up. I'm guessing the issue is that the PORTS aren't being set up properly. I have a mac and I'm using vmware with ubuntu and I downloaded the ubuntu set up for docker.
Is there anyway to fix this? Any help would be greatly appreciated.