docker-machine creates new instances with the latest docker engine version.
Is it possible to specify the docker engine version?
The docker-machine create command has a --engine-install-url option. However I was not able to find version specific URLs (https://get.docker.com/).
From issue 2029, you should use the docker-machine create --virtualbox-boot2docker-url option instead.
You can see an example in issue 2195:
docker-machine create -d virtualbox --virtualbox-boot2docker-url=https://github.com/boot2docker/boot2docker/releases/download/v1.8.3/boot2docker.iso 183
Obviously, this would not work for more recent docker on Windows with HyperV.
Related
In my company we switched to Podman due to docker latest change in policies. My colleagues who use Windows with WSL2 switched seamlessly.
Me, who uses MacOs BigSur v.11.6.2 face the following issue:
$ podman machine init -v /Users:/mnt/Users
$ podman machine start
I get the following error
$ Starting machine "podman-machine-default"
$ INFO[0000] waiting for clients...
$ INFO[0000] new connection from to /var/folders/4z/9v__6yld4d7fzmbxm8trl1sh0000gn/T/podman/qemu_podman-machine-default.sock
$ Waiting for VM ...
$ qemu-system-x86_64: -virtfs local,path=/Users/Dimitrii_Meritsidi/Documents/spbh_exus/git/cdp_airflow_local_environment,mount_tag=vol0,security_model=mapped-xattr: There is no option group 'virtfs'
$ qemu-system-x86_64: -virtfs local,path=/Users/Dimitrii_Meritsidi/Documents/spbh_exus/git/cdp_airflow_local_environment,mount_tag=vol0,security_model=mapped-xattr: virtfs support is disabled
I have read that MacOs Bigsur doesn't support virtfs. What are the possible solutions here? I have found probable workaround with Vmware Fusion, however it is also on paid subscription.
The reason I need to use this mounting is because we use docker-compose.yml with volumes for launching local airflow.
try
podman machine init --volume /Users --volume /Volumes
To allow volume mounts on MacOS, podman machine needs to be created with access to the folder from which you are going to attempt to mount sub-folders, so it would have access to it.
Is likely that most MacOS users would only want to mount from within their home directory, so machine should be created like below:
podman machine init --now --cpus=4 --memory=4096 -v $HOME:$HOME
I wrote a guide for podman on macos at https://github.com/ansible/vscode-ansible/wiki/macos which you might find useful.
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.
I am using docker-machine on OS:X. I would like to install Docker 1.11.2 into my boot2docker machine, however it looks like the combination of docker-machine and boot2docker are always pulling the latest release of boot2docker.
I have tried replacing ~/.docker/machine/machines/default/boot2docker.iso with a manually downloaded iso matching 1.11.2, however this doesn't seem to actually change the version of docker.
I do not see anything listed in docker-machine documentation which suggests it to be possible to specify which iso or version of docker to use when creating the virtualmachine. I am using VirtualBox as driver.
How can I either downgrade the version of docker installed in my virtual machine or create a new one with a specific version installed?
When creating a new machine it is possible to specify where to get the boot2docker ISO from using the --virtualbox-boot2docker-url option. When doing that it will refrain from upgrading the machine to the latest version.
Example:
docker-machine create \
--driver virtualbox \
--virtualbox-memory 6144 \
--virtualbox-hostonly-cidr "10.10.10.1/24" \
--virtualbox-cpu-count "2" \
--virtualbox-disk-size "20000" \
--virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.12.2/boot2docker.iso \
default
It looks like there are two steps that need to happen to fully downgrade docker-machine.
First, download and replacing the boot2docker.iso file located at ~/.docker/machine/cache/boot2docker.iso. When you create a new docker-machine, it defaults to using the cached iso. Manually replacing it with whatever version iso you want is required.
This will then cause docker-machine to create the VM with the appropriate version of docker.
However, you also need to download a new version of docker toolbox in order to have the previous version for the client, as well. I am not sure how to navigate to older versions than the linked (1.11.2) but you can change the download url to whatever version you want and it seems some of them are still hosted.
Run the following following steps:
Check your docker version:
$ docker -v
Docker version 18.03.0-ce, build 0520e24
Download your docker version's of boot2docker (18.03.0-ce) from here into your local:
wget https://github.com/boot2docker/boot2docker/releases/download/v18.03.0-ce/boot2docker.iso -P ~/.docker/machine/cache/test/boot2docker-v18-03-0-ce.iso
Create the new_virtual_box_name using the downloaded version of boot2docker:
docker-machine create --driver virtualbox --virtualbox-boot2docker-url ~/.docker/machine/cache/test/boot2docker-v18-03-0-ce.iso new_virtual_box_name