LXC (LinuX Containers) is a OS-level virtualization technology that allows creation and running of multiple isolated Linux virtual environments (VE) on a single control host.
Docker, previously called dotCloud, was started as a side project and only open-sourced in 2013. It is really an extension of LXC’s capabilities.
Docker is developed in the Go language and utilizes LXC, cgroups, and the Linux kernel itself. Since it’s based on LXC, a Docker container does not include a separate operating system; instead it relies on the operating system’s own functionality as provided by the underlying infrastructure.
Docker acts as a portable container engine, packaging the application and all its dependencies in a virtual container that can run on any Linux server.
a VE there is no preloaded emulation manager software as in a VM.
In a VE, the application (or OS) is spawned in a container and runs with no added overhead, except for a usually minuscule VE initialization process.
LXC will boast bare metal performance characteristics because it only packages the needed applications.
the OS is also just another application that can be packaged too.
a VM, which packages the entire OS and machine setup, including hard drive, virtual processors and network interfaces. The resulting bloated mass usually takes a long time to boot and consumes a lot of CPU and RAM.
don’t offer some other neat features of VM’s such as IaaS setups and live migration.
LXC as supercharged chroot on Linux. It allows you to not only isolate applications, but even the entire OS.
Libvirt, which allows the use of containers through the LXC driver by connecting to 'lxc:///'.
'LXC', is not compatible with libvirt, but is more flexible with more userspace tools.
Portable deployment across machines
Versioning: Docker includes git-like capabilities for tracking successive versions of a container
Component reuse: Docker allows building or stacking of already created packages.
Shared libraries: There is already a public registry (http://index.docker.io/ ) where thousands have already uploaded the useful containers they have created.
Docker taking the devops world by storm since its launch back in 2013.
LXC, while older, has not been as popular with developers as Docker has proven to be
LXC having a focus on sys admins that’s similar to what solutions like the Solaris operating system, with its Solaris Zones, Linux OpenVZ, and FreeBSD, with its BSD Jails virtualization system
it started out being built on top of LXC, Docker later moved beyond LXC containers to its own execution environment called libcontainer.
Unlike LXC, which launches an operating system init for each container, Docker provides one OS environment, supplied by the Docker Engine
LXC tooling sticks close to what system administrators running bare metal servers are used to
The LXC command line provides essential commands that cover routine management tasks, including the creation, launch, and deletion of LXC containers.
Docker containers aim to be even lighter weight in order to support the fast, highly scalable, deployment of applications with microservice architecture.
With backing from Canonical, LXC and LXD have an ecosystem tightly bound to the rest of the open source Linux community.
Docker Swarm
Docker Trusted Registry
Docker Compose
Docker Machine
Kubernetes facilitates the deployment of containers in your data center by representing a cluster of servers as a single system.
Swarm is Docker’s clustering, scheduling and orchestration tool for managing a cluster of Docker hosts.
rkt is a security minded container engine that uses KVM for VM-based isolation and packs other enhanced security features.
Apache Mesos can run different kinds of distributed jobs, including containers.
Elastic Container Service is Amazon’s service for running and orchestrating containerized applications on AWS
LXC offers the advantages of a VE on Linux, mainly the ability to isolate your own private workloads from one another. It is a cheaper and faster solution to implement than a VM, but doing so requires a bit of extra learning and expertise.
Docker is a significant improvement of LXC’s capabilities.
The Docker server is a daemon that does all the heavy lifting: building and downloading images, starting and stopping containers, and the like. It exposes a REST API for remote management.
The Docker client is a command line program that communicates with the Docker server using the REST API.
interact with Docker by using the client to send commands to the server.
The machine running the Docker server is called the Docker host
Docker uses features only available to Linux, that machine must be running Linux (more specifically, the Linux kernel).
boot2docker is a “lightweight Linux distribution made specifically to run Docker containers.”
Docker server will run inside our boot2docker VM
boot2docker, not OS X, is the Docker host, not OS X.
Docker mounts volumes from the boot2docker VM, not from OS X
initialize boot2docker (we only have to do this once):
The Docker client assumes the Docker host is the current machine. We need to tell it to use our boot2docker VM by setting the DOCKER_HOST environment variable
"
OS.js is a JavaScript web desktop implementation for your browser with a fully-fledged window manager, Application APIs, GUI toolkits and filesystem abstraction."
Baseimage-docker only advocates running multiple OS processes inside a single container.
Password and challenge-response authentication are disabled by default. Only key authentication is allowed.
A tool for running a command as another user
The Docker developers advocate the philosophy of running a single logical service per container. A logical service can consist of multiple OS processes.
All syslog messages are forwarded to "docker logs".
Splitting your logical service into multiple OS processes also makes sense from a security standpoint.
Baseimage-docker provides tools to encourage running processes as different users
sometimes it makes sense to run multiple services in a single container, and sometimes it doesn't.
Baseimage-docker advocates running multiple OS processes inside a single container, and a single logical service can consist of multiple OS processes.
using environment variables to pass parameters to containers is very much the "Docker way"
add additional daemons (e.g. your own app) to the image by creating runit entries.
the shell script must run the daemon without letting it daemonize/fork it.
All executable scripts in /etc/my_init.d, if this directory exists. The scripts are run in lexicographic order.
variables will also be passed to all child processes
Environment variables on Unix are inherited on a per-process basis
there is no good central place for defining environment variables for all applications and services
centrally defining environment variables
One of the ideas behind Docker is that containers should be stateless, easily restartable, and behave like a black box.
a one-shot command in a new container
immediately exit after the command exits,
However the downside of this approach is that the init system is not started. That is, while invoking COMMAND, important daemons such as cron and syslog are not running. Also, orphaned child processes are not properly reaped, because COMMAND is PID 1.
Baseimage-docker provides a facility to run a single one-shot command, while solving all of the aforementioned problems
Nginx is one such example: it removes all environment variables unless you explicitly instruct it to retain them through the env configuration option.
Mechanisms for easily running multiple processes, without violating the Docker philosophy
Ubuntu is not designed to be run inside Docker
According to the Unix process model, the init process -- PID 1 -- inherits all orphaned child processes and must reap them
Syslog-ng seems to be much more stable
cron daemon
Rotates and compresses logs
/sbin/setuser
A tool for installing apt packages that automatically cleans up after itself.
a single logical service inside a single container
A daemon is a program which runs in the background of its system, such
as a web server.
The shell script must be called run, must be executable, and is to be
placed in the directory /etc/service/<NAME>. runsv will switch to
the directory and invoke ./run after your container starts.
If any script exits with a non-zero exit code, the booting will fail.
If your process is started with
a shell script, make sure you exec the actual process, otherwise the shell will receive the signal
and not your process.
any environment variables set with docker run --env or with the ENV command in the Dockerfile, will be picked up by my_init
not possible for a child process to change the environment variables of other processes
they will not see the environment variables that were originally passed by Docker.
We ignore HOME, SHELL, USER and a bunch of other environment variables on purpose, because not ignoring them will break multi-user containers.
my_init imports environment variables from the directory /etc/container_environment
/etc/container_environment.sh - a dump of the environment variables in Bash format.
modify the environment variables in my_init (and therefore the environment variables in all child processes that are spawned after that point in time), by altering the files in /etc/container_environment
my_init only activates changes in /etc/container_environment when running startup scripts
environment variables don't contain sensitive data, then you can also relax the permissions
Syslog messages are forwarded to the console
syslog-ng is started separately before the runit supervisor process, and shutdown after runit exits.
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"
/sbin/my_init --skip-startup-files --quiet --
By default, no keys are installed, so nobody can login
provide a pregenerated, insecure key (PuTTY format)
RUN /usr/sbin/enable_insecure_key
docker run YOUR_IMAGE /sbin/my_init --enable-insecure-key
RUN cat /tmp/your_key.pub >> /root/.ssh/authorized_keys && rm -f /tmp/your_key.pub
The default baseimage-docker installs syslog-ng, cron and sshd services during the build process
"Skia is an open source 2D graphics library which provides common APIs that work across a variety of hardware and software platforms. It serves as the graphics engine for Google Chrome and Chrome OS, Android, Mozilla Firefox and Firefox OS, and many other products.
Skia is sponsored and managed by Google, but is available for use by anyone under the BSD Free Software License. While engineering of the core components is done by the Skia development team, we consider contributions from any source.
"
"Nmap ("Network Mapper") is a free and open source (license) utility for network discovery and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, but works fine against single hosts. Nmap runs on all major computer operating systems, and official binary packages are available for Linux, Windows, and Mac OS X. In addition to the classic command-line Nmap executable, the Nmap suite includes an advanced GUI and results viewer (Zenmap), a flexible data transfer, redirection, and debugging tool (Ncat), a utility for comparing scan results (Ndiff), and a packet generation and response analysis tool (Nping)."
"eMotion est une application fonctionnant sur OS X destinée à écrire des interactions entre des objets et des informations. Elle se base sur des modèles physiques pour animer des situations. "
"This is a tool for powerful automation of OS X. At its core, Hammerspoon is just a bridge between the operating system and a Lua scripting engine. What gives Hammerspoon its power is a set of extensions that expose specific pieces of system functionality, to the user."
The San Francisco font by Apple used in the Apple Watch, iOS 9, and OS X El Capitan. Originally found at https://developer.apple.com/watchos/download/
如果沒Apple developer帳號,但需要安裝San Fancisco字型,可先使用
"tag is a command line tool to manipulate tags on Mac OS X 10.9 Mavericks files, and to query for files with those tags. tag can use the file system's built-in metadata search functionality to rapidly find all files that have been tagged with a given set of tags."
"AnyBar is a small indicator for your menubar that does one simple thing: it displays a colored dot. What the dot means and when to change it is up to you."