What’s New in Docker 1.13?
blog.docker.com
blog.docker.com
Docker outside of Linux is another story. I've run into config issues, VM memory problems, proxy issues, ect. Painful.
I don't even miss iterm2 anymore. i3 tiling WM is iterm2 for the whole desktop on steroids.
Working in VMs or containers adds a ton of complexity, for very little benefit.
Installing databases is trivial, with any of `brew`, `yum`, or `apt-get`.
Your `bin/setup` script can take care of automating that for onboarding new developers. The same script gets used in your Dockerfile.
And your CI system is there to as-perfectly-as-possible replicate production, to run your comprehensive test suite (you do practice TDD, right?) and catch things like "forgot to add a library dependency to the setup script" and "app broke because of a library version difference".
Since switching to local-only development, plus containers and CI/CD, my life has gotten a lot nicer.
The whole point of using docker containers is to have the same development experience locally, in CI and in prod.. not have some unknown system libraries on your box which don't match other environments.
Want a database? docker run mysql/mysql-server
Your argument for switching away from containers, seems to actually be arguing for using containers.
It's better to make the environment as close as possible to prod without adding massive inconvenience but docker both adds inconvenience and forces you to use it in production (which entails a whole other set of headaches) if you want close environmental parity, and even then, since it's lightweight virtualization there are hundreds of things which can behave differently between dev and prod.
IMHO you either want very close environmental parity (in which case full virtualization is the way to go) or you don't, in which case running locally is fine.
Plenty of people don't. The main reason being that staging is never quite the same as production...
It is, but I'm not particularly keen on docker as a solution to this problem. It provides a low level of isolation/realism for these services and the tooling surrounding it is relatively poor.
yes. For once database version and one single data set. If you handle multiple customers, multiple versions of a software suite to support which target specific versions of a DB, containers or VMs are handy.
I don't do my dev in a container. That always seemed stupid for me. But my dependencies are in containers.
We would love to see better virtualization disk performance so it is easier for non-team members to contribute. We're happy that despite that people are still able to contribute https://gitlab.com/gitlab-org/gitlab-ce/merge_requests?scope...
I mean that's basically why I moved my self hosted virtual servers from KVM, which was abysmal on regular desktop spinning disks, to LXC/Docker which is comparably fast to native -- plus I can fit a lot more containers than full VMs.
It makes a lot more sense now, thanks!
Here's the related thread on the docker forums. https://forums.docker.com/t/file-access-in-mounted-volumes-e...
They should just open source the whole thing so people could help fix issues or understand how and why it works.
Now that file just loves growing to 40 GB+ and there is no supported way to reclaim that space.
You can delete the file (or click Reset to factory defaults in the GUI), but then you loose all your Docker's storage, like data volumes.
That's one of the things addressed in the latest stable release. It now reclaims space on startup.
It's also likely impossible to make them work as expected on Windows where the host volume is NTFS and the container is Linux.
So don't use shared volumes for code.
At Convox we offer a Docker development environment in the "convox start" command.
We manage syncing code into the container by watching the host file system and periodically doing a "docker cp" to get source changes into the container.
It works great and shows the power of the Docker API for taking control of your containers.
A bit more info is available here: https://convox.com/guide/reloading/
http://docs.confluent.io/3.0.1/cp-docker-images/docs/intro.h...
/ # uname -a
Linux moby 4.9.4-moby #1 SMP Wed Jan 18 17:04:43 UTC 2017 x86_64 Linux
/ # mount | grep osxfs
osxfs on /Users type fuse.osxfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=1048576)
osxfs on /Volumes type fuse.osxfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=1048576)
osxfs on /tmp type fuse.osxfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=1048576)
osxfs on /private type fuse.osxfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=1048576)
osxfs on /host_docker_app type fuse.osxfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=1048576)I develop on a Macbook and push things to Linux Servers.
RUN this && that && thistoo && thattoo && rm this && rm that
in order to avoid generating extraneous layers.There have been some third party tools and registries that implement this feature, but it's nice to finally have it upstream.
When building apps, I keep a small number of shell scripts that live in a `bin` directory, that perform essential operational tasks.
One script installs all the dependencies required to either run or develop the app; another runs all tests and exits with either success or failure; and the final script just runs the app.
Docker then just runs those scripts, which are written deliberately to be easily read, and thus function as living documentation for the project.
These same scripts get used, both by developers on a daily basis, as well as by our CI/CD system when prepping containers.
This also makes onboarding a snap: you run `bin/setup`, and your Mac or Linux box is good to go. And, because that script gets used every time the CI system spins up a build, it will never go out of sync with reality.
I build a lot of modules within one of my Docker images for work, and while it doesn't change often, I would really not like to wait the 20 minutes if I really needed to push to production when I only change some certificate population segment at the end of the Dockerfile or something after a particularly intensive module build RUN step.
If you're copying your whole directory though the cache breaks if any file changes.
The normal way of doing it is to copy stuff like requirements.txt, package.json, Gemfile etc first and install stuff, then copy everything else at the end
One of the original benefits of containers is in its potential to reduce the disparity between dev and prod. If you're running containers based on the exact same image as dev and prod, then there are fewer reasons why something would only work on a dev machine.
If your devs are using containers correctly, and building candidate images on their own machines, then there's no need for separate bin scripts. If your devs need separate bin scripts so that they can avoid installing and using Docker on their own workstations, then you're throwing out a lot of the benefit which containers give you.
If you squash a single image I guess you will always push/pull the entire thing even if the system dependencies haven't changed.
Where this does mess things up is with content-addressable storage where if you have two layers from completely separate images that produced the same content, the layers would be shared, but not if you squash (because there is no layer).
RUN echo "this gets its own layer"
BEGIN
RUN echo "this will be squashed"
RUN echo "and this, too"
SQUASH
RUN echo "this gets its own layer again"
Similar to how BEGIN..COMMIT works in SQL.Docker desperately needs this, it's so frustrating constantly having full disk space due to untagged containers and unbounded volumes.
Looks like a bad release. Hopefully 1.13.1 is soon.
Apologies for the inconvenience this has caused.
There was a race condition in a previous release which could allow multiple hypervisor instances to open the Docker.qcow2 simultaneously. Unfortunately this can corrupt the file by allocating the same physical block (cluster) twice, resulting in bad things happening. When this file-locking bug was fixed we also added an integrity check which checks the structure of the Docker.qcow2 on every application launch. For safety the app refuses to start if corruption is detected.
I believe that in these cases, the corruption happened in the past and is now being detected since the upgrade. Unfortunately if the app refuses to start it makes it difficult to reach the "Reset to Factory defaults" menu option. The workaround described here https://github.com/docker/for-mac/issues/1159#issuecomment-2... is to remove the qcow2 and restart the app. Unfortunately containers and images will need to be rebuilt.
For what it's worth after the integrity check and the locking fix went in, I've not seen any recurrence of this error. Please open an issue if you see any other problems!
#!/usr/bin/env bash
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)> docker stack deploy --compose-file=docker-compose.yml my_stack
But there's no links to further documentation or anything. Can this be used to deploy easily to a cluster of Droplets for instance?
I feel like the low end/longtail deployment of Docker is really underserved. I want to use Docker for its devops merits, but I have yet to find a clear, concise guide for deploying a simple web app to one or a cluster of VPS instances for a modest traffic project.
100% worth giving it a shot, even just to say you've tried it.
I've been using Docker for over three years now, and Kubernetes really is the realization of what I imagined containers would be like when I was just starting to use them in development.
secret storage is not done - this is the bug tracking the Hashicorp Vault proposal https://github.com/kubernetes/kubernetes/issues/10439
The configuration scheme is not fixed yet - https://github.com/kubernetes/kubernetes/issues/10439
The game is still up in the air. While I'm bullish on Kubernetes, its still not the superior choice.
1. Service discovery.
When people say service discovery, they usually mean the ability for a given application to discover other copies of itself and other services & applications within a cluster.
Kubernetes has this down. It has it down better than almost any other system.
The "Service" object in the API can be used for in-cluster service discovery, the service-account tokens can be used as a powerful means of introspection and discovery, etc.
The things you link to are neither relevant. The first is about making api-servers more HA and federation better I think (unrelated to user's services) and the second is a proposal which is implemented, done, and didn't really catch on tbh. It's implemented because, well, it didn't propose any code changes on top of all the features services provide now, just some standard metadata users can opt in to adding if they want that sorta thing.
2. Secret storage
The Secret api object works great. It's done. Adding vualt support is an ongoing feature, but it is in no way a bug, it's just a feature request/enhancement. It's good that kubernetes is evolving, but that doesn't mean that the feature isn't already working.
Configuration scheme
You linked the same issue as before, typo I assume. I have no clue what you're talking about though. ConfigMaps are basically done. Downward API is nice. No clue what you think isn't "fixed".
Please quit it with your FUD. You obviously have no clue wtf you're talking about
I linked to bugs and proposals that we are discussing on various sigs on slack. even aspects of load balancers and Service abstraction are insufficient and im part of some of the discussions. secrets management being insufficient is the reason why there are suitable number of distributions with their own flavors of these.
Your terming of Service Discovery proposal as a HA is laughable. HA in apiservers has been production ready for quite some time and well integrated in kops and kargo. Etcd recovery is still a hassle. You are mistaking documentation being marked as available with it being actually usable in lifecycle.
Are you aware that full tls in kubernetes is hard because some values are hardcoded? this causes etcd breakage in lifecycles.
kubernetes is not complete - im very bullish on its future, but I would recommend you stick to technical refutal more than personal ire.
The first proposal you link is not anything that needs implementation.
Please, respond to my technical answers. You're not. Listen to your own words.
The standard Kubernetes setup instructions are horrible. You need to run a bunch of shell scripts including cluster/kube-up.sh, which are documented to work on AWS, but which are completely untested before release, and which were recently broken for almost a month.
I'm currently running Kubernetes under Rancher. It's still a pretty steep learning curve, with some very well-hidden but essential configuration parameters, but at least it actually works if you follow the instructions.
Even the "Kubernetes of Children" book made my head spin.
Convox - https://github.com/convox/rack
ECS CLI - http://docs.aws.amazon.com/AmazonECS/latest/developerguide/c...
Disclaimer: I work at Convox
> But there's no links to further documentation or anything. Can this be used to deploy easily to a cluster of Droplets for instance?
Yes! This is exactly what the Compose V3 format (now native to Docker CLI, as noted in the article) is intended for. It creates/manages native Docker swarm services (and networks, etc.).
The Docker official docs might take a minute to catch up in terms of Google indexing, etc., but you can always get the latest on GitHub to get a feel for what has changed from previous versions and/or how to learn Compose V3.
https://github.com/docker/docker.github.io/blob/master/compo... is a Markdown document outlining various Compose options. The main thing to keep in mind is that 'build' will not work as it has traditionally (use 'image' instead), and you gain additional access to a 'deploy' key to specify, e.g., number of "replicas" (indentical copies for scale) of a given container.
https://github.com/nathanleclaire/composeexample/blob/master... is a V3 version of the canonical Compose Redis + Python "page counter" app that may help to get the feel for things.
In general:
- 'docker deploy' will create or update a 'docker stack' (group of services) ('docker deploy' is shorthand/porcelain for 'docker stack deploy')
- 'docker stack' will allow you to manage these stacks (list, remove, etc.), created from Compose files
- 'docker service' will allow you to manage the individual services created (a service is a group of homogenous containers -- think 3 copies of a webapp intended to sit behind a load balancer)
Check out the '--help' text for each.
And, also like the mounted voluems issue, despite this being on of the top things on the forum, it's still been a problem for like 8 months with no attention.
Use Docker to setup development and production environments for a sample Flask application with CI/CD. https://news.ycombinator.com/item?id=13436452
BTW - Am I the only one finding the quality of the linked video very bad?
I thought 'df' is for free space, 'du' is for used space. Can anyone explain why the went for 'df', not 'du'?
du is for space used by particular files/directories.
Never looked back
Congrats to the docker team in the new release anyhow.
Do you you mean "create a long-lived LXC container and use distro's package manager to install packages as needed?" The problem with that approach is you have no idea how to duplicate the server, nor how to roll back the changes reliably. For example:
- Your distro upgraded a library, and the upgrade introduced a bug. For extra fun, this was not security upgrade so unattended-upgrade process did not install it, so only half of your servers have the bug.
- Your package list is incorrect. Somehow, your old server ended up with an extra package (previous software version? installed while trying to troubleshoot problems), and your new server does not have it.
- You have leftover files -- either from the previous version of your software, or from the package you have had installed before.
These are definitely fixable in LXC with enough effort -- after all, Docker is not magic, and you can achieve a lot with LXC + shell scripts, and even more with LXC + shell scripts + chef. However, Docker is just so much easier and reliable than writing these scripts by hand.
I went all in with Docker, it was all fun and games up until I tried it in production, and I started relying heavily on it.
Docker introduces container linking voodoo which have burnt me badly. Sure enough voodoo comes with its upsides, we now have Kubernetes which obviously I think is very cool. Just far outside of my use case.
Serenity now!