Docker for Mac and Windows Is Now Generally Available and Ready for Production
blog.docker.com
blog.docker.com
(1) docker can peg the CPU until it's restarted https://forums.docker.com/t/com-docker-xhyve-and-com-docker-...
(2) pinata was removed, so it can't be configured from CLI scripts https://forums.docker.com/t/pinata-missing-in-latest-mac-bet...
(3) it's not possible to establish an ip-level route from the host to a container, which many dev environments depend on https://forums.docker.com/t/ip-routing-to-container/8424/14
(4) filesystem can be slow https://forums.docker.com/t/file-access-in-mounted-volumes-e...
Are these fixed in stable? I'm personally stuck transitioning from docker-machine and (from the comments) it seems like other folks are as well...
Not sure about the others but the CPU isn't much an issue anymore. Maybe its just me being use to how bad it was.
For me, the definition of ready for production, Debian is a good example of the opposite end of Docker.
I've been using it on my laptop daily for a month or two now, and it's been great. Certainly much better than the old Virtualbox setup.
Docker.app has a very nice tray menu, I don't know or care anything about the VM it's running on, and generally is just better integrated to OS X. For instance, when I run a container, the port mapping will be on localhost rather than on some internal IP that I would always forget.
In Docker 1.11 they used VirtualBox to host a Linux Docker Image to run containers. In 1.12 they switched to Microsoft's Hyper-V.
Since the whole point of Docker would be to deploy these in production and not just for development, I don't see how the term 'ready for production' can be used. Isn't this just a beta?
Well, now I'm confused
It's not a tool to test Linux containers on Windows.
The deployment target for Docker containers for Windows will be a Windows OS.
Real native Windows containers and a Docker shim to manage them are coming: [1] but not released yet.
[1] https://msdn.microsoft.com/en-us/virtualization/windowsconta...
Unless something has changed since the last time I checked, The WindowsServerCore docker image was not generally available yet and requires server2016 (I think it was TP6 the last time I checked)
Docker, to my knowledge, is still exclusively Linux flavors. (Though I'm happy to be corrected if someone knows more than me)
[0]: https://msdn.microsoft.com/en-us/virtualization/windowsconta...
Super exciting! Thanks for the comment.
The sales pitch I usually give people is that any ops person can read a Dockerfile, but most devs can't figure out or help with vagrant or chef scripts.
But it's a hell of a lot easier to get and keep repeatable builds and integration tests working if the devs and the build system are using docker images.
They help you build and run containers locally, but when it comes time to deploy you send the container image to those other platforms.
Using docker like that is like running a production rails app with "rails s"
Over large layers: Don't run bloated images with all your build tools. Run lightweight base images like alpine with only your deployment artifact. You also shouldn't be writing to the filesystem, they are designed to be stateless.
And the fact that nobody involved in Docker is old enough to remember that half of the exploits against CGI involved exposing environment variables, not modifying them.
You create a secret and then that secret can be mounted as a volume when the container runs, it never gets captured in a layer.
Also CGI exploits exposing env vars would work just as well on a normal non-container instance would they not?
Yes, you can capture runtime secrets in your layers, but it's pretty obvious to everyone when you're doing that and usually people clue in pretty quickly that this isn't going to work.
Build time secrets are a whole other kettle of fish and a big unsolved problem that the Docker team doesn't seem to want to own. If you have a proxy or a module repository (eg, Artifactory) with authentication you're basically screwed.
If you only had to deal with production issues there are a few obvious ways to fix this, like changing the order of your image builds to do more work prior to building your image (eg, in your project's build scripts), but then you have a situation where your build-compile-deploy-test cycle is terrible.
Which would also be pretty easy to fix if Docker weren't so opinionated about symbolic links and volumes. So at the end of the day you have security-minded folks closing tickets to fix these problems one way, and you have a different set that won't provide security concessions in the name of repeatability (which might be understandable if one of their own hadn't so famously asserted the opposite http://nathanleclaire.com/blog/2014/09/29/the-dockerfile-is-... )
I like Docker, but I now understand why the CoreOS guys split off and started building their own tools, like rkt. It's too bad their stuff is such an ergonomics disaster. Feature bingo isn't why Docker is popular. It's because it's stupid simple to start using it.
One example is the work we've experimented with in OpenShift to implement Dockerfile build outside of the Docker daemon with https://github.com/openshift/imagebuilder. That uses a single container and Docker API invocations to execute an entire Dockerfile in a container, and also implements a secret-mount function. Eventually, we'd like to support runC execution directly, or other systems like rkt or chroot.
I think many solutions like this are percolating out there, but it has taken time for people to have a direct enough need to invest.
All your remaining points are vague at best.
The only major contentious issue I can recall was the systemd-as-default-init discussion, but that was expected.
You gripe about kernel 3.16 LTS but provide no support for your statement. With a cursory search I can't find any. If it was such a big deal I have to assume I would. For my part I use Jessie on the desktop and server and have not encountered these mysterious kernel problems of which you complain. Again, you may have wished for some reason that they shipped with 3.18 or 4.x, but they shipped. They have 10 official ports and 20K+ packages to deal with, I'm sorry they didn't release with your pet kernel version. Again, those who know what they are doing can upgrade jessie's kernel themselves if they are wedded to the new features.
So, massive steps backwards?
It is not fair to compare Docker with Debian. Docker Inc (who backed Docker) is a for-profit corporation and is backed by investors. It is understandable why they need to push their products into production the soonest time possible.
"Production ready" in the "container space" for me are Solaris Zones, FreeBSD Jails, and to an extent lxc (it's stable, but I've used it less). I like what Docker/Mesos/etc. bring to the table, but when working with the ecosystem, it takes work to stay on top of what is going on.
It is even harder to consult with a customer or company interested in containers and give the most accurate near/long term option. It becomes a discussion in understanding their application, what approach works now, and guidance for what they should consider down the road.
Networking and Storage are two areas with a lot of churn currently.
This means what it's always meant: that the company believes the sum they'll make by convincing people it's "production ready" is greater than the sum they'll lose from people realizing it isn't.
Keep in mind the optimal state of affairs for Docker Inc. is one where everyone is using Docker and everyone requires an enterprise contract to have it work.
Which basicly gets down to when your CTO/CEO or some manager comes in preaching docker - we should be doing that, why arn't we has one less argument to dismiss it now than before.
Yes many aspects need improving but case of what is there is deemed to of gained enough run-time in environments to be deemed stable enough to say, we can support this in production for off the shelf usage without you needing lots of grey-bearded wizards to glue it all in place and keep it that way.
One thing I found, was to be a little more cautious about what host volumes you mount into a container: for a Symfony project, mounting `src` instead of the whole folder sped up the project considerably, as Symfony's caching thrashes the file-system by default.
On linux and OSX with docker-machine this is easy with:
docker run --add-host host:ip.for.docker.interface foo
But there is no equivalent to the docker0 interface or the vboxnet interface for Docker.app.EDIT: I don't use this for any production environments, but it is very useful for debugging and testing.
HOST_IP=$(/sbin/ip route | awk '/default/ { print $3 }')I'll give it a try if I evaluate Docker.app again.
It's super simple through Vagrant though, just vagrant up and set DOCKER_HOST to the static IP. Plus there are vagrant plugins that let you sync a directory to the vm in a way that gives you inotify events so live build/update tools can run in your containers (which btw is huge, I can't believe the official apps haven't even attempted to address that, as far as I've seen).
If you don't mind, what are these plugins? This is one thing that's sorely missed when I do development with Vagrant. I did a small amount of searching and trial and error, but couldn't find a solution that worked for me.
Also if you use a native Linux host with LXC or Docker there is no overhead for sharing directories with the container, it's just a bind mount.
While Docker for Mac has improved somewhat over the beta, unfortunately it's still quite rough. For example, it was only last week that they pushed a fix for the DNS timeout issue [1] (I think maybe it was fixed? I can't check because Docker for Mac is not open source).
[0] https://blog.docker.com/2016/03/docker-for-mac-windows-beta/
[1] https://forums.docker.com/t/intermittent-dns-resolving-issue...
Basically, if you can live with the shortcomings a release has (bugs, performance, lack of features) you can use it in production as long as it's stable (and secure).
The other aspect that it may be is a long-running Docker.app -- since as developers we are frequently killing and restarting the application, it could happen after a period of time. I've now got two laptops that I work on, and one of them has no Homebrew or developer tools installed outside of containers, and runs the stable version of Docker.app that's just been released. If this can trigger the bug, we will hunt it down and fix it :-) In the meanwhile, if anyone can trigger it and get a backtrace of the com.docker process, that would be most helpful. Bug reports can go on https://github.com/docker/for-mac/issues
Host container socket sharing will come, but it is complex as sockets only exist with in a single operating system, so we have to bridge them across two. We are using this for the docker socket, and debugging the issues across Mac and Windows, so it is in the roadmap.
sudo ifconfig lo0 alias 10.254.254.254
And setting the remote host to 10.254.254.254 instead of localhost inside the container to work around that issue. It's been working pretty well.
I've been using the Beta version of Docker for Mac for many months and haven't had many issues with it at all. The biggest issue I've seen was the QCow file not releasing space and growing to 60+GB, but deleting it and restarting Docker did the trick (although I had to rebuild or repull any containers).
> There are several other threads on this topic already. Setups that docker build an image and rely on in-Docker storage work well; setups that rely heavily on bind-mounting host directories do not. A complex npm install in a bind-mounted directory breaks Docker entirely, according to at least one thread here.
https://forums.docker.com/t/just-switched-over-from-dlite-cp...
I'm don't have a firm opinion on what is or isn't 'production ready', but if there are major bugs, then there should be some way of disseminating that information instead of everyone rediscovering the same issues.
With unison+unox you have full transparent sync while having native performance (no performance loss at all). This is far better the osxfs or nfs.
FYI, I was using rc4 and I didn't see any information on how to upgrade (should I uninstall first?). I ran the release setup and it did an in-place upgrade, deleting earlier components and such.
We have been using Vagrant and VirtualBox heavily and the new Docker for Windows/Mac is making us reconsider that since you can't easily use more than one hypervisor on the same dev machine without some hassle. We might be building our Vagrant boxes for these other hypervisors soon. VirtualBox still seems easier to work with but there isn't anything much exciting happening with it lately.
Let's see...
(Yes, I know there theoretically exist different Vagrant backends, but Vagrantfiles and public images are married to specific backend so all the reasons to use Vagrant tie it to VB)
I think when Windows Nano Server is available I'll give it a try, my Win7 image is almost 70GB...
This is another case of simple solutions win... You can effectively rsync code changes without all the low level file system madness.
Can I run any linux-based container on Windows? Can I run (are there any?) windows-based containers? If so, does it work the other way around: windows container on linux host? Does it somehow use the recently published Linux Subsystem for Windows, or is it completely different compatibility layer? If it is different, doesn't it seem like a waste of effort?
No, on windows you still have to run a Linux vm which the containers will run inside. Meaning all containers actually run on a Linux host. The new Docker for Windows app only abstract away some stuff so it feels easier working with.
> does it work the other way around
No
I don't think, that's correct. To me that's the whole point of having a native Windows / Mac version of docker. From their feature list:
> Faster and more reliable – native development environment using hypervisors built into each operating system. (No more VirtualBox!)
The quoted part is that instead of VirtualBox one can use Hyper-V. In either case, it's handled by docker-machine which runs a GNU/Linux VM with Docker (host) tools installed, and containers are ran on that VM.
I would be surprised if there aren't plans to support WSL (to run Linux-targetting binaries on Windows "natively", thus have "native" Docker containers) but don't think that's available yet.
You could also have dockerfiles that take a base image and then add some environment specific configuration
IMHO it's better to keep the images identical across environments, and pass runtime configuration when deploying
docker run -it -v /private/etc/passwd:/etc/passwd alpine sh (not recommended for any actual use obviously)
Is there a particular case in which this failed for you? We'd appreciate a bug report on https://github.com/docker/for-mac/issues (or from the Docker for Mac GUI, just click on "Diagnose and Feedback") so we can chase down whatever issue you're having.
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: oci runtime error: rootfs_linux.go:53: mounting "/var/lib/docker/aufs/mn t/90d24356afdeb7b9ddad4b3b6903be92063151c33bf34f3d63ede464437060c6/cryptoservice/broker-config.yml" to rootfs "/var/lib/docker/aufs/mnt/90d24356afdeb7b9ddad4 b3b6903be92063151c33bf34f3d63ede464437060c6" caused "not a directory".
(I'm mounting broker-config.yml and that file is already present in the container. Most recent Docker for Win beta in this case, but getting the same on non-beta Docker for Mac.)
With that said Docker has plans to open source it, I wonder if that will happen soon as they declare Docker for Mac ready for production. That would imply that the xhyve port also should be ready be contributed back or spin out into a new project (the quote below said they were not sure if they wanted to contribute back or make a new project).
Personally I think the "right thing to do" would be to contribute back to xhyve, at the same time I have a feeling it's more valuable for Docker Inc to "own" and control their own fork/project so I would guess they will go down that path instead (it would still be open source, just under a different project name).
Source: https://news.ycombinator.com/item?id=11356293
EDIT: I stand corrected, see talex5 comment below, I had missed the hyperkit announcement.
https://github.com/docker/hyperkit
Source: https://blog.docker.com/2016/05/docker-unikernels-open-sourc...
Your best option for nested virtualization seems to be qemu, but you don't need virtualization for Docker on Linux so it's pointless.
VirtualBox doesn't support nested virtualization either.
I'm also curious about other uses for it. Why is it a must have when you could technically just use a virtual windows xp system. I guess running a legacy application in a more secure and newer OS?
:(
If you didn't want to use Windows 10, perhaps you might have some more luck with a Windows Server OS. Does anyone know if the latest version of Docker will work on Windows Server 2012?
[1]: http://www.howtogeek.com/196158/how-to-create-and-run-virtua...
I'm curious what some of these valid reasons are - why would you have a large image instead of a minimal image with all the data linked out?
https://msdn.microsoft.com/en-us/virtualization/hyperv_on_wi...
Microsoft really needs to get its act together.
"If it ain't broke, then don't fix it" is a motto I live by.
Better it's your blood on the bleeding edge rather than mine :-)
- docker-compose isn't OS agnostic and as versions go forward Windows is lagging behind
- this uses Hyper-V which blocks both Virtualbox and Vmware from running
sudo launchctl unload /System/Library/LaunchDaemons/org.ntp.ntpd.plist
If I see that "We are whaly happy to have you" welcome screen one more time though...That's a pretty significant change in my mind but it didn't seem to extend their testing/validation timeline at all.