Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
918229c
Document that load supports compressed tarballs.
metalivedev Jul 14, 2015
24f7d0a
Impose moratorium on remote registry access
stevvooe Jul 24, 2015
8e66e62
Fix broken link in automated build doc
djdefi Jul 24, 2015
1fb29e6
Clarify filters option in list containers and list images docs
carlossg Jul 10, 2015
b405e89
Windows: Fixes panic on daemon binary
Jul 24, 2015
a83e4e4
Remove Ubuntu 14.10 (Utopic Unicorn) from build-deb targets
tianon Jul 24, 2015
2b847df
Merge pull request #14939 from rtrauntvein/docs-autobuild
Jul 24, 2015
2084eee
Merge pull request #14967 from Microsoft/10662-fixpaniconwindowsdaemon
duglin Jul 24, 2015
d951ef1
Merge pull request #14522 from carlossg/patch-1
thaJeztah Jul 24, 2015
86c7ea4
Merge pull request #14637 from metalivedev/patch-1
thaJeztah Jul 24, 2015
0547b5f
#14474 skip DockerSuite.TestRunCapAddCHOWN on lxc
azurezk Jul 22, 2015
a38b544
fix memory swappiness lxc
jessfraz Jul 24, 2015
5ab4b60
Merge pull request #14969 from tianon/utopic-eol
Jul 24, 2015
0a5b8c4
ignore certain tests on lxc driver
jessfraz Jul 24, 2015
94ab0d3
Revert "Introduce a dedicated unconfined AA policy"
calavera Jul 24, 2015
935810b
Merge pull request #14977 from jfrazelle/fix-lxc
Jul 24, 2015
7890661
Merge pull request #14935 from stevvooe/registry-moratorium
Jul 24, 2015
542685d
Merge pull request #14976 from calavera/revert_unconfined_aa_policy
Jul 25, 2015
4f5b677
Merge pull request #14546 from dmcgowan/trusted-notary-integration
Jul 25, 2015
29ab701
[api/client] Tag resolved digest from Dockerfile
Jul 24, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,32 @@ lacking for many, we cannot make it a priority yet for the above reasons.

Again, this is not about saying that the Dockerfile syntax is done, it's about making choices about
what we want to do first!

## 2.3 Remote Registry Operations

A large amount of work is ongoing in the area of image distribution and
provenance. This includes moving to the V2 Registry API and heavily
refactoring the code that powers these features. The desired result is more
secure, reliable and easier to use image distribution.

Part of the problem with this part of the code base is the lack of a stable
and flexible interface. If new features are added that access the registry
without solidifying these interfaces, achieving feature parity will continue
to be elusive. While we get a handle on this situation, we are imposing a
moratorium on new code that accesses the Registry API in commands that don't
already make remote calls.

Currently, only the following commands cause interaction with a remote
registry:

- push
- pull
- run
- build
- search
- login

In the interest of stabilizing the registry access model during this ongoing
work, we are not accepting additions to other commands that will cause remote
interaction with the Registry API. This moratorium will lift when the goals of
the distribution project have been met.
50 changes: 41 additions & 9 deletions api/client/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
}

// Resolve the FROM lines in the Dockerfile to trusted digest references
// using Notary.
newDockerfile, err := rewriteDockerfileFrom(filepath.Join(contextDir, relDockerfile), cli.trustedReference)
// using Notary. On a successful build, we must tag the resolved digests
// to the original name specified in the Dockerfile.
newDockerfile, resolvedTags, err := rewriteDockerfileFrom(filepath.Join(contextDir, relDockerfile), cli.trustedReference)
if err != nil {
return fmt.Errorf("unable to process Dockerfile: %v", err)
}
Expand Down Expand Up @@ -291,7 +292,20 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
}
return Cli.StatusError{Status: jerr.Message, StatusCode: jerr.Code}
}
return err

if err != nil {
return err
}

// Since the build was successful, now we must tag any of the resolved
// images from the above Dockerfile rewrite.
for _, resolved := range resolvedTags {
if err := cli.tagTrusted(resolved.repoInfo, resolved.digestRef, resolved.tagRef); err != nil {
return err
}
}

return nil
}

// getDockerfileRelPath uses the given context directory for a `docker build`
Expand Down Expand Up @@ -467,14 +481,21 @@ func (td *trustedDockerfile) Close() error {
return os.Remove(td.File.Name())
}

// resolvedTag records the repository, tag, and resolved digest reference
// from a Dockerfile rewrite.
type resolvedTag struct {
repoInfo *registry.RepositoryInfo
digestRef, tagRef registry.Reference
}

// rewriteDockerfileFrom rewrites the given Dockerfile by resolving images in
// "FROM <image>" instructions to a digest reference. `translator` is a
// function that takes a repository name and tag reference and returns a
// trusted digest reference.
func rewriteDockerfileFrom(dockerfileName string, translator func(string, registry.Reference) (registry.Reference, error)) (newDockerfile *trustedDockerfile, err error) {
func rewriteDockerfileFrom(dockerfileName string, translator func(string, registry.Reference) (registry.Reference, error)) (newDockerfile *trustedDockerfile, resolvedTags []*resolvedTag, err error) {
dockerfile, err := os.Open(dockerfileName)
if err != nil {
return nil, fmt.Errorf("unable to open Dockerfile: %v", err)
return nil, nil, fmt.Errorf("unable to open Dockerfile: %v", err)
}
defer dockerfile.Close()

Expand All @@ -483,7 +504,7 @@ func rewriteDockerfileFrom(dockerfileName string, translator func(string, regist
// Make a tempfile to store the rewritten Dockerfile.
tempFile, err := ioutil.TempFile("", "trusted-dockerfile-")
if err != nil {
return nil, fmt.Errorf("unable to make temporary trusted Dockerfile: %v", err)
return nil, nil, fmt.Errorf("unable to make temporary trusted Dockerfile: %v", err)
}

trustedFile := &trustedDockerfile{
Expand All @@ -509,29 +530,40 @@ func rewriteDockerfileFrom(dockerfileName string, translator func(string, regist
if tag == "" {
tag = tags.DEFAULTTAG
}

repoInfo, err := registry.ParseRepositoryInfo(repo)
if err != nil {
return nil, nil, fmt.Errorf("unable to parse repository info: %v", err)
}

ref := registry.ParseReference(tag)

if !ref.HasDigest() && isTrusted() {
trustedRef, err := translator(repo, ref)
if err != nil {
return nil, err
return nil, nil, err
}

line = dockerfileFromLinePattern.ReplaceAllLiteralString(line, fmt.Sprintf("FROM %s", trustedRef.ImageName(repo)))
resolvedTags = append(resolvedTags, &resolvedTag{
repoInfo: repoInfo,
digestRef: trustedRef,
tagRef: ref,
})
}
}

n, err := fmt.Fprintln(tempFile, line)
if err != nil {
return nil, err
return nil, nil, err
}

trustedFile.size += int64(n)
}

tempFile.Seek(0, os.SEEK_SET)

return trustedFile, scanner.Err()
return trustedFile, resolvedTags, scanner.Err()
}

// replaceDockerfileTarWrapper wraps the given input tar archive stream and
Expand Down
12 changes: 0 additions & 12 deletions contrib/apparmor/docker
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,3 @@ profile docker-default flags=(attach_disconnected,mediate_deleted) {
deny /sys/firmware/efi/efivars/** rwklx,
deny /sys/kernel/security/** rwklx,
}

profile docker-unconfined flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>

network,
capability,
file,
umount,
mount,
pivot_root,
change_profile -> *,
}
14 changes: 0 additions & 14 deletions contrib/builder/deb/ubuntu-debootstrap-utopic/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion daemon/config_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) strin
config.InstallCommonFlags(cmd, usageFn)

// Then platform-specific install flags.
flag.StringVar(&config.Bridge.VirtualSwitchName, []string{"b", "-bridge"}, "", "Attach containers to a virtual switch")
cmd.StringVar(&config.Bridge.VirtualSwitchName, []string{"b", "-bridge"}, "", "Attach containers to a virtual switch")
}
2 changes: 1 addition & 1 deletion daemon/execdriver/lxc/lxc_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ lxc.cgroup.blkio.weight = {{.Resources.BlkioWeight}}
{{if .Resources.OomKillDisable}}
lxc.cgroup.memory.oom_control = {{.Resources.OomKillDisable}}
{{end}}
{{if .Resources.MemorySwappiness}}
{{if gt .Resources.MemorySwappiness 0}}
lxc.cgroup.memory.swappiness = {{.Resources.MemorySwappiness}}
{{end}}
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion daemon/execdriver/native/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (d *driver) setPrivileged(container *configs.Config) (err error) {
container.Devices = hostDevices

if apparmor.IsEnabled() {
container.AppArmorProfile = "docker-unconfined"
container.AppArmorProfile = "unconfined"
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/api/docker_remote_api_v1.18.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Query Parameters:
- **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters:
- exited=&lt;int&gt; -- containers with exit code of &lt;int&gt;
- status=(restarting|running|paused|exited)
- label=`key` or `key=value` of a container label
- label=`key` or `label="key=value"` of a container label

Status Codes:

Expand Down Expand Up @@ -1126,7 +1126,7 @@ Query Parameters:
- **all** – 1/True/true or 0/False/false, default false
- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
- dangling=true
- label=`key` or `key=value` of an image label
- label=`key` or `label="key=value"` of an image label
- **filter** - only return images with the specified name

### Build image from a Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/api/docker_remote_api_v1.19.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Query Parameters:
- **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:
- `exited=<int>`; -- containers with exit code of `<int>` ;
- `status=`(`restarting`|`running`|`paused`|`exited`)
- `label=key` or `key=value` of a container label
- `label=key` or `label="key=value"` of a container label

Status Codes:

Expand Down Expand Up @@ -1145,7 +1145,7 @@ Query Parameters:
- **all** – 1/True/true or 0/False/false, default false
- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
- `dangling=true`
- `label=key` or `key=value` of an image label
- `label=key` or `label="key=value"` of an image label
- **filter** - only return images with the specified name

### Build image from a Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/api/docker_remote_api_v1.20.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Query Parameters:
- **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters:
- `exited=<int>`; -- containers with exit code of `<int>` ;
- `status=`(`created`|`restarting`|`running`|`paused`|`exited`)
- `label=key` or `key=value` of a container label
- `label=key` or `label="key=value"` of a container label

Status Codes:

Expand Down Expand Up @@ -1272,7 +1272,7 @@ Query Parameters:
- **all** – 1/True/true or 0/False/false, default false
- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
- `dangling=true`
- `label=key` or `key=value` of an image label
- `label=key` or `label="key=value"` of an image label
- **filter** - only return images with the specified name

### Build image from a Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/commandline/load.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ weight=1

Load an image from a tar archive or STDIN

-i, --input="" Read from a tar archive file, instead of STDIN
-i, --input="" Read from a tar archive file, instead of STDIN. The tarball may be compressed with gzip, bzip, or xz

Loads a tarred repository from a file or the standard input stream.
Restores both images and tags.

$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
$ docker load < busybox.tar
$ docker load < busybox.tar.gz
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
busybox latest 769b9341d937 7 weeks ago 2.489 MB
Expand Down
5 changes: 1 addition & 4 deletions docs/userguide/dockerrepos.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ build and, in a few minutes, you should see your new Automated Build on the [Doc
Registry. It will stay in sync with your GitHub and Bitbucket repository until you
deactivate the Automated Build.

If you want to see the status of your Automated Builds, you can go to your
[Automated Builds page](https://registry.hub.docker.com/builds/) on the Docker Hub,
and it will show you the status of your builds and their build history.
To check the output and status of your Automated Build repositories, click on a repository name within the ["Your Repositories" page](https://registry.hub.docker.com/repos/). Automated Builds are indicated by a check-mark icon next to the repository name. Within the repository details page, you may click on the "Build Details" tab to view the status and output of all builds triggered by the Docker Hub.

Once you've created an Automated Build you can deactivate or delete it. You
cannot, however, push to an Automated Build with the `docker push` command.
Expand Down Expand Up @@ -175,4 +173,3 @@ webhooks](https://docs.docker.com/docker-hub/repos/#webhooks)
## Next steps

Go and use Docker!

6 changes: 4 additions & 2 deletions integration-cli/docker_cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ func (s *DockerSuite) TestRunCapAddALLDropNetAdminCanDownInterface(c *check.C) {
}

func (s *DockerSuite) TestRunGroupAdd(c *check.C) {
testRequires(c, NativeExecDriver)
out, _ := dockerCmd(c, "run", "--group-add=audio", "--group-add=dbus", "--group-add=777", "busybox", "sh", "-c", "id")

groupsList := "uid=0(root) gid=0(root) groups=10(wheel),29(audio),81(dbus),777"
Expand Down Expand Up @@ -1033,7 +1034,7 @@ func (s *DockerSuite) TestRunDnsOptionsBasedOnHostResolvConf(c *check.C) {
// Test to see if a non-root user can resolve a DNS name and reach out to it. Also
// check if the container resolv.conf file has atleast 0644 perm.
func (s *DockerSuite) TestRunNonRootUserResolvName(c *check.C) {
testRequires(c, SameHostDaemon)
testRequires(c, SameHostDaemon, NativeExecDriver)
testRequires(c, Network)

dockerCmd(c, "run", "--name=testperm", "--user=default", "busybox", "ping", "-c", "1", "www.docker.io")
Expand Down Expand Up @@ -2478,6 +2479,7 @@ func (s *DockerSuite) TestDevicePermissions(c *check.C) {
}

func (s *DockerSuite) TestRunCapAddCHOWN(c *check.C) {
testRequires(c, NativeExecDriver)
out, _ := dockerCmd(c, "run", "--cap-drop=ALL", "--cap-add=CHOWN", "busybox", "sh", "-c", "adduser -D -H newuser && chown newuser /home && echo ok")

if actual := strings.Trim(out, "\r\n"); actual != "ok" {
Expand Down Expand Up @@ -2505,7 +2507,7 @@ func (s *DockerSuite) TestVolumeFromMixedRWOptions(c *check.C) {
}

func (s *DockerSuite) TestRunWriteFilteredProc(c *check.C) {
testRequires(c, Apparmor)
testRequires(c, Apparmor, NativeExecDriver)

testWritePaths := []string{
/* modprobe and core_pattern should both be denied by generic
Expand Down