Commit Graph

139 Commits

Author SHA1 Message Date
98bb6eba72 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)
Upstream-commit: 8936789919c5c8004f346f44a3452d1521818b60
Component: engine
2014-12-18 14:03:38 -08:00
d44cc14dce Don't try release network in non-private modes
Fixes #9594

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: b3ade99a7822f4edb21400a1003ff0e3893caa38
Component: engine
2014-12-10 11:59:32 -08:00
6ca414da06 User should get error message on wrong config
closes #9501

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 8dcbd6ab636e756736cef5408710ff97fd207370
Component: engine
2014-12-09 21:52:07 +00:00
c28ef478d3 Add support for docker exec to return cmd exitStatus
Note - only support the non-detached mode of exec right now.
Another PR will add -d support.

Closes #8703

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 90928eb1140fc0394e2a79d5e9a91dbc0f02484c
Component: engine
2014-11-25 17:49:25 -08:00
09b8238fe6 Allow IPC namespace to be shared between containers or with the host
Some workloads rely on IPC for communications with other processes.  We
would like to split workloads between two container but still allow them
to communicate though shared IPC.

This patch mimics the --net code to allow --ipc=host to not split off
the IPC Namespace.  ipc=container:CONTAINERID to share ipc between containers

If you share IPC between containers, then you need to make sure SELinux labels
match.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 497fc8876ede9924f61c0eee4dfadd71e5d9f537
Component: engine
2014-11-12 11:29:58 -05:00
8ee09ed8c7 Merge pull request #9014 from LK4D4/fix_parent_failing
Not fail on updating parent links
Upstream-commit: 84f25414c18f726bccac10710f5971f5c5d822cd
Component: engine
2014-11-10 12:53:16 -08:00
8f685d0d4a Not fail on updating parent links
Fixes #8796

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: b83fc07d88175c32bb46368a07a9c9e277b22392
Component: engine
2014-11-06 15:30:23 -08:00
a17f18fb0b Merge pull request #8983 from LK4D4/consistent_hosts
Consistent hosts
Upstream-commit: 6a6be5bd5afcd4192dfc5d7bc5163b318afb15cc
Component: engine
2014-11-06 11:51:28 -08:00
8e42183a10 Make /etc/hosts records consistent
Fixes #8972

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 6cbe1fa726fb88a1743c3a3da5e699c9bb3ae55a
Component: engine
2014-11-06 11:36:00 -08:00
811492e0cb See #8379 - if the container doesn't start I added code to make sure that if no other processing sets the container.exitCode to a non-zero value when we make sure its done before we return. I also made sure that while trying to start the CMD/ENTRYPOINT, if it fails, then we set the container.exitCode to the exitStatus from the exec().
Closes #8379

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 69a5b827dcf01a6de5949a161606058017014cdc
Component: engine
2014-11-05 18:23:42 -08:00
866705ded6 Merge pull request #8946 from unclejack/stream_decode
Decode JSON to avoid ReadFile
Upstream-commit: b8678aa7f5f2b266644825a460a0126fe6439b76
Component: engine
2014-11-04 09:02:40 -08:00
1ce2377d8b Merge pull request #8390 from MalteJ/set-macaddress
Adding docker-cli run param to set MAC address
Upstream-commit: 9eb8fcd58a5dc0a6fd812fc2bdc410f36dd63cc0
Component: engine
2014-11-04 07:54:59 -08:00
af218ee675 daemon/container: stream & decode JSON
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 4bc28f4e6bb38ec70fb98a4deea723a2d0812d98
Component: engine
2014-11-04 16:14:47 +02:00
c0897a4514 Adding docker-cli run param to set MAC address
Signed-off-by: Malte Janduda <mail@janduda.net>
Upstream-commit: f2df38050e019c0db265e7c3e38ee0de8948ca77
Component: engine
2014-11-01 15:35:09 +01:00
c55ffb34ca fix for iptables cleanup 8307
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: e171eda9989cb5d10e7fe14b258f239edb124541
Component: engine
2014-10-29 10:59:20 -07: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
29e2118279 Merge pull request #8315 from dqminh/save-start-error
Save start error into State.Error when the container fails to start
Upstream-commit: 9094c19a6d69f5adf438463f6a3c19f5dad42bd9
Component: engine
2014-10-24 13:13:00 -07:00
d9b4e1dcc3 Allowing resize tty to only work when container is started
Addresses #8728

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 78a272ce14a43f81a79f1b948d5cfd120405f8c9
Component: engine
2014-10-23 21:31:34 +00:00
98a7bd658b save start error into State.Error
when a container failed to start, saves the error message into State.Error so
that it can be retrieved when calling `docker inspect` instead of having to
look at the log

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: fb6ee865a949905f678aa7c7066c809664a8a4aa
Component: engine
2014-10-22 22:42:37 -04:00
94f641a2fe Make container.Copy support volumes
Fixes #1992

Right now when you `docker cp` a path which is in a volume, the cp
itself works, however you end up getting files that are in the
container's fs rather than the files in the volume (which is not in the
container's fs).
This makes it so when you `docker cp` a path that is in a volume it
follows the volume to the real path on the host.

archive.go has been modified so that when you do `docker cp mydata:/foo
.`, and /foo is the volume, the outputed folder is called "foo" instead
of the volume ID (because we are telling it to tar up
`/var/lib/docker/vfs/dir/<some id>` and not "foo", but the user would be
expecting "foo", not the ID

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: ef98fe0763024abd90bd5a573fec816895ee92e4
Component: engine
2014-10-20 20:23:01 -04:00
161436147c Disable stable IPs.
Stable IPs causes some regressions in the way people use Docker, see GH#8493.

Reverting it for 1.3, we'll enable it back for the next release.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 5b8379a4349105eb387a4b9836bbd1d83ebe6928
Component: engine
2014-10-09 15:15:17 -07:00
e30e6f7d0c Merge pull request #8457 from jfrazelle/pr_8455
Check /etc/resolv.conf every time for 127.* content
Upstream-commit: 4eb812e042e10e8158161ba7d6236a9ca8044ebe
Component: engine
2014-10-08 16:21:14 -07:00
d83fbbbf57 cleanup resolve.conf code
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: dbe6c6651e744bd6f6cab04fcaed2871779d36a0
Component: engine
2014-10-08 15:15:51 -07:00
5e3424acb2 Check /etc/resolv.conf every time for 127.* content
Currently if you start the docker -d on a system with 127.0.0.1 in /etc/resolv.conf
It will set the default dns to 8.8.8.8 8.8.4.4 permanently.

This causes a problem at boot on Fedora machines where NetworkManager has not
populated /etc/resolv.conf before docker gets started.

This fix checks /etc/resolv.conf on every docker run. And only populates
daemon.config.Dns  if the user specified it on the command line.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 9ced509e6d89d1ab4e0c4b49485be7931b505354
Component: engine
2014-10-07 16:19:02 -04:00
dbcd84a852 Container#AllocateNetwork: Simplify error handling.
The defer logic was a little tricky and was hiding one bug: `err` was
being redefined (with `:=`) and thus it escaped the defer error checking
logic.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 300c51c3a4ca47b022eb2efb75d1e8cf7736b0ff
Component: engine
2014-10-06 17:59:12 -07:00
bad1803f92 Stable MAC addresses: Add support for MAC address restoring.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: b669025949f1dba1ad3af9bab6711736863d6e24
Component: engine
2014-10-03 13:46:24 -07:00
5b30bf9410 Stable Networking: Keep the same network settings across container restarts.
This change will allocate network settings (IP and public ports) at
container creation rather than start and keep them throughout the
lifetime of the container (i.e. until it gets destroyed) instead of
discarding them when the container is stopped.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: a4875937293f3b0a8ffc569608bbca40a456e9c8
Component: engine
2014-10-03 13:46:24 -07:00
2fa4089519 Container: Add restore network functionality.
RestoreNetwork() allows the container to restore its NetworkSettings (IP
and public ports).

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: deffc572ced3909c0ecd77dd21686e0e67c0ea33
Component: engine
2014-10-03 13:46:24 -07:00
6b98f72598 Container: Make allocateNetwork and releaseNetwork public.
Since we are moving network allocation outside of container scope (it
will be managed by create/destroy), those functions need to be
accessible from the outside.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: ab4188c08d9eb63c84c461a9b922f2af479b5a04
Component: engine
2014-10-03 13:46:24 -07:00
89c89a77ed Network Allocation: Proper rollback in case of failure allocation.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 103a4e0676f0099759e6f9a29ea1c9dc32766806
Component: engine
2014-10-03 13:46:24 -07:00
4418404026 Support for consistent MAC address.
Right now, MAC addresses are randomly generated by the kernel when
creating the veth interfaces.

This causes different issues related to ARP, such as #4581, #5737 and #8269.

This change adds support for consistent MAC addresses, guaranteeing that
an IP address will always end up with the same MAC address, no matter
what.

Since IP addresses are already guaranteed to be unique by the
IPAllocator, MAC addresses will inherit this property as well for free.

Consistent mac addresses is also a requirement for stable networking (#8297)
since re-using the same IP address on a different MAC address triggers the ARP
issue.

Finally, this change makes the MAC address accessible through docker
inspect, which fixes #4033.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 88e21c6a75310da158bbee3a5fdc135697c93ba1
Component: engine
2014-10-03 13:22:38 -07:00
20022966a7 Merge pull request #8302 from rafecolton/move_archive_package_to_pkg
Move archive package to pkg
Upstream-commit: 4424d15f9936a6cf663d06284c932f91306d9353
Component: engine
2014-10-01 18:03:34 +03: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
3ffb3fc6cc Move Go() promise-like func from utils to pkg/promise
This is the first of two steps to break the archive package's dependence
on utils so that archive may be moved into pkg.  Also, the `Go()`
function is small, concise, and not specific to the docker internals, so
it is a good candidate for pkg.

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
Upstream-commit: b845a62149d5f4990462ac6c9167c5cfaa0e66cb
Component: engine
2014-09-29 23:16:27 -07:00
f73d9c3630 add apparmor:
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: c2c5e57a8ea4b1dc35c58654443a8c4508277904
Component: engine
2014-09-30 00:43:47 +00:00
280ec2913c Strongly type exec driver context
This also removes dead code in the native driver for a past feature that
was never fully implemented.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 32dca1a7b0e800d796e54fc8f253818ba64fa075
Component: engine
2014-09-29 22:40:26 +00:00
113374480e Provide full hostname with domainname to underlying container layer
Addresses #7851

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 5239ba3d06b2efccd986231a93e839d4693d2d0c
Component: engine
2014-09-25 09:23:39 -04:00
1ce355084d Split volumes out from daemon
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
Upstream-commit: 45407cf00af95b04dd2ff11ce330dd397bf1e095
Component: engine
2014-09-19 17:47:47 -05:00
118f175983 Merge pull request #8019 from thockin/add-host
Allow extra lines in /etc/hosts
Upstream-commit: f98a1f1f7d9b3ef10c13fc3b6438c978b4d6aa78
Component: engine
2014-09-16 17:19:16 -07:00
604739ede9 Allow extra lines in /etc/hosts
This adds a --add-host host:ip flag which appends lines to /etc/hosts.  This is needed in places where you want the container to get a different name resolution than it would through DNS.  This was submitted before as #5525, closed, and now I am re-opening.  It has come up 2 or 3 times in the last couple days.

Signed-off-by: Tim Hockin <thockin@google.com>
Upstream-commit: 68e48b65a64df10fc797cbaa89d6caa2188eadc9
Component: engine
2014-09-16 23:38:23 +00: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
ca62c3b92b Splitting the exec remote API into two separate APIs inorder to support resizing of tty sessions.
1. /container/<name>/exec - Creates a new exec command instance in the daemon and container '<name>'. Returns an unique ID for each exec command.
2. /exec/<name>/start - Starts an existing exec command instance. Removes the exec command from the daemon once it completes.

Adding /exec/<name>/resize to resize tty session of an exec command.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: bfebdfde78753f85d53d62634654de0b80f6872d
Component: engine
2014-09-15 22:56:47 +00:00
7af74b4383 Use unlocked version of changes for GetImage
Fixes #7999

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 82bdd88e9c9db40ee8072f7c4c2832dfb3f73823
Component: engine
2014-09-12 11:44:51 +04:00
8627c41d84 Use defined variable
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 555ce0cb54943dab39f16582fc1923467e42af14
Component: engine
2014-09-12 11:42:12 +04:00
765de5955d Merge pull request #7897 from LK4D4/refactoring_net_mode
Add IsPrivate method for NetworkMode
Upstream-commit: f9c345ddfae25d5512b775968fb14ed1abb00504
Component: engine
2014-09-09 14:20:59 -07:00
53bdf11639 Add IsPrivate method for NetworkMode
This method indicates that container using private network stack

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 080ca8619172b020c7da29b46f2fe4c939bb47ca
Component: engine
2014-09-10 00:46:43 +04:00
2ff1cc83fb fixes #7802, when api version 1.11 is json.Marshaling the container struct
Signed-off-by: Jessica Frazelle <jfrazelle@users.noreply.github.com>

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jfrazelle@users.noreply.github.com> (github: )
Upstream-commit: f49c3f287b0d26dc705940effa0ec03e1de7bb99
Component: engine
2014-09-08 09:30:33 -07:00
dc74831ee4 Don't initialize network for 'none' mode
Fixes #7837

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: ba24820284a7a87642f2b668987c1627d6977ea2
Component: engine
2014-09-04 09:50:58 +04: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