Commit Graph

64 Commits

Author SHA1 Message Date
d3974d0227 /image - fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: b061572916c5bb959a24f8382b21429c9d81620c
Component: engine
2015-07-27 05:40:57 +00:00
b70343dc2b Fixing Image struct to no longer use Graph.
Signed-off-by:  John Howard <jhoward@microsoft.com>
Upstream-commit: 9001ea26e7821239207586ad23c78c67d6926bfc
Component: engine
2015-07-20 13:59:53 -07:00
1296feade8 Windows: Graph driver implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 52f4d09ffb376ffaa6677cb1e0413c6a97f53f24
Component: engine
2015-07-10 14:33:11 -07:00
57eb64c9c0 Carry of PR #13520
Removinig files

Signed-off-by: Mary Anthony <mary@docker.com>
Upstream-commit: cd44018856be421497a35d96f88dd0eec42fae43
Component: engine
2015-06-13 09:27:30 -07:00
6825ac1c62 Separate graph from image
Move graph related functions in image to graph package.
Consolidating graph functionality is the first step in refactoring graph into an image store model.
Subsequent refactors will involve breaking up graph into multiple types with a strongly defined interface.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 2b58b677a54950bc78c13760ef79fe6284154847
Component: engine
2015-06-05 18:06:09 -07:00
7716bbfe5b Fix spelling mistakes in documentation
While reading  some of the docs I noticed a few errors, so I ran
misspellings (https://pypi.python.org/pypi/misspellings) on markdown files

Signed-off-by: Joe Gordon <joe.gordon0@gmail.com>
Upstream-commit: 3d87b80b46d45c2ca7c0fbcbcbb3fcf97a48444b
Component: engine
2015-05-31 11:53:23 -07:00
3fb26e927f image: precompile regexp
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: 8f57e7d2ef82d39e2c914b799e98ed6243b9b1d0
Component: engine
2015-05-13 21:47:43 +03:00
23b13c08d5 Windows: Fix filepath vs path in image.go
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 1c3b697d60bc1a5f5197b0c3a432002cf03c8277
Component: engine
2015-05-04 16:23:17 -07:00
954f940156 Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 844538142d95c1b7dda1bb2903179510105fe9b5
Component: engine
2015-04-27 21:50:33 +02:00
7a651c5c69 v1 spec: fix typos and formatting
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
Upstream-commit: d6c839cf0f04f30ba95e2b032a4e686dea2eb0d0
Component: engine
2015-04-23 08:19:52 +02:00
a4111cba55 Refactor utils/utils, fixes #11923
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: c30a55f14dbbe3971ba0ac716ba69a60868f4490
Component: engine
2015-04-14 01:37:36 +02:00
b67ac7ee80 when the file that was opened has been read into buffer, the file should be close.
Signed-off-by: Mabin <bin.ma@huawei.com>
Upstream-commit: d5ea4bae4a15cc9f3c16c046389737682277ff0f
Component: engine
2015-02-27 19:09:17 +08:00
1a1db2c237 Remove Checksum field from image.Image struct
The checksum is now being stored in a separate file beside the image
JSON file.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 3414307306dc1780f80c5ca5e9dd7a8822e27eec
Component: engine
2015-01-30 09:37:50 -08:00
7164984f64 Store tar checksum in separate file
Fixes #10432

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: e9f6f1a930b74c6b06f257eac838d062bbdd0d16
Component: engine
2015-01-29 21:28:20 -08:00
a2ae7e0198 No longer compute checksum when installing images.
While checksums are verified when a layer is pulled from v2 registries,
there are known issues where the checksum may change when the layer diff
is computed again. To avoid these issues, the checksum should no longer
be computed and stored until after it has been extracted to the docker
storage driver. The checksums are instead computed lazily before they
are pushed to a v2 registry.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: e636df8d9637514e125afe7418a3b98e5270858f
Component: engine
2015-01-29 13:52:59 -08:00
c4558ad58c Merge pull request #10305 from jlhawn/use_tarsum_v1
Always store images with tarsum.v1 checksum added
Upstream-commit: bfa0dc47da2d9e6399fa32bda72a7074224c815d
Component: engine
2015-01-26 14:42:07 -08:00
917ff61a98 Merge pull request #10333 from jlhawn/image_json_schema_reword
Updated image spec docs to clarify image JSON
Upstream-commit: 283597ad37446ccad57f6ba881652ee6f67e576e
Component: engine
2015-01-26 07:49:44 -05:00
f145851625 Updated image spec docs to clarify image JSON
The title `Image JSON Schema` was used as a header in the section
which describes the layout and fields of the image metadata JSON
file. It was pointed out that `JSON Schema` is its own term for
describing JSON in a machine-and-human-readable format, while the
word "Schema" in this context was used more generically to say that
the section is meant to be an example and outline of the Image JSON.

http://spacetelescope.github.io/understanding-json-schema/

This section now has the title `Image JSON Description` in order
to not cause this confusion.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 71763636f232477b0c890e0506b7b858505f1b33
Component: engine
2015-01-24 10:21:11 -08:00
1c5b6614c3 Make debugs logs suck less.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: c49cd3d2a51ad6d2304c24f7b609cde804a0d6c5
Component: engine
2015-01-23 13:20:29 -08:00
cc58d5c62d Always store images with tarsum.v1 checksum added
Updates `image.StoreImage()` to always ensure that images
that are installed in Docker have a tarsum.v1 checksum.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: ba3bad66f92da057dba2a43ff9a512cf7ad72375
Component: engine
2015-01-23 11:30:27 -08:00
c13d2851b8 Add Tarsum Calculation during v2 Pull operation
While the v2 pull operation is writing the body of the layer blob to disk
it now computes the tarsum checksum of the archive before extracting it to
the backend storage driver. If the checksum does not match that from the
image manifest an error is raised.

Also adds more debug logging to the pull operation and fixes existing test
cases which were failing. Adds a reverse lookup constructor to the tarsum
package so that you can get a tarsum object using a checksum label.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 213e3d116642431adbe634d39740eddc5a81e063
Component: engine
2015-01-15 14:05:05 -08:00
647f575a6c Typo creating -> created
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
Upstream-commit: 82bfb3852ea0835d96d456c256f40633b020bd1e
Component: engine
2015-01-14 23:02:17 -08:00
387cdea261 Typo image -> container
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
Upstream-commit: 034466d356ecc5bc993f255c5ec5fb96e7327b8b
Component: engine
2015-01-14 17:18:11 -08:00
16b3adaadc Adds Docker Image v1 Spec Documention
Many iterations have gone into documenting a v1 specification of Docker's Image
format.

v1 Image spec: clarify parent field

- metalivedev pointed out that the description was ambiguous, so I've removed
  mention that it was randomly generated. It IS the ID of the parent image.

Updated v1 image specificatino documentation

- More complete details and deprication notifications for each field
  in the JSON metadata of an image.
- Details on the format for packaging combined Image JSON + Filesystem
  Changeset archives for all layers of an image.

Clarify description of an image "Layer" in v1 spec

Updated intro of image v1 spec

Updated image v1 spec after more review

- Removed description of "Image" from the terminology section. The entire
  document is meant to serve this purpose.
- Updated the definition of "Image Filesystem Changeset".
- Clarified the level of randomness needed for generating image IDs.
- Updated the description of "Image Checksum".
- Added term descriptions for "Repository" and "Tag"
- Removed extraneous/implementation-specific fields from the Image JSON
  example file and field descriptions:
  - removed "container_config" and "docker_version" fields.
  - Added missing "author" field example and description.
- Removed extraneous/implementation-specific fields from the "config" struct
  example and description:
  - removed "Hostname", "Domainname", "Cpuset", "AttachStdin", "AttachStdout",
    "AttachStderr", "PortSpecs", "Tty", "OpenStdin", "StdinOnce", "Image",
    "NetworkDisabled", and "OnBuild".
- Updated example Image JSON config with better example values for "Env",
  "Cmd", "Volumes", "WorkingDir", "Entrypoint", "CpuShares", "Memory",
  "MemorySwap", and "User".
- Added notices that any fields not specified are to be considered as
  implementation specific and should be ignored my implementations which
  are unable to interpret them.
- Updated example of creating layer filesystem changesets to use less formal
  language.
- Listed more details in the section regarding extraction of a bundle of image
  layers into the root filesystem of a container.
- Updated the closing mention of Docker as an evolving implementation.

More updates to the v1 image spec

- Added line wrapping after 80 columns per line to adhere to documentation
  style guides, as pointed out by @jamtur01

- Removed references to any specific docker commands, updated a few descriptions
  or drop repeated statements, as pointed out by @cpuguy83

Cleanup image v1 spec draft after fredlf comments

Address comments by mmdriley on v1 image spec

Improve description of image v1 spec 'config.User`

- Improves description of image v1 specification for the 'User' runtime
  parameter after recomendations by tianon.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 79910625f0a7aa76590e4362817dda22f28343aa
Component: engine
2015-01-12 10:37:46 -08:00
a3eaed6ca5 Fix misuses of format based logging functions
Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
Upstream-commit: 6705477673be7c303369778f6f288ee600ce3893
Component: engine
2014-11-19 23:59:02 +02:00
658637c073 Merge pull request #8964 from jlhawn/image_checksum
Compute TarSum on storage of image layer content
Upstream-commit: 039aa2741fa95ecb21e35a20d60d72018d8296c9
Component: engine
2014-11-13 18:07:20 -08:00
81751423a5 Don't loose precision when parsing image size on 32 bit machines. Presumably fixes #8979.
Signed-off-by: Recursive Madman <recursive.madman@gmx.de>
Upstream-commit: 5cd53195fddd9a2843ad57c6e1ac11bec1ac37f0
Component: engine
2014-11-11 09:24:45 +01:00
5426d99b67 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)
Upstream-commit: 059e589c3427b1afa1b112acc931f59b5b063e16
Component: engine
2014-11-05 10:17:55 -08:00
617b00b175 image: stream img JSON & Decode in LoadImage
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 4dbbe4f51a22a9ec335fbf2f6e3981132f868312
Component: engine
2014-11-04 16:15:00 +02:00
ade837e2a4 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)
Upstream-commit: 26184de8ab1dfe812094c55c9becd8ebb60ed7be
Component: engine
2014-11-03 17:39:21 -08:00
bad39206ea Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: ee7dd44c017458c8fe0be8e09569b1238366dca3
Component: engine
2014-10-24 15:11:48 -07:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
afe8e130e0 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>
Upstream-commit: 30d5a42c1f24e26f681b7330249f04fec891aee9
Component: engine
2014-09-29 23:23:36 -07:00
861f46b221 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>
Upstream-commit: dee6b481fe0da1d845261ffff2e610fb05898d3c
Component: engine
2014-09-16 15:10:32 -07:00
e9ab736d16 move some io related utils to pkg/ioutils
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 76212635b594d4472dd8d5b2e071fac416addbe7
Component: engine
2014-09-03 11:36:21 +03:00
ef058f588f Cleanup: move image depth checks in image/
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 2a39635d30a5ecbf3f8020dcb272cd8ae939fe06
Component: engine
2014-08-15 00:43:12 +00:00
4737f7cea5 Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
Upstream-commit: a02f67be5b17da63d475e6f35956c1e72c3b2e7b
Component: engine
2014-08-13 15:18:15 -07:00
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
dcfc8d37e9 docker save: raw json
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: d3bc787bca62edff384e06a12224be2d982353da
Component: engine
2014-06-20 14:38:17 -04:00
2acb87c29f 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)
Upstream-commit: f0e6e135a8d733af173bf0b8732c704c9ec716d7
Component: engine
2014-04-29 03:40:05 -07:00
f7be50364d Rename runtime/* to daemon/*
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 359b7df5d2af5733b8a1ea6746d062053053b23e
Component: engine
2014-04-17 14:43:01 -07:00
8d099b8012 Gofmt imports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 2bddcd68b4b927d36ffadd80e098f6d4ae2cf5d6
Component: engine
2014-03-17 11:41:28 -07:00
742b723fc2 Move graphdrivers into runtime top level pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 96c4816cef592a98a235010924bb2417c8451079
Component: engine
2014-03-17 11:40:12 -07:00
fc0f37e6e1 Move image into sub pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 82a5439835b0bff3ab3dfb169415948dae504d56
Component: engine
2014-03-09 22:59:29 -07:00
f38c26d351 Removed deprecated docker/image module
Upstream-commit: 0f952a7dbb53c3c0f39d4762a340e12a30ac86de
Component: engine
2013-03-13 15:36:22 -07:00
7c2c4d6c33 Merged upstream changes in fs branch
Upstream-commit: 2441edf1a39ad75708292bcc2726184b16fb89b2
Component: engine
2013-03-11 05:50:09 -07:00
347532ed43 Merged master branch into fs
Upstream-commit: 97a8209438dcc60395b244c14f4efced583eb364
Component: engine
2013-03-11 05:42:36 -07:00
fae9969603 Removed deprecated docker/image package
Upstream-commit: dd0227b700503e03fce0e9e9ea3539c438e9c0cb
Component: engine
2013-03-09 20:17:31 -08:00
279f7946e3 gofmt
Upstream-commit: c59fff422fdc61c1c994b44fd83e4173a2f0530a
Component: engine
2013-03-09 19:44:09 -08:00
9e8c334ba7 Remove leftover debug message
Upstream-commit: 791592731eccfae0072b20a80d15ec31e34dc88f
Component: engine
2013-03-06 00:37:00 -08:00