Commit graph

166 commits

Author SHA1 Message Date
Michael Crosby
37b69408f8 Merge pull request #10056 from coolljt0725/add_link_accept_ID
Add --link accept container ID
2015-01-14 12:50:10 -08:00
Sebastiaan van Stijn
78820a63d6 Mention "or rename" again in error-message.
The "or rename" part was removed from the error-message,
because renaming wasn't possible at the time.

Now that https://github.com/docker/docker/pull/8570 is merged,
renaming existing containers is possible.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2015-01-13 21:57:48 +01:00
Srini Brahmaroutu
21a809d9ae rename a existing container
Closes #3036

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-01-13 03:27:17 +00:00
Lei Jitang
400d92871c Add --link accept container ID
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-01-13 09:38:12 +08:00
Malte Janduda
813ff7f19d Adding IPv6 network support to docker
Signed-off-by: Malte Janduda <mail@janduda.net>
2015-01-09 00:13:09 +01:00
Tibor Vass
6870bde584 Merge pull request #8456 from lindenlab/cleanup-repository-info
Cleanup: Replace ResolveRepositoryName with RepositoryInfo{}
2015-01-08 17:19:03 -05:00
Alexander Morozov
92af1f0145 Merge pull request #9648 from estesp/9202-update-resolvconf
Update container resolv.conf when host network changes /etc/resolv.conf
2015-01-08 14:06:55 -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
Phil Estes
63a7ccdd23 Update container resolv.conf when host network changes /etc/resolv.conf
Only modifies non-running containers resolv.conf bind mount, and only if
the container has an unmodified resolv.conf compared to its contents at
container start time (so we don't overwrite manual/automated changes
within the container runtime). For containers which are running when
the host resolv.conf changes, the update will only be applied to the
container version of resolv.conf when the container is "bounced" down
and back up (e.g. stop/start or restart)

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-01-08 14:15:13 -05:00
Jessica Frazelle
83ef40cbe9 Cleanup unnecessary var.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-06 11:35:49 -08:00
Jessie Frazelle
84dc197b08 Merge pull request #8941 from agonzalezro/log-duplicates
Log when truncindex.Get returns >1 container
2015-01-06 10:41:19 -08:00
unknown
aa9c9569c2 Improve error message for conflicting container name.
This changes the error message that is returned by the daemon when
a container-name already exists.

The old message suggests that containers can be renamed, which is
currently not possible.

To prevent confusion, the part "(or rename)" is removed from
the error-message.

Message before this change;

    FATA[0000] Error response from daemon: Conflict, The name foobar is already assigned to 728ac36fb0ab. You have to delete (or rename) that container to be able to assign foobar to a container again.

Message after this change;

    FATA[0000] Error response from daemon: Conflict. The name 'foobar' is already in use by container 728ac36fb0ab. You have to delete that container to be able to reuse that name.

Relates to: https://github.com/docker/docker/issues/3036

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2014-12-22 09:59:08 +01: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
Michael Crosby
17cacf3326 Merge pull request #9643 from LK4D4/fix_vet_errors
Fix vet errors
2014-12-16 12:04:15 -08:00
Arnaud Porterie
a76f7c6ec3 Merge pull request #9122 from dqminh/debug-huge-expose
Expose a large number of ports should not slow down builder
2014-12-16 10:03:31 -08:00
Álex González
be27d97118 Log when truncindex.Get returns >1 container
When the user is not using the full has to retrieve a container it's
possible that we find conflicts with the ids of other containers.

At the moment it's just failing saying that it can not find a container,
but it doesn't say why. Adding a small log saying that duplicates where
found is going to help the user.

Closes #8098

Signed-off-by: Alex Gonzalez <agonzalezro@gmail.com>
2014-12-13 17:43:05 +00:00
Alexander Morozov
e7d086c2be Fix vet errors about unkeyed fields
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-12 10:44:59 -08:00
Jessica Frazelle
6743be44ca Running a container that links to a container with --net host
should throw an error.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-12-08 11:33:18 -08:00
Arnaud Porterie
59da197de8 Remove unused Engine.Logf
The `Engine.Logf` method was unused and confusing.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-02 10:47:57 -08:00
Jessie Frazelle
00c2a8f323 Merge pull request #9208 from duglin/Issue8703
Add support for docker exec to return cmd exitStatus
2014-11-25 18:03:51 -08:00
Doug Davis
90928eb114 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>
2014-11-25 17:49:25 -08:00
Michael Crosby
294843ef23 Move security opts to HostConfig
These settings need to be in the HostConfig so that they are not
committed to an image and cannot introduce a security issue.

We can safely move this field from the Config to the HostConfig
without any regressions because these settings are consumed at container
created and used to populate fields on the Container struct.  Because of
this, existing settings will be honored for containers already created
on a daemon with custom security settings and prevent values being
consumed via an Image.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Conflicts:
	daemon/create.go
		changing config to hostConfig was required to fix the
		 build
2014-11-25 01:02:30 +02:00
Victor Vieux
9a85f60c75 add ID and Hostname in docker info
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-11-17 19:23:41 +00:00
Doug Davis
2facc04673 Add --log-level support
Next steps, in another PR, would be:
- make all logging go through the logrus stuff
- I'd like to see if we can remove the env var stuff (like DEBUG) but we'll see

Closes #5198

Signed-off-by: Doug Davis <dug@us.ibm.com>
2014-11-15 09:00:48 -08:00
Daniel, Dao Quang Minh
a2a50aa35a use cached images instead of fetching the same image again
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-11-12 00:04:45 -05:00
Vishnu Kannan
46f2944977 Address comments.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-11-08 00:14:08 +00:00
Vishnu Kannan
f96e04ffc7 This patch adds ability in docker to detect out of memory conditions in containers.
Since the containers can handle the out of memory kernel kills gracefully, docker
will only provide out of memory information as an additional metadata as part of
container status.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-11-08 00:14:08 +00:00
Blake Geno
224999d9c2 made getDefaultNetworkMtu private
Signed-off-by: Blake Geno <blakegeno@gmail.com>
2014-11-04 18:53:34 -05:00
Jessie Frazelle
f68b8b33e6 Merge pull request #8850 from shuai-z/clean-mount
Clear the internal state before raising error.
2014-10-30 18:01:01 -07: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
shuai-z
05ff40b07a Clear the internal state ourselves before raising error.
If we need to raise an error, make sure the internal state is clean, because
a successful driver.Get() may have its internal state changed (eg. counting,
or mounts), while callers will only do that after a succussful Mount().

Signed-off-by: shuai-z <zs.broccoli@gmail.com>
2014-10-30 13:31:19 +08: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
3893e220e8 Setting iptables=false should propagate to ip-masq=false
Signed-off-by: Jessica Frazelle <jess@docker.com>
2014-10-16 11:52:14 -07:00
Andrea Luzzardi
5b8379a434 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>
2014-10-09 15:15:17 -07:00
Michael Crosby
4eb812e042 Merge pull request #8457 from jfrazelle/pr_8455
Check /etc/resolv.conf every time for 127.* content
2014-10-08 16:21:14 -07:00
Brian Goff
9acf7c765c Restore volume refs after daemon restart
Volume refs were not being restored on daemon restart.
This made it possible to remove a volume being used by other containers
after a daemon restart.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2014-10-08 14:17:27 -04:00
Dan Walsh
9ced509e6d 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)
2014-10-07 16:19:02 -04:00
Victor Vieux
d152a93b5f Merge pull request #8297 from aluzzardi/f-stable-ip
Stable Networking: Keep the same network settings during the entire container lifecycle.
2014-10-03 14:19:46 -07:00
Andrea Luzzardi
f1087c5fcf Daemon: Restore network settings at startup.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2014-10-03 13:46:24 -07: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
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
unclejack
4424d15f99 Merge pull request #8302 from rafecolton/move_archive_package_to_pkg
Move archive package to pkg
2014-10-01 18:03:34 +03:00
Victor Vieux
08547dff29 update tests
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-09-30 19:10:03 +00: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
c2c5e57a8e add apparmor:
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-09-30 00:43:47 +00:00
Dan Walsh
87e732a0f3 Add --security-opts options to allow user to customize security configuration
security-opts will allow you to customise the security subsystem.

For example the labeling system like SELinux will run on a container.

    --security-opt="label:user:USER"   : Set the label user for the container
    --security-opt="label:role:ROLE"   : Set the label role for the container
    --security-opt="label:type:TYPE"   : Set the label type for the container
    --security-opt="label:level:LEVEL" : Set the label level for the container
    --security-opt="label:disabled"    : Turn off label confinement for the container

Since we are passing a list of string options instead of a space separated
string of options, I will change function calls to use InitLabels instead of
GenLabels.  Genlabels interface is Depracated.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-09-30 00:06:22 +00:00
Dan Walsh
a297d6ab8c Replace utils.CheckLocalDns with bytes.Contains line
Since RemoveLocalDns patch will  remove all localhost entries
from resolv.conf we no longer need anything more then
!bytes.Contains(resolvConf, []byte("nameserver")

To check for no nameserver entry in dns config.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-09-29 06:37:31 -04:00
Dan Walsh
65640994fd Remove nameserver 127.0.0.1 line rather then dumping resolv.conf
We have a bug report complaining about docker dumping the contents of the
hosts resolv.conf if it container 127.0.0.1.  They asked that instead
of dropping the file altogether, that we just remove the line.

This patch removes the 127.0.0.1 lines, if they exist and then
checks if any nameserver lines exist.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-09-29 06:37:31 -04:00
Dan Walsh
9e2eb0f1cc --selinux-enabled flag should be ignored on Disabled SELinux systems
On Fedora and RHEL we ship selinux-enabled flag in the docker.service config,
but if people setup the /var/lib/docker as btrfs and disable SELinux,
we should not block the daemon from running.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-09-23 13:21:25 -04:00
unclejack
9fb34ae571 Merge pull request #6101 from LK4D4/ip_range_#4986
Implement allocating IPs from CIDR within bridge network
2014-09-22 17:09:16 +03:00