NamespaceWhat it isolatesWhat the process seesPIDProcess IDsOwn process tree, starts at PID 1MountFilesystem mount pointsOwn mount table, can have different rootNetworkNetwork interfaces, routingOwn interfaces, IP addresses, portsUserUID/GID mappingCan be root inside, nobody outsideUTSHostnameOwn hostnameIPCSysV IPC, POSIX message queuesOwn shared memory, semaphoresCgroupCgroup root directoryOwn cgroup hierarchyTimeSystem clocks (monotonic, boot)Own system uptime and clock offsetsNamespaces are what Docker containers use. When you run a container, it gets its own PID namespace (cannot see host processes), its own mount namespace (own filesystem view), its own network namespace (own interfaces), and so on.
To test this I built gitgres, about 2,000 lines of C implementing the libgit2 git_odb_backend and git_refdb_backend interfaces against Postgres through libpq, plus roughly 200 lines of PL/pgSQL for the storage functions. libgit2 handles pack negotiation, delta resolution, ref advertisement, and the transport protocol while the backend reads and writes against the two tables, and a git remote helper (git-remote-gitgres) lets you add a Postgres-backed remote to any repo and push or clone with a normal git client that has no idea it’s talking to a database. There’s a Dockerfile in the repo if you want to try it out without building libgit2 and libpq from source.
。关于这个话题,同城约会提供了深入分析
parakeet::AOSCCache aosc_cache(4); // max 4 speakers
Copyright © ITmedia, Inc. All Rights Reserved.