I'm following this tutorial from the Docker Compose docs : https://docs.docker.com/compose/gettingstarted/
I'm at Step 4- Build and run your app with Compose
However, whenever I type in
docker-compose up
I get the following error:
ERROR: Couldn't connect to Docker daemon - you might need to run docker-machine start default.
So I tried
docker-machine start default
and I got the following error
Host does not exist: "default"
And on running docker-machine ls I get
ubuntu#thething:~/composetest$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
So I tried
ubuntu#thething:~/composetest$ docker-machine create --driver default
Driver "default" not found. Do you have the plugin binary "docker-machine-driver-default" accessible in your PATH?
I've googled a lot, but can't find something specific for Ubuntu. Please help!
Related
I am trying to setup ddev along docker and docker-compose on Mac OS 10.12.6 by running command inside project folder which is already set up ddev. I am setting up https://github.com/mautic/mautic this project over my local machine.
ddev start
Error I am getting is
ERROR: for ddev-mautic-db Cannot create container for service db: invalid mount config for type "bind":
bind source path does not exist: /Library/WebServer/Documents/codebase/mautic/.ddev
ERROR: for db Cannot create container for service db: invalid mount config for type "bind":
bind source path does not exist: /Library/WebServer/Documents/codebase/mautic/.ddev
Encountered errors while bringing up the project.'
I have set up by following command
docker-machine create --driver virtualbox default
$ docker-machine env default
$ eval "$(docker-machine env default)"
Totally new to docker and ddev didn't find answer which can help me to solve.
Any help will be appreciated!
I've never used docker toolbox on the mac, but on Windows with Docker Toolbox, only your home directory is shared by default. It looks like you have the project in /Library/WebServer/Documents, which is not your home directory. I recommend that you either put the project in your home directory or research how to share /Library/Webserver/Documents with Docker Toolbox. I think you'll likely find some answers about this here: https://www.google.com/search?q=docker+toolbox+shared+drives+macos&sxsrf=ALeKk00SOQVEtAU9hFcHPoxV75aJoMcWgQ%3A1621959319429&ei=lyKtYL_OGcqttQaEnI2ABg&oq=docker+toolbox+shared+drives+macos&gs_lcp=Cgdnd3Mtd2l6EAMyBQgAEM0COgcIIxCwAxAnOgcIABBHELADOgYIABAWEB46CAghEBYQHRAeOgcIIRAKEKABOgUIIRCrAlCoc1jsgQFgh4QBaAFwAngAgAHrAogB9AeSAQcxLjUuMC4xmAEAoAEBqgEHZ3dzLXdpesgBCcABAQ&sclient=gws-wiz&ved=0ahUKEwj_9cuoneXwAhXKVs0KHQROA2AQ4dUDCBE&uact=5
Please note that Docker Toolbox on Mac has never been tried by anybody else to my knowledge. Also note that you can download ancient versions of Docker Desktop from https://docs.docker.com/docker-for-mac/release-notes/
I'm working with a poor internet connection and trying to pull and run a image.
I wanted to download one layer at a time and per documentation tried adding a flat --max-concurrent-downloads like so:
docker run --rm -p 8787:8787 -e PASSWORD=blah --max-concurrent-downloads=1 rocker/verse
But this gives an error:
unknown flag: --max-concurrent-downloads See 'docker run --help'.
I tried typing docker run --help and interestingly did not see the option --max-concurrent-downloads.
I'm using Docker Toolbox since I'm on a old Mac.
Over here under l there's an option for --max-concurrent-downloads however this doesn't appear on my terminal when typing docker run --help
How can I change the default of downloading 3 layers at a time to just one?
From the official documentation: (https://docs.docker.com/engine/reference/commandline/pull/#concurrent-downloads)
You can pass --max-concurrent-downloads during a pull operation.
You can set --max-concurrent-downloads with the dockerd command.
If you're using the docker Desktop GUI for Mac or Windows:
You can edit the .json file directly in docker engine settings:
This setting needs to be passed to dockerd when starting the daemon, not to the docker client CLI. The dockerd process is running inside of a VM with docker-machine (and other docker desktop environments).
With docker-machine that is used in toolbox, you typically pass the engine flags on the docker-machine create command line, e.g.
docker-machine create --engine-opt max-concurrent-downloads=1
Once you have a created machine, you can follow the steps from these answers to modify the config of an already running machine, mainly:
SSH into your local docker VM.
note: if 'default' is not the name of your docker machine then substitute 'default' with your docker machine name $
docker-machine ssh default
Open Docker profile $ sudo vi /var/lib/boot2docker/profile
Then in that profile, you would add your --engine-opt max-concurrent-downloads=1.
Newer versions of docker desktop (along with any Linux install) make this much easier with a configuration menu daemon -> advanced where you can specify your daemon.json entries like:
{
"max-concurrent-downloads": 1
}
I'm working with a poor internet connection and trying to pull and run a image.
I wanted to download one layer at a time and per documentation tried adding a flat --max-concurrent-downloads like so:
docker run --rm -p 8787:8787 -e PASSWORD=blah --max-concurrent-downloads=1 rocker/verse
But this gives an error:
unknown flag: --max-concurrent-downloads See 'docker run --help'.
I tried typing docker run --help and interestingly did not see the option --max-concurrent-downloads.
I'm using Docker Toolbox since I'm on a old Mac.
Over here under l there's an option for --max-concurrent-downloads however this doesn't appear on my terminal when typing docker run --help
How can I change the default of downloading 3 layers at a time to just one?
From the official documentation: (https://docs.docker.com/engine/reference/commandline/pull/#concurrent-downloads)
You can pass --max-concurrent-downloads during a pull operation.
You can set --max-concurrent-downloads with the dockerd command.
If you're using the docker Desktop GUI for Mac or Windows:
You can edit the .json file directly in docker engine settings:
This setting needs to be passed to dockerd when starting the daemon, not to the docker client CLI. The dockerd process is running inside of a VM with docker-machine (and other docker desktop environments).
With docker-machine that is used in toolbox, you typically pass the engine flags on the docker-machine create command line, e.g.
docker-machine create --engine-opt max-concurrent-downloads=1
Once you have a created machine, you can follow the steps from these answers to modify the config of an already running machine, mainly:
SSH into your local docker VM.
note: if 'default' is not the name of your docker machine then substitute 'default' with your docker machine name $
docker-machine ssh default
Open Docker profile $ sudo vi /var/lib/boot2docker/profile
Then in that profile, you would add your --engine-opt max-concurrent-downloads=1.
Newer versions of docker desktop (along with any Linux install) make this much easier with a configuration menu daemon -> advanced where you can specify your daemon.json entries like:
{
"max-concurrent-downloads": 1
}
I created a sample microservice application with war file. After that I installed Docker tool box. Then I created sample Dockerfile and trying to build image using Docker toolbox quick start terminal.
I changed directory to project root directory, and ran the following command:
docker build -t "dockerDemo" .
And getting error like Docker daemon is not running.
And also I run the following commands:
docker run hello-world
docker-machine ls
I am getting following results screens.
I am now just started with containers and Docker concept. How can I solve this?
According to your screenshots, it's a pretty common issue. Unfortunately the only solution is to remove the vm and recreate it. You can find more details in this issue.
$ docker-machine rm default
$ docker-machine create --driver virtualbox default
Delete de Docker toolbox virtualbox vm. It is usually named "default". Close and open again the docker console, it will create again the vm automatically. Then try again.
After (successfully, I believe) installing the Docker Toolbox, I get the following error:
$ docker ps
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
Also, when I try to run the docker quickstart terminal, it just prints the following error:
Docker Machine is not installed. Please re-run the Toolbox Installer and try aga
in.
Looks like something went wrong in step 'Looking for vboxmanage.exe'... Press an
y key to continue...
I searched through the docker troubleshooting but didn't find any hint.
I tried installing the toolbox both with and without checking the "Install VirtualBox with NDIS5 driver [default NDIS6]" checkbox.
Try this,
Check if the docker machine exists. Command to check this below.
docker-machine ls
If you still get error then execute step 2 below. If you see any machine listed and it has STATE stopped then execute docker-machine start machine_name eg. docker-machine start default
This step helps you to create a docker-machine.
docker-machine create --driver virtualbox default
I also face some problems like you and I troubleshoot the problem with the following steps in window 8.1.
Install Docker Toolbox
REGENERATE CERTIFICATES
$ docker-machine regenerate-certs default
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Create new machine default
$ docker-machine create default
Note: It may take a few minutes for downloading boot2docker.iso file.
UPGRADE docker-machine (Optional)
$ docker-machine upgrade
START Docker Quickstart Terminal (or) Run start.sh file under the location => C:\Program Files\Docker Toolbox
RUN HELLOWORLD
$ docker run hello-world
I hope it will help you :-)