How to install only Docker client on MacOS? - macos

Docker can work decently remotely by defining DOCKER_HOST variable but now I do want to avoid installing the fat Docker for MacOS which also installs and starts the docker engine on a VM, one that seems to consume resources.
As docker work remotely it should continue to be able to build images, list images, start and stop them without having a docker servic/vm mac.
How can I do this? (docker cli seems to be come only with the entire cow).

I guess you are looking for install-client-binaries-on-macos.
Docker company afford some prebuilt binary, just download here, unpackage it, then you will find a standalone docker client binary there, copy it to your mac, out of the box for use.

There seems to be no install of the client only; but after installing the fat cow, you can tell it to stay off your grass by unchecking Start Docker Desktop when you log in in the preferences, and then shut down the Docker server.
That's what I do, and when I need docker locally I just start and then after using it, I shut it down again.

Related

Cannot find the docker container running on port 80, tried everything usual

What happened:
I ran a container (vuejs-build website on a httpd:2.4) from shell (oh my zsh) on mac OS 11.2.2 using the previous docker release.
Then I updated the mac OS docker desktop.
Now the container is running but it's not showing on docker ps -a or docker container ls -a. I cannot find the process no matter what I try. Tried all the ps aux commands with grep, all lsof -wahtever, finding it in activity tool on mac. Even restarting the mac or stopping docker deamon does not stop it.
Has anybody a clue how to find it? I can open and refresh the webpage that is running in the container.
Docker version now says: Docker version 20.10.5, build 55c4c88.
PLEASE HELP!!
I solved it myself:
The container was stuck but restart seemed to have actually killed it.
However:
I realized that assets such as images are not being loaded despite JS and CSS is.
So I tried starting another httpd instance with docker run -p 80:80 httpd and reloaded. Firstly the same site as before appeared. But being able to start another httpd got me thinking.
The I opened dev tools in my browser. That disables Cache (using Chrome). Another hit on refresh then showed the "It works" page from httpd.
Some researching gave me the following theory: Vuejs stores the compiled Markup, JS and CSS on your browsers persistence storage. Probably for performance.

How to download Docker CLI only for Windows 7

I'm using Windows 7 Pro and have existing shared Docker engine running on a Linux. I would like to use my workstation (with development environment) to access shared Docker engine.
Does someone know how to retrieve Docker client only for Windows 7 ? I have no admin privilege, so I can't install Docker Toolbox.
Older Clients can be found here https://download.docker.com/win/static/stable/x86_64/
And here a some newer Builds by Stefan Scherer (Docker employee) https://github.com/StefanScherer/docker-cli-builder.
Just download docker.exe and add it to your windows path variable.
Then set your DOCKER_HOST variable to define against which Docker daemon you want to speak.
The official Downloads have finally been published:
Mac CLI binaries are available at
https://download.docker.com/mac/static/stable/
Windows CLI (and daemon) binaries at https://download.docker.com/win/
Linux CLI packages are available for each distro as docker-cli (deb and rpm) packages: https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/
From: https://github.com/docker/cli/issues/2281#issuecomment-947699400
Although docker provides a REST-like API, there aren't many clients for it. A quick google turned up one on github, but ymmv. Even if you did find one, you're likely to run into the same problems involved in running docker-ce locally anyway.
There are a handful of gui clients that you could run on that engine and access with a browser, but if you are specifically after a cli you're SOL with this.
If you have an ssh client (git bash, or putty, or something), and you can arrange to run a bastion container on the engine, then you could run a container to ssh into and use that as if it's your local machine. You'd still have to scp resources onto it, but you'll eventually have to solve that problem anyway. Something like:
sudo docker container run --interactive --tty -v /var/run/docker.sock:/var/run/docker.sock image
Where 'image' is a linux image with an ssh server and appropriate keys, git, and docker installed. You could mount a local volume for persistence, or you could just keep everything in git.

Docker can not run on Windows 10 linux child system

I just install the Windows 10 Anniversary update which has a new feature that linux child system. So I try to run docker in Windows 10 ubuntu bash(linux child system). Why I want to install docker in linux child system is because:
Windows 10 native docker 1.12 need Hyper-V, but Vmware couldn't run if Hyper-V enable. I have a lot images created by Vmware, it isn't so easy to switch to Hyper-v
I don't want to use Docker Toolbox, it need install VirtualBox, just redunant.
apt-get is fine, docker install success, but fail to start.
$ sudo service docker start
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
* Starting Docker: docker [ OK ]
$ docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
I have seen this post can-you-run-docker-natively-on-the-new-windows-10-ubuntu-bash-userspace, some people says that it is no posible to run docker in such linux child system, but there also some contrary opinions.
So, I want to ask is there any way to walk around this? Or I have to wait MS update this child system(since it is still beta now).
You have two Problems in there:
the linux child system does not provide the upstart service like e.g. ubuntu. You can work around this by running the docker deamon directly in foreground with docker daemon ...
This does nearly shure not work because docker requires features of the linux kernel like namespaces and capabilities. I don't think the NT-Kernel does implement such exotic features.

Run a docker container in Windows

I have a Linux x86 application inside a docker container and I want to run it under Windows. I don't want to force users to install Virtual Box. Ideally a qemu or similar virtualization tool can be used, since it is very tiny and requires no installation at all.
My approach was to use qemu for Windows and
boot2docker, so I can boot a minimal Linux with docker installed and than run my docker container within it.
This is the command I'm using to run it:
qemu-system-x86_64.exe -m 256 -cdrom boot2docker.iso
The boot goes well, but I have several problems:
at every boot the image goes trough all the configuration steps (generating keys for ssh, setting hostname, etc.) that can be skipped the second time the image runs; seems that the changes to the image are not persisted trough runs. I want to build an image that is already configured and needs only to boot;
to add my application inside the image I have to rebuild the whole boot2docker.iso image by using the steps described in How to build boot2docker.iso locally.
So, the question is: how can I use the base boot2docker.iso image and add some persisting data (such as configurations and my application)? Perhaps a read/write partition mounted from another file?
like the idea.
Maybe you can check MobaliveCD, it has a nice lightweight GUI and it embeds qemu system inside. I tried it for tinycore live cd iso (base of boot2docker), which works quite ok.
While it seems it doesn't support 64bit (which boot2docker needs), but the function fits for you need.
Your command
qemu-system-x86_64.exe -m 256 -cdrom boot2docker.iso
launches an ISO, what you want is
reserve some disk place for this iso in a .img
run this iso and install it in this .img
reboot
In a Linux you would start by doing
qemu-img create -f qcow2 /home/myuser/my_image.img 6G
There is docker-cli for Windows, it seems to be what you look for, see
http://azure.microsoft.com/blog/2014/11/18/docker-cli-for-windows-clients/
You can use boot2docker http://boot2docker.io/
On boot2docker installation, it will install virtualbox behind the scenes.
You only have to start the boot2docker shortcut and the virtual box management and vms are hidden.

boot2docker on windows missing apt-get / package manager

I'm in boot2docker. I'm not entirely sure I understand it completely, but it seems to be needed for a project I'm on.
I've ssh'd in, and I tried to do a make on our project, but I got
make: not found
Then I tried a:
apt-get install make
And got
apt-get: not found
Tried googling, but couldn't find anything about that, or any package manager.
Any suggestions on how to install anything in boot2docker?
EDIT:
When I asked this I misunderstood how boot2docker and docker worked hand in hand. There is actually a package manager (tce-load) that allows install of packages, but really, it shouldn't be used and anything involving a project using docker should be using a docker container within boot2docker that has the build tools inside of that. Although I did find tce-load useful installing nano, since I'm not a fan of vi and that's occationaly useful.
Seems boot2docker uses Tiny Linux which has its own package manager called "tce-load". There's a list of packages for it here:
http://distro.ibiblio.org/tinycorelinux/tcz_2x.html
There's everything that's needed to make or whatever located there.
You should not be installing anything on the boot2docker vm as that gets deleted and reset often. You should install any tools inside a docker container running on the boot2docker vm.
Only linux can run docker so when running on osx or windows you must use boot2docker. boot2docker is just running a linux vm that has docker installed. Once you are using boot2docker you use docker like you would normally.
The boot2docker vm is not where you should be installing things, what you should be doing is running a container that has the programs you need installed. This can be accomplished by finding a useful image from the docker registry or by making your own docker image.

Resources