1. Project Overview & Quickstart (microsoft/docker)
File: api/README.md
This directory contains code pertaining to the Docker API:
Used by the docker client when communicating with the docker daemon
Used by third party tools wishing to interface with the docker daemon
File: contrib/builder/rpm/amd64/README.md
`dockercore/builder-rpm`
This image's tags contain the dependencies for building Docker .rpms for each of the RPM-based platforms Docker targets.
To add new tags, see contrib/builder/rpm/amd64 in https://github.com/docker/docker, specifically the generate.sh script, whose usage is described in a comment at the top of the file.
File: contrib/builder/deb/amd64/README.md
`dockercore/builder-deb`
This image's tags contain the dependencies for building Docker .debs for each of the Debian-based platforms Docker targets.
To add new tags, see contrib/builder/deb/amd64 in https://github.com/docker/docker, specifically the generate.sh script, whose usage is described in a comment at the top of the file.
File: contrib/desktop-integration/README.md
Desktop Integration
The ./contrib/desktop-integration contains examples of typical dockerized
desktop applications.
Examples
- Chromium: ./chromium/Dockerfile shows a way to dockerize a common application
- Gparted: ./gparted/Dockerfile shows a way to dockerize a common application w devices
File: contrib/syntax/vim/README.md
dockerfile.vim
Syntax highlighting for Dockerfiles
Installation
With pathogen, the usual way...
With Vundle
Plugin 'docker/docker' , {'rtp': '/contrib/syntax/vim/'}Features
The syntax highlighting includes:
- The directives (e.g.
FROM) - Strings
- Comments
License
BSD, short and sweet
File: contrib/syntax/textmate/README.md
Docker.tmbundle
Dockerfile syntax highlighting for TextMate and Sublime Text.
Install
Sublime Text
Available for Sublime Text under package control.
Search for Dockerfile Syntax Highlighting
TextMate 2
You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you.
enjoy.
File: contrib/syntax/nano/README.md
Dockerfile.nanorc
Dockerfile syntax highlighting for nano
Single User Installation
- Create a nano syntax directory in your home directory:
mkdir -p ~/.nano/syntax
- Copy
Dockerfile.nanorcto~/.nano/syntax/
cp Dockerfile.nanorc ~/.nano/syntax/
- Add the following to your
~/.nanorcto tell nano where to find theDockerfile.nanorcfile
## Dockerfile files
include "~/.nano/syntax/Dockerfile.nanorc"System Wide Installation
- Create a nano syntax directory:
mkdir /usr/local/share/nano
- Copy
Dockerfile.nanorcto/usr/local/share/nano
cp Dockerfile.nanorc /usr/local/share/nano/
- Add the following to your
/etc/nanorc:
## Dockerfile files
include "/usr/local/share/nano/Dockerfile.nanorc"File: contrib/vagrant-docker/README.md
Vagrant integration
Currently there are at least 4 different projects that we are aware of that deals
with integration with Vagrant at different levels. One
approach is to use Docker as a provisioner
which means you can create containers and pull base images on VMs using Docker's
CLI and the other is to use Docker as a provider,
meaning you can use Vagrant to control Docker containers.
Provisioners
Providers
Setting up Vagrant-docker with the Remote API
The initial Docker upstart script will not work because it runs on 127.0.0.1, which is not accessible to the host machine. Instead, we need to change the script to connect to 0.0.0.0. To do this, modify /etc/init/docker.conf to look like this:
description "Docker daemon"
start on filesystem
stop on runlevel [!2345]
respawn
script
/usr/bin/docker daemon -H=tcp://0.0.0.0:2375
end scriptOnce that's done, you need to set up a SSH tunnel between your host machine and the vagrant machine that's running Docker. This can be done by running the following command in a host terminal:
ssh -L 2375:localhost:2375 -p 2222 vagrant@localhost(The first 2375 is what your host can connect to, the second 2375 is what port Docker is running on in the vagrant machine, and the 2222 is the port Vagrant is providing for SSH. If VirtualBox is the VM you're using, you can see what value "2222" should be by going to: Network > Adapter 1 > Advanced > Port Forwarding in the VirtualBox GUI.)
Note that because the port has been changed, to run docker commands from within the command line you must run them like this:
sudo docker -H 0.0.0.0:2375 < commands for docker >File: contrib/README.md
The contrib directory contains scripts, images, and other helpful things
which are not part of the core docker distribution. Please note that they
could be out of date, since they do not receive the same attention as the
rest of the repository.
File: daemon/graphdriver/devmapper/README.md
devicemapper - a storage backend based on Device Mapper
Theory of operation
The device mapper graphdriver uses the device mapper thin provisioning
module (dm-thinp) to implement CoW snapshots. The preferred model is
to have a thin pool reserved outside of Docker and passed to the
daemon via the --storage-opt dm.thinpooldev option.
As a fallback if no thin pool is provided, loopback files will be
created. Loopback is very slow, but can be used without any
pre-configuration of storage. It is strongly recommended that you do
not use loopback in production. Ensure your Docker daemon has a--storage-opt dm.thinpooldev argument provided.
In loopback, a thin pool is created at /var/lib/docker/devicemapper
(devicemapper graph location) based on two block devices, one for
data and one for metadata. By default these block devices are created
automatically by using loopback mounts of automatically created sparse
files.
The default loopback files used are/var/lib/docker/devicemapper/devicemapper/data and/var/lib/docker/devicemapper/devicemapper/metadata. Additional metadata
required to map from docker entities to the corresponding devicemapper
volumes is stored in the /var/lib/docker/devicemapper/devicemapper/json
file (encoded as Json).
In order to support multiple devicemapper graphs on a system, the thin
pool will be named something like: docker-0:33-19478248-pool, where
the 0:33 part is the minor/major device nr and 19478248 is the
inode number of the /var/lib/docker/devicemapper directory.
On the thin pool, docker automatically creates a base thin device,
called something like docker-0:33-19478248-base of a fixed
size. This is automatically formatted with an empty filesystem on
creation. This device is the base of all docker images and
containers. All base images are snapshots of this device and those
images are then in turn used as snapshots for other images and
eventually containers.
Information on `docker info`
As of docker-1.4.1, docker info when using the devicemapper storage driver
will display something like:
$ sudo docker info
[...]
Storage Driver: devicemapper
Pool Name: docker-253:1-17538953-pool
Pool Blocksize: 65.54 kB
Base Device Size: 107.4 GB
Data file: /dev/loop4
Metadata file: /dev/loop4
Data Space Used: 2.536 GB
Data Space Total: 107.4 GB
Data Space Available: 104.8 GB
Metadata Space Used: 7.93 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.14 GB
Udev Sync Supported: true
Data loop file: /home/docker/devicemapper/devicemapper/data
Metadata loop file: /home/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.82-git (2013-10-04)
[...]status items
Each item in the indented section under Storage Driver: devicemapper are
status information about the driver.
Pool Namename of the devicemapper pool for this driver.Pool Blocksizetells the blocksize the thin pool was initialized with. This only changes on creation.Base Device Sizetells the maximum size of a container and imageData fileblockdevice file used for the devicemapper dataMetadata fileblockdevice file used for the devicemapper metadataData Space Usedtells how much ofData fileis currently usedData Space Totaltells max size theData fileData Space Availabletells how much free space there is in theData file. If you are using a loop device this will report the actual space available to the loop device on the underlying filesystem.Metadata Space Usedtells how much ofMetadata fileis currently usedMetadata Space Totaltells max size theMetadata fileMetadata Space Availabletells how much free space there is in theMetadata file. If you are using a loop device this will report the actual space available to the loop device on the underlying filesystem.Udev Sync Supportedtells whether devicemapper is able to sync with Udev. Should betrue.Data loop filefile attached toData file, if loopback device is usedMetadata loop filefile attached toMetadata file, if loopback device is usedLibrary Versionfrom the libdevmapper used
About the devicemapper options
The devicemapper backend supports some options that you can specify
when starting the docker daemon using the --storage-opt flags.
This uses the dm prefix and would be used something like docker daemon --storage-opt dm.foo=bar.
These options are currently documented both in the man
page and in the online
documentation.
If you add an options, update both the man page and the documentation.
File: docker/README.md
docker.go contains Docker's main function.
This file provides first line CLI argument parsing and environment variable setting.
File: docs/admin/logging/awslogs.md
Amazon CloudWatch Logs logging driver
The awslogs logging driver sends container logs to
Amazon CloudWatch Logs.
Log entries can be retrieved through the AWS Management
Console or the AWS SDKs
and Command Line Tools.
Usage
You can configure the default logging driver by passing the --log-driver
option to the Docker daemon:
docker daemon --log-driver=awslogsYou can set the logging driver for a specific container by using the--log-driver option to docker run:
docker run --log-driver=awslogs ...Amazon CloudWatch Logs options
You can use the --log-opt NAME=VALUE flag to specify Amazon CloudWatch Logs logging driver options.
awslogs-region
The awslogs logging driver sends your Docker logs to a specific region. Use
the awslogs-region log option or the AWS_REGION environment variable to set
the region. By default, if your Docker daemon is running on an EC2 instance
and no region is set, the driver uses the instance's region.
docker run --log-driver=awslogs --log-opt awslogs-region=us-east-1 ...awslogs-group
You must specify a
log group
for the awslogs logging driver. You can specify the log group with theawslogs-group log option:
docker run --log-driver=awslogs --log-opt awslogs-region=us-east-1 --log-opt awslogs-group=myLogGroup ...awslogs-stream
To configure which
log stream
should be used, you can specify the awslogs-stream log option. If not
specified, the container ID is used as the log stream.
Note:
Log streams within a given log group should only be used by one container
at a time. Using the same log stream for multiple containers concurrently
can cause reduced logging performance.
Credentials
You must provide AWS credentials to the Docker daemon to use the awslogs
logging driver. You can provide these credentials with the AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN environment variables, the
default AWS shared credentials file (~/.aws/credentials of the root user), or
(if you are running the Docker daemon on an Amazon EC2 instance) the Amazon EC2
instance profile.
Credentials must have a policy applied that allows the logs:CreateLogStream
and logs:PutLogEvents actions, as shown in the following example.
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Effect": "Allow",
"Resource": "*"
}
]
}2. Official Technical Reference & Guides (microsoft/microsoft.github.io)
File: README.md
[microsoft.github.io](https://microsoft.github.io)
Many open source projects released by Microsoft products, services and teams also have
deployments powered by GitHub Pages on this domain.
To discover Microsoft-released open source projects, learn about Microsoft's open source
approach and other information, check us out online at opensource.microsoft.com.
If we can help answer questions about the open source program at Microsoft, you can
contact opensource at microsoft com - although we are not able to provide support
for projects through this mechanism.
Microsoft GitHub resources
- Default repo templates including
SECURITY.MDand code of conduct files: microsoft/repo-templates - Code of Conduct (FAQ)
Microsoft open source resources
Resources for Microsoft employees
How to identify an official Microsoft organization on GitHub
- Official Microsoft GitHub orgs have a professional avatar and include a web address at Microsoft.com or an associated official domain
- Official Microsoft orgs are Verified on GitHub - look for the domain verification indicator on GitHub
File: SECURITY.MD
IMPORTANT: THIS IS NOT THE SOURCE OF TRUTH FOR THIS FILE
The SECURITY.MD file used by default in new Microsoft GitHub repos can be found
in the repo microsoft/repo-templates at https://github.com/microsoft/repo-templates.
Please contribute any fixes there.
Security
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include Microsoft, Azure, DotNet, AspNet, Xamarin, and our GitHub organizations.
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's definition of a security vulnerability, please report it to us as described below.
Reporting Security Issues
Please do not report security vulnerabilities through public GitHub issues.
Instead, please report them to the Microsoft Security Response Center (MSRC) at https://msrc.microsoft.com/create-report.
If you prefer to submit without logging in, send email to [email protected]. If possible, encrypt your message with our PGP key; please download it from the Microsoft Security Response Center PGP Key page.
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at microsoft.com/msrc.
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our Microsoft Bug Bounty Program page for more details about our active programs.
Preferred Languages
We prefer all communications to be in English.
Policy
Microsoft follows the principle of Coordinated Vulnerability Disclosure.
File: codeofconduct/index.md
Microsoft Open Source Code of Conduct
This code of conduct outlines expectations for participation in Microsoft-managed open source communities, as well as steps for reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all. People violating this code of conduct may be banned from the community.
Our open source communities strive to:
- Be friendly and patient: Remember you might not be communicating in someone else's primary spoken or programming language, and others may not have your level of understanding.
- Be welcoming: Our communities welcome and support people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, color, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
- Be respectful: We are a world-wide community of professionals, and we conduct ourselves professionally. Disagreement is no excuse for poor behavior and poor manners. Disrespectful and unacceptable behavior includes, but is not limited to:
- Violent threats or language.
- Discriminatory or derogatory jokes and language.
- Posting sexually explicit or violent material.
- Posting, or threatening to post, people's personally identifying information ("doxing").
- Insults, especially those using discriminatory terms or slurs.
- Behavior that could be perceived as sexual attention.
- Advocating for or encouraging any of the above behaviors.
- Understand disagreements: Disagreements, both social and technical, are useful learning opportunities. Seek to understand the other viewpoints and resolve differences constructively.
- This code is not exhaustive or complete. It serves to capture our common understanding of a productive, collaborative environment. We expect the code to be followed in spirit as much as in the letter.
Scope
This code of conduct applies to all repos and communities for Microsoft-managed open source projects regardless of whether or not the repo explicitly calls out its use of this code. The code also applies in public spaces when an individual is representing a project or its community. Examples include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
Note: Some Microsoft-managed communities have codes of conduct that pre-date this document and issue resolution process. While communities are not required to change their code, they are expected to use the resolution process outlined here. The review team will coordinate with the communities involved to address your concerns.
Reporting Code of Conduct Issues
We encourage all communities to resolve issues on their own whenever possible. This builds a broader and deeper understanding and ultimately a healthier interaction. In the event that an issue cannot be resolved locally, please feel free to report your concerns by contacting [email protected]. Your report will be handled in accordance with the issue resolution process described in the Code of Conduct FAQ.
In your report please include:
- Your contact information.
- Names (real, usernames or pseudonyms) of any individuals involved. If there are additional witnesses, please include them as well.
- Your account of what occurred, and if you believe the incident is ongoing. If there is a publicly available record (e.g. a mailing list archive or a public chat log), please include a link or attachment.
- Any additional information that may be helpful.
All reports will be reviewed by a multi-person team and will result in a response that is deemed necessary and appropriate to the circumstances. Where additional perspectives are needed, the team may seek insight from others with relevant expertise or experience. The confidentiality of the person reporting the incident will be kept at all times. Involved parties are never part of the review team.
Anyone asked to stop unacceptable behavior is expected to comply immediately. If an individual engages in unacceptable behavior, the review team may take any action they deem appropriate, including a permanent ban from the community.
This code of conduct is based on the template established by the TODO Group and used by numerous other large communities (e.g., Facebook, Twitter, GitHub and the Scope section from the Contributor Covenant version 1.4.
File: codeofconduct/faq/index.md
Microsoft Open Source Code of Conduct FAQ
Contents
- Why have a Code of Conduct?
- Why this Code of Conduct?
- Why do this across all repos?
- How does a project adopt the code and process?
- What if my Microsoft project already has a Code of Conduct?
- How do I raise a concern?
- What is the process for addressing issues that arise?
- How does the resolution team work?
- Can I use this Code of Conduct in my projects?
Why have a Code of Conduct?
People and communities are the foundation of open source. Communities thrive through diversity of thought and the safety of its members. Microsoft has a deep-seated commitment to diversity and inclusion. All Microsoft employees enjoy a safe work environment and a culture of mutual respect and responsibility. Our team members and open source partners should enjoy the same environment when collaborating on open source projects.
While conduct issues seldom arise, when they do, they are often very public and very passionate. It is best for the community to be prepared with:
- A clear and accessible Code of Conduct stating the norms under which projects operate
- An Issue Resolution Process for addressing cases where these norms are not being maintained
Why this Code of Conduct?
The Microsoft Open Source Code of Conduct is an instantiation of the TODO Group Code of Conduct template, that captures the Microsoft culture of equality, respect and inclusion. This same template is used by industry colleagues such as Facebook, Twitter, GitHub, Yahoo and others in their open source projects.
Why do this across all repos?
Having one code and process is both efficient and consistent — community members can participate in any Microsoft-driven project and be confident that they know the norms and that they are supported by a robust process.
How does a project adopt the code and process?
All Microsoft projects are automatically covered by the Code of Conduct and the Issue Resolution Process. However, it is critical that everyone in the communities be aware of the code and process. For that reason, all projects must link to the Code of Conduct in their README and/or CONTRIBUTING files using the following markdown.
This project has adopted the [Microsoft Open Source Code of
Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct
FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [[email protected]](mailto:[email protected])
with any additional questions or comments.What if my Microsoft project already has a Code of Conduct?
Thanks for being proactive in this important area. You are welcome to continue using your existing Code of Conduct, or you may change to the Microsoft Open Source Code of Conduct. Either way, all Microsoft projects must use the same issue resolution process. Please ensure that your documentation and guidance is updated to point people at the process outlined in this FAQ (see below).
Projects in the .NET Foundation are already covered by the .NET Foundation Contributors Code of Conduct. As such, there is no need for .NET Foundation projects to make any changes.
How do I raise a concern?
If you have witnessed or been subjected to a violation of the Code of Conduct, please send an email to [email protected]. Your message will be handled in a secure and confidential manner. This email address is monitored by people who are not active in open source projects or communities — so you can be sure that you are not communicating with a person involved in the issue you are reporting. You will receive a response within one business day acknowledging receipt of your email and describing the process for its resolution. (See below for more details.)
What is the process for addressing issues that arise?
Emails sent to [email protected] kick off the following process:
- Your message will be acknowledged within one business day.
- Within the following business day, a small, 2-3, person team will be assembled from a pool of Microsoft employee volunteers to review your concern. This team will be as diverse as possible given its size and will pull in additional people as needed to gain further insight and provide guidance. The team will not include anyone directly involved in the issue that has been raised.
- From there team will work with you and the others involved to come to a conclusion. While issue complexity varies, the goal is to resolve issues within five working days.
- All communication will be confidential with very limited circulation.
How does the resolution team work?
Beyond the norms and values set out in the Code of Conduct, issue review teams operate under the following principles:
- Less is more — As much as possible, let the community work it out. It is much better to have communities self-correct than to have outsiders come in and โfixโ problems.
- Equality — Contribution value or status in the community are not relevant to the review. Key people do not have more rights (either to abuse or be protected from abuse) than others in the community.
- Independence — Reviewers must act and be seen to act with independence from the project(s) in question and from Microsoft.
Can I use this Code of Conduct in my projects?
Yes. The document is licenced under CC BY 4.0. You will of course need to update the document to suit the specifics of your projects, but by all means use this however you can to drive great communities.