Commit graph

310 commits

Author SHA1 Message Date
Derek McGowan
0336b0cdaa Update push and pull to registry 2.1 specification
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2015-01-15 14:05:05 -08:00
Derek McGowan
e9b590d85e Update push to use mount blob endpoint
Using mount blob prevents repushing images which have already been uploaded

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-15 14:05:05 -08:00
Derek McGowan
3e4fd00544 Use tarsum dev version to fix mtime issue
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-15 14:05:05 -08:00
Derek McGowan
bcc0a343bb Update manifest format for push
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-15 14:05:05 -08:00
Derek McGowan
188b56c836 Push flow
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-15 14:05:05 -08:00
Michael Crosby
476cf1b906 Use channels and set workers to make image lookup safe
This refactors the starting work by the prior commits to make this safe
for access.  A maximum of 5 worker go routines are started to lookup
images on the endpoint.  Another go routine consumes the images that are
required to be pushed into a map for quick lookups.  The map is required
because the pushing of the image json and layer have to be done in the
correct order or the registry will explode in fire.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-13 15:52:44 -08:00
Ian Calvert
3328658929 Replace custom waiting code with a WaitGroup
Signed-off-by: Ian Calvert <ianjcalvert@gmail.com>
2015-01-13 15:32:47 -08:00
Ian Calvert
90c5ff4f06 Run the remote image presence checks in parallel
Signed-off-by: Ian Calvert <ianjcalvert@gmail.com>
2015-01-13 15:32:47 -08:00
Don Kjer
568f86eb18 Deprecating ResolveRepositoryName
Passing RepositoryInfo to ResolveAuthConfig, pullRepository, and pushRepository

Moving --registry-mirror configuration to registry config

Created resolve_repository job

Repo names with 'index.docker.io' or 'docker.io' are now synonymous with omitting an index name.

Adding test for RepositoryInfo

Adding tests for opts.StringSetOpts and registry.ValidateMirror

Fixing search term use of repoInfo

Adding integration tests for registry mirror configuration

Normalizing LookupImage image name to match LocalName parsing rules

Normalizing repository LocalName to avoid multiple references to an official image

Removing errorOut use in tests

Removing TODO comment

gofmt changes

golint comments cleanup.  renaming RegistryOptions => registry.Options, and RegistryServiceConfig => registry.ServiceConfig

Splitting out builtins.Registry and registry.NewService calls

Stray whitespace cleanup

Moving integration tests for Mirrors and InsecureRegistries into TestNewIndexInfo unit test

Factoring out ValidateRepositoryName from NewRepositoryInfo

Removing unused IndexServerURL

Allowing json marshaling of ServiceConfig.  Exposing ServiceConfig in /info

Switching to CamelCase for json marshaling

PR cleanup; removing 'Is' prefix from boolean members.  Removing unneeded json tags.

Removing non-cleanup related fix for 'localhost:[port]' in splitReposName

Merge fixes for gh9735

Fixing integration test

Reapplying #9754

Adding comment on config.IndexConfigs use from isSecureIndex

Remove unused error return value from isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>

Adding back comment in isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-01-08 20:14:58 +00:00
Doug Davis
6d801a3caa Have .dockerignore support Dockerfile/.dockerignore
If .dockerignore mentions either then the client will send them to the
daemon but the daemon will erase them after the Dockerfile has been parsed
to simulate them never being sent in the first place.

an events test kept failing for me so I tried to fix that too

Closes #8330

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-01-06 10:57:48 -08:00
Don Kjer
b74ccf2a1b Fixing ValidateTagName error message
Signed-off-by: Don Kjer <don.kjer@gmail.com>
2014-12-19 22:48:31 +00:00
Josh Hawn
8936789919 Make FROM scratch a special cased 'no-base' spec
There has been a lot of discussion (issues 4242 and 5262) about making
`FROM scratch` either a special case or making `FROM` optional, implying
starting from an empty file system.

This patch makes the build command `FROM scratch` special cased from now on
and if used does not pull/set the the initial layer of the build to the ancient
image ID (511136ea..) but instead marks the build as having no base image. The
next command in the dockerfile will create an image with a parent image ID of "".
This means every image ever can now use one fewer layer!

This also makes the image name `scratch` a reserved name by the TagStore. You
will not be able to tag an image with this name from now on. If any users
currently have an image tagged as `scratch`, they will still be able to use that
image, but will not be able to tag a new image with that name.

Goodbye '511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158',
it was nice knowing you.

Fixes #4242

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-12-18 14:03:38 -08:00
Daehyeok Mun
8123c1e9fe Chnage LookupRemoteImage to return error
This commit is patch for following comment
// TODO: This method should return the errors instead of masking them and returning false

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-12-16 16:23:19 -08:00
Michael Crosby
eea9f0e781 Merge pull request #9610 from duglin/Issue9602
Wrap strings that could look like ints in quotes
2014-12-16 12:02:26 -08:00
Jessie Frazelle
e6a68a1c87 Merge pull request #9613 from pwaller/push-err-confusion-fix
Improve message when pushing a non-existent image
2014-12-15 09:54:34 -08:00
Doug Davis
d942c59b69 Wrap strings that could look like ints in quotes
When we use the engine/env object we can run into a situation where
a string is passed in as the value but later on when we json serialize
the name/value pairs, because the string is made up of just numbers
it appears as an integer and not a string - meaning no quotes.  This
can cause parsing issues for clients.

I tried to find all spots where we call env.Set() and the type of the
name being set might end up having a value that could look like an int
(like author). In those cases I switched it to use env.SetJson() instead
because that will wrap it in quotes.

One interesting thing to note about the testcase that I modified is that
the escaped quotes should have been there all along and we were incorrectly
letting it thru. If you look at the metadata stored for that resource you
can see the quotes were escaped and we lost them during the serialization
steps because of the env.Set() stuff.  The use of env is probably not the
best way to do all of this.

Closes: #9602

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-12-15 05:10:49 -08:00
unclejack
bff1d9dbce validate image ID properly & before load
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>

Conflicts:
	graph/load.go
2014-12-11 16:29:27 -05:00
Peter Waller
3a08bbc4d2 Improve message when pushing a non-existent image
I was confused earlier when I did:

```
docker push localhost.localdomain:1234/foo
```

Because docker told me:

```
No such id: localhost.localdomain:1234/foo
```

I actually had buried in my mind the solution to this, but the error
message
confused me because I had recently had some fun trying to get the
registry
working and therefore thought it was telling me that I didn't have an
account
on the registry.

This pull request makes it unambiguous that the error is that the
specified
image is unknown.

/cc @cpuguy83

Docker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)
2014-12-11 17:57:23 +00:00
unclejack
2ec2237909 graph/load: add build tags to fix make cross
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2014-11-25 02:06:45 +02:00
unclejack
209deff963 don't call reexec.Init from chrootarchive
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)

Conflicts:
	daemon/graphdriver/aufs/aufs_test.go
		fixed conflict caused by imports
2014-11-25 01:03:40 +02:00
Tibor Vass
9c01bc249d pkg/chrootarchive: pass TarOptions via CLI arg
Signed-off-by: Tibor Vass <teabee89@gmail.com>

Conflicts:
	graph/load.go
		fixed conflict in imports
2014-11-25 01:03:40 +02:00
Anthony Baire
b37fdc5dd1 fix missing layers when exporting a full repository
Therer is a bug in the 'skip' decision when exporting a repository
(`docker save repo`)

Only the layers of the first image are included in the archive (the
layers of the next images are missing)

Signed-off-by: Anthony Baire <Anthony.Baire@irisa.fr>
2014-11-14 14:41:35 +01:00
Michael Crosby
039aa2741f Merge pull request #8964 from jlhawn/image_checksum
Compute TarSum on storage of image layer content
2014-11-13 18:07:20 -08:00
Tibor Vass
4455f51760 registry: refactor registry.IsSecure calls into registry.NewEndpoint
Signed-off-by: Tibor Vass <teabee89@gmail.com>
2014-11-12 20:34:03 -06:00
Srini Brahmaroutu
bc45428220 improve error message to print the tag
Closes #9001

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2014-11-11 22:18:40 +00:00
Doug Davis
ef7415258b Add import/pull events to the stream
Closes #8160

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-06 12:12:41 -08:00
Josh Hawn
059e589c34 Compute TarSum on storage of image layer content
Now, newly created/imported layers will have the checksum of
the layer diff computed and stored in the image json file.

For now, it is not an error if the computed checksum does not
match an existing checksum, only a warning message is logged. The
eventual goal is to use the checksums in the image JSON to verify
the integrity of the layer contents when doing `docker load` or
`docker pull`, and error out if it does not match.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-11-05 10:17:55 -08:00
Tibor Vass
5b03a21963 Merge pull request #8799 from jlhawn/remove_jsondata_arg
Remove `jsonData` argument from `image.StoreImage`
2014-11-03 20:55:40 -05:00
Josh Hawn
26184de8ab Remove jsonData argument from image.StoreImage
The argument specified the json data to save to disk when registering
a new image into the image graph. If it is nil, then the given image
is serialized to json and that is written by default. This default
behavior is sufficient if the given image was originally deserialzed
from this jsonData to begin with which has always been the case.

Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2014-11-03 17:39:21 -08:00
Derek McGowan
9d6391a9eb Skip V2 registry and immediately fallback to V1 when mirrors are provided
Since V2 registry does not yet implement mirrors, when mirrors are given automatically fallback to V1 without checking V2 first.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-31 18:10:48 -07:00
Tibor Vass
6a1ff022b0 Do not verify certificate when using --insecure-registry on an HTTPS registry
Signed-off-by: Tibor Vass <teabee89@gmail.com>

Conflicts:
	registry/registry.go
	registry/registry_test.go
	registry/service.go
	registry/session.go

Conflicts:
	registry/endpoint.go
	registry/registry.go
2014-10-30 19:44:09 -04:00
Michael Crosby
f29b2e48eb Refactor IsSecure change
Fix issue with restoring the tag store and setting static configuration
from the daemon. i.e. the field on the TagStore struct must be made
internal or the json.Unmarshal in restore will overwrite the insecure
registries to be an empty struct.

Signed-off-by: Michael Crosby <michael@docker.com>

Conflicts:
	graph/pull.go
	graph/push.go
	graph/tags.go
2014-10-30 19:41:55 -04:00
unclejack
380c8320a7 make http usage for registry explicit
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)

Conflicts:
	daemon/config.go
	daemon/daemon.go
	graph/pull.go
	graph/push.go
	graph/tags.go
	registry/registry.go
	registry/service.go
2014-10-30 19:41:55 -04:00
Alexandr Morozov
ee7dd44c01 Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-24 15:11:48 -07:00
Alexandr Morozov
7c62cee51e Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-10-24 15:03:06 -07:00
Jessica Frazelle
373fd1ce16 Fixes #8690
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-10-21 16:47:43 -07:00
Michael Crosby
b90ab68f2a Merge pull request #8511 from coolljt0725/fix_tag
Fix tag an existed tag name of a repository
2014-10-20 14:32:23 -07:00
Derek McGowan
3be4551a91 Enable V2 pull flow
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-10 16:09:56 -07:00
Derek McGowan
85fd8213af Update verification message
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-10 16:04:29 -07:00
Derek McGowan
15d5c7f10f Update manifest format to rename blobsums and use arrays of dictionaries
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-10 16:04:29 -07:00
Derek McGowan
456f493659 Add status message for V2 pull
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-10 16:04:29 -07:00
Derek McGowan
7d21ea6627 Update pull message and log
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-10 16:04:28 -07:00
Derek McGowan
e8b8cf61a9 Make V2 code more defensive against malformed content
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-10 16:04:28 -07:00
Lei Jitang
5e6f16e342 Fix the bug of tag a existed tag name of a repository.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2014-10-10 09:18:12 +08:00
Burke Libbey
c95b0e0292 Increase the tag length limit from 30 to 128
Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2014-10-07 11:29:47 -04:00
Michael Crosby
1c62e0ae4e Remove registry v2 code path
As this feature requires more testing it is much safter to get the
underlying changes into the codebase first then enable the feature in
another release after proper testing and verification can be done.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2014-10-03 22:24:14 +00:00
Michael Crosby
eaaf9e3125 Merge pull request #8320 from dmcgowan/provenance_pull
Official image provenance pull flow
2014-10-03 10:56:54 -07:00
Derek McGowan
22e59009e4 Add comment for permission and fix wrong format variable
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-02 17:41:57 -07:00
Derek McGowan
7c88e8f13d Add provenance pull flow for official images
Add support for pulling signed images from a version 2 registry.
Only official images within the library namespace will be pull from the
new registry and check the build signature.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2014-10-01 18:26:06 -07:00
Srini Brahmaroutu
ecff6303a3 Print a status message when pull command is executed
Using repo tag in the status message for better usability, as per review comments
Added documentation and Changed code to print Status after downloads are complete

Addresses #2404

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2014-10-01 22:55:29 +00:00
Vincent Batts
61c6f206b0 registry: getting Endpoint ironned out
Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-10-01 13:19:40 -07:00
Rafe Colton
30d5a42c1f Move archive package into pkg/archive
Now that the archive package does not depend on any docker-specific
packages, only those in pkg and vendor, it can be safely moved into pkg.

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
2014-09-29 23:23:36 -07:00
Victor Vieux
22bd54be4a Merge pull request #8276 from dqminh/8262-validate-build-tag
Fix #8262: check tag's validity before building.
2014-09-29 10:57:54 -07:00
Michael Crosby
74dbea81d6 Merge pull request #8175 from hqhq/master
graph: add VirtualSize for inspect output
2014-09-29 10:50:28 -07:00
Daniel, Dao Quang Minh
8833d800bf check tag's validity before building.
When user passes an invalid tag to `docker build`
(i.e.  `docker build -t abcd:A0123456789B0123456789C0123456789 .`), check the
tag first and terminate-early so user can specify the tag again

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-09-29 06:21:54 -04:00
Jessica Frazelle
7d74be162c Pull all image aliases for id. Closes #8141.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-09-25 11:48:49 -07:00
Doug Davis
86a3a9a282 if the Rename during an image delete fails, just delete the original dir
Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-09-22 18:47:20 -07:00
Qiang Huang
ec000cbf30 graph: add VirtualSize for inspect output
Currently inspect output just shows Size info, and that usally be
very small and even 0 which is confusing.

Fixes #8016

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2014-09-23 08:42:32 +08:00
Josh Hawn
dee6b481fe Refactor use of graphdriver.Differ
Some graphdrivers are Differs and type assertions are made
in various places throughout the project. Differ offers some
convenience in generating/applying diffs of filesystem layers
but for most graphdrivers another code path is taken.

This patch brings all of the logic related to filesystem
diffs in one place, and simplifies the implementation of some
common types like Image, Daemon, and Container.

Signed-off-by: Josh Hawn <josh.hawn@docker.com>
2014-09-16 15:10:32 -07:00
unclejack
ada883b198 graph: validate tags properly & add unit tests
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-16 00:13:54 +03:00
Michael Crosby
98e409172c Merge pull request #7996 from estesp/7943-validate-tagnames
Validate tag names similar to repository name validation; add tests
2014-09-11 15:19:50 -07:00
Phil Estes
46eb4140c9 Validate tag names similar to repository name validation; add tests
Addresses #7943

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2014-09-11 17:52:36 -04:00
Tim Smith
69a75c673c Add daemon flag to specify public registry mirrors
Adds support for a --registry-mirror=scheme://<host>[:port]
daemon flag. The flag may be present multiple times. If
provided, mirrors are prepended to the list of endpoints used
for image pull. Note that only mirrors of the public
index.docker.io registry are supported, and image/tag resolution
is still performed via the official index.

Docker-DCO-1.1-Signed-off-by: Tim Smith <timbot@google.com> (github: timbot)
2014-09-09 19:03:38 +00:00
Alexandr Morozov
114838cbda
Some more style fixes
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-29 15:21:28 +04:00
Vincent Batts
e64131d1bf docker save: ability to save multiple images
Now from a single invocation of `docker save`, you can specify multiple
images to include in the output tar, or even just multiple tags of a
particular image/repo.

```
> docker save -o bundle.tar busybox ubuntu:lucid ubuntu:saucy fedora:latest
> tar tf ./bundle.tar | wc -l
42
> tar xOf ./bundle.tar repositories
{"busybox":{"latest":"2d8e5b282c81244037eb15b2068e1c46319c1a42b80493acb128da24b2090739"},"fedora":{"latest":"58394af373423902a1b97f209a31e3777932d9321ef10e64feaaa7b4df609cf9"},"ubuntu":{"lucid":"9cc9ea5ea540116b89e41898dd30858107c1175260fb7ff50322b34704092232","saucy":"9f676bd305a43a931a8d98b13e5840ffbebcd908370765373315926024c7c35e"}}
```

Further, this fixes the bug where the `repositories` file is not created
when saving a specific tag of an image (e.g. ubuntu:latest)

document multi-image save and updated API docs

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-08-28 20:22:33 -04:00
Daehyeok.Mun
59d58352df graph: remove obsolete comments
Graph.Get function already returns nil when the image doesn't exist so
following comment is obsolete.
FIXME: return nil when the image doesn't exist, instead of an error

Signed-off-by: Daehyeok.Mun <daehyeok@gmail.com>
2014-08-29 00:22:26 +09:00
Daehyeok.Mun
35df24c8e6 graph: change argument order of Register function
This commit is patch for following comment
FIXME: pass img as first argument

Signed-off-by: Daehyeok.Mun <daehyeok@gmail.com>
2014-08-28 20:06:07 +09:00
Victor Vieux
a0392324f1 another commit to do like @crosbymichael
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-08-14 01:36:26 +00:00
Josiah Kiehl
a02f67be5b Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
2014-08-13 15:18:15 -07:00
Vincent Batts
752dd707ac registry.Registry -> registry.Session
renaming this struct to more clearly be session, as that is what it
handles.

Splitting out files for easier readability.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2014-08-13 09:27:43 -04:00
unclejack
f4f1e4db70 Merge pull request #6301 from rail44/feature-load-only-not-exist-image
Use only unavailable image when load from Tarball
2014-08-11 11:28:52 +03:00
Satoshi Amemiya
a34dd21611 Use only unavailable image when load from Tarball
Docker-DCO-1.1-Signed-off-by: Satoshi Amemiya <satoshi_amemiya@voyagegroup.com> (github: rail44)
2014-08-08 20:30:38 +09:00
Solomon Hykes
6856a6b110 Move "pull" and "push" to graph/pull.go and graph/push.go
This is part of the ongoing effort to remove the deprecated server/
package, and generally cleanup and simplify the codebase.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-08 07:25:09 +00:00
Michael Crosby
5d9cfde0df Merge pull request #7453 from shykes/new-subsystem-maintainers
Add maintainers to daemon/ and graph/
2014-08-07 16:43:41 -07:00
Solomon Hykes
5240e5f713 Add maintainers to daemon/ and graph/
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 10:29:15 +00:00
Tibor Vass
af0781974d Check error returned by eng.Register() in TagStore.Install()
Signed-off-by: Tibor Vass <teabee89@gmail.com>
2014-08-06 17:19:01 -04:00
Solomon Hykes
d787937957 Move "image_tag" and "tag" to graph/tag.go
Note: these 2 jobs should be merged into one. This was noted in a FIXME.

Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:51 -04:00
Solomon Hykes
fa27580cff Move "import" to graph/import.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
f2029f7be1 Move "load" to graph/load.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
77781440f1 Move "viz" to graph/viz.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
51dd68d659 Move "images" to graph/list.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
55235e121e Move "image_history" to graph/history.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Solomon Hykes
6e28d11d1f Move "image_export" to graph/export.go
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:18:50 -04:00
Kato Kazuyoshi
5ebe86ccf9 Fix graph/tags_unit_test.go on FreeBSD
- Directories should have u+x (0600 -> 0700)
- Don't chown files to root because we don't have to

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
2014-07-30 18:06:19 -07:00
Erik Hollensbe
4398108433 Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-29 13:09:10 -07:00
Victor Vieux
b3ee9ac74e update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:19:50 +00:00
LK4D4
ed032ddfd6 Move truncindex in separate package in pkg/
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-06-24 21:19:15 +04:00
Vincent Batts
d3bc787bca docker save: raw json
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
2014-06-20 14:38:17 -04:00
Victor Vieux
3e4e8636c1 do not alter json in docker save
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-06-17 00:06:21 +00:00
Alexander Larsson
822ea97ffc Add --storage-opt graph driver option and pass through to driver
This lets you add storage specific options for the daemon.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-06-05 10:42:27 +02:00
Victor Vieux
68fb7f4b74 Standardize API keys: CamelCase
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-31 01:22:07 +00:00
Alexandr Morozov
c4990ab999 Fix races on TagStore accessing
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
2014-05-30 13:36:14 +04:00
unclejack
838d6a9e9b Merge pull request #5855 from philips/remove-dead-code
chore(graph/graph): remove dead code
2014-05-30 04:51:12 +03:00
Tianon Gravi
8e967fe802 Revert "Always mount a /run tmpfs in the container"
This reverts commit 905795ece6.

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-05-21 14:28:19 -06:00
Michael Crosby
83e9dc7200 Merge pull request #5755 from vieux/move_inspect_daemon
move inspect from server to daemon
2014-05-20 15:50:38 -07:00
Victor Vieux
603e00a3a7 move inspect from server to daemon
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-05-20 19:36:15 +00:00
Michael Crosby
e454be7567 Move init volumes code to func
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-05-19 22:04:51 +00:00
Brandon Philips
a42e451e10 chore(graph/graph): remove dead code
This code was introduced with commented out sections. Just delete them.

Original commit: 18fc707fdf

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-05-16 14:26:14 -07:00
Alexander Larsson
905795ece6 Always mount a /run tmpfs in the container
All modern distros set up /run to be a tmpfs, see for instance:
https://wiki.debian.org/ReleaseGoals/RunDirectory

Its a very useful place to store pid-files, sockets and other things
that only live at runtime and that should not be stored in the image.

This is also useful when running systemd inside a container, as it
will try to mount /run if not already mounted, which will fail for
non-privileged container.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-05-12 21:41:04 +02:00
Solomon Hykes
ff4ef50470 Start separating the image subsystem
This is a first step towards moving all code related to local
manipulation of images into a cleanly separated subsystem,
accessible via a stable set of commands in the engine API.

`graph.TagStore` now implements `engine.Installer`. For now, it
is installed by `Server.InitServer`, along with all other Server
commands. However this will change in future patches.

`graph.TagStore.Install` registers the following commands:

* `image_set` creates a new image and stores it locally.
* `image_get` returns information about an image stored locally.
* `image_tag` assigns a new name and tag to an existing image.

These commands are a pre-requisite for moving 'push' and 'pull'
out of `Server`.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
2014-05-09 19:15:26 -07:00
Michael Crosby
f0e6e135a8 Initial work on selinux patch
This has every container using the docker daemon's pid for the processes
label so it does not work correctly.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-04-29 03:40:05 -07:00
Alexander Larsson
359b7df5d2 Rename runtime/* to daemon/*
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-04-17 14:43:01 -07:00
Paul Nasrat
4f169c2db5 Enable construction of TruncIndex from id array.
Fixes #5166

Current graph.restore is essentially O(n^2 log n) due to how
suffixarray creation works.

Rather than create/append/create new this supports creation from a seed
array of ids.

Functional testing shows this eliminates the hang on Creating image
graph reported on list.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
2014-04-11 16:39:58 -04:00
Tianon Gravi
3d9cd1e5f1 Fix spurious mtab symlink error when /etc doesn't exist yet
symlink /proc/mounts /var/lib/docker/btrfs/subvolumes/1763d6602b8b871f0a79754f1cb0a31b3928bb95de5232b1b8c15c60fa1017f6-init/etc/mtab: no such file or directory

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-04-09 11:13:54 -06:00
unclejack
b5caa5053a Merge pull request #4779 from vieux/symlink_mtab
symlink /etc/mtab and /proc/mounts
2014-04-02 20:57:04 +03:00
Victor Vieux
07b60d626a symlink /etc/mtab and /proc/mounts
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-31 21:15:03 +00:00
Dan Walsh
4c43566925 This patch adds SELinux labeling support.
docker will run the process(es) within the container with an SELinux label and will label
all of  the content within the container with mount label.  Any temporary file systems
created within the container need to be mounted with the same mount label.

The user can override the process label by specifying

-Z With a string of space separated options.

-Z "user=unconfined_u role=unconfined_r type=unconfined_t level=s0"

Would cause the process label to run with unconfined_u:unconfined_r:unconfined_t:s0"

By default the processes will run execute within the container as svirt_lxc_net_t.
All of the content in the container as svirt_sandbox_file_t.

The process mcs level is based of the PID of the docker process that is creating the container.

If you run the container in --priv mode, the labeling will be disabled.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-03-26 15:30:40 -04:00
Michael Crosby
2bddcd68b4 Gofmt imports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-17 11:41:28 -07:00
Michael Crosby
96c4816cef Move graphdrivers into runtime top level pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-17 11:40:12 -07:00
Michael Crosby
01b6b2be73 Move graph and tags to graph sub pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-09 22:59:29 -07:00